chromium-browser 87.0.4280.109
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/third_party/protobuf/src/google/protobuf/repeated_field.h b/third_party/protobuf/src/google/protobuf/repeated_field.h
|
||||
index b5b193c..4434854 100644
|
||||
--- a/third_party/protobuf/src/google/protobuf/repeated_field.h
|
||||
+++ b/third_party/protobuf/src/google/protobuf/repeated_field.h
|
||||
@@ -804,7 +804,7 @@ class StringTypeHandler {
|
||||
// RepeatedPtrField is like RepeatedField, but used for repeated strings or
|
||||
// Messages.
|
||||
template <typename Element>
|
||||
-class RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
|
||||
+class PROTOBUF_EXPORT RepeatedPtrField final : private internal::RepeatedPtrFieldBase {
|
||||
public:
|
||||
RepeatedPtrField();
|
||||
explicit RepeatedPtrField(Arena* arena);
|
||||
@@ -0,0 +1,81 @@
|
||||
From 5d66d5907ac3e76d1e382b8a8e8afe653bd00f4c Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sun, 31 May 2020 13:59:15 +0000
|
||||
Subject: [PATCH] Fix GCC build with PROTOBUF_USE_DLLS enabled
|
||||
|
||||
GCC does not allow mixing __attribute__(()) syntax and alignas()
|
||||
syntax. Re-use approach from chromium base/compiler_specific.h
|
||||
---
|
||||
.../protobuf/src/google/protobuf/arena.h | 2 +-
|
||||
.../protobuf/src/google/protobuf/port_def.inc | 29 +++++++++++++++++++
|
||||
.../src/google/protobuf/port_undef.inc | 1 +
|
||||
3 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h
|
||||
index dedc221..a8515ce 100644
|
||||
--- a/third_party/protobuf/src/google/protobuf/arena.h
|
||||
+++ b/third_party/protobuf/src/google/protobuf/arena.h
|
||||
@@ -245,7 +245,7 @@ struct ArenaOptions {
|
||||
// well as protobuf container types like RepeatedPtrField and Map. The protocol
|
||||
// is internal to protobuf and is not guaranteed to be stable. Non-proto types
|
||||
// should not rely on this protocol.
|
||||
-class PROTOBUF_EXPORT alignas(8) Arena final {
|
||||
+class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
|
||||
public:
|
||||
// Arena constructor taking custom options. See ArenaOptions below for
|
||||
// descriptions of the options available.
|
||||
diff --git a/third_party/protobuf/src/google/protobuf/port_def.inc b/third_party/protobuf/src/google/protobuf/port_def.inc
|
||||
index f1bd85d..6d02b53 100644
|
||||
--- a/third_party/protobuf/src/google/protobuf/port_def.inc
|
||||
+++ b/third_party/protobuf/src/google/protobuf/port_def.inc
|
||||
@@ -528,6 +528,35 @@ PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
|
||||
#undef IN
|
||||
#endif // _MSC_VER
|
||||
|
||||
+// Specify memory alignment for structs, classes, etc.
|
||||
+// Use like:
|
||||
+// class PROTOBUF_ALIGNAS(16) MyClass { ... }
|
||||
+// PROTOBUF_ALIGNAS(16) int array[4];
|
||||
+//
|
||||
+// In most places you can use the C++11 keyword "alignas", which is preferred.
|
||||
+//
|
||||
+// But compilers have trouble mixing __attribute__((...)) syntax with
|
||||
+// alignas(...) syntax.
|
||||
+//
|
||||
+// Doesn't work in clang or gcc:
|
||||
+// struct alignas(16) __attribute__((packed)) S { char c; };
|
||||
+// Works in clang but not gcc:
|
||||
+// struct __attribute__((packed)) alignas(16) S2 { char c; };
|
||||
+// Works in clang and gcc:
|
||||
+// struct alignas(16) S3 { char c; } __attribute__((packed));
|
||||
+//
|
||||
+// There are also some attributes that must be specified *before* a class
|
||||
+// definition: visibility (used for exporting functions/classes) is one of
|
||||
+// these attributes. This means that it is not possible to use alignas() with a
|
||||
+// class that is marked as exported.
|
||||
+#if defined(_MSC_VER)
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) __declspec(align(byte_alignment))
|
||||
+#elif defined(__GNUC__)
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
|
||||
+#else
|
||||
+#define PROTOBUF_ALIGNAS(byte_alignment) alignas(byte_alignment)
|
||||
+#endif
|
||||
+
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
// TODO(gerbens) ideally we cleanup the code. But a cursory try shows many
|
||||
diff --git a/third_party/protobuf/src/google/protobuf/port_undef.inc b/third_party/protobuf/src/google/protobuf/port_undef.inc
|
||||
index b7e67fe..ba1fffc 100644
|
||||
--- a/third_party/protobuf/src/google/protobuf/port_undef.inc
|
||||
+++ b/third_party/protobuf/src/google/protobuf/port_undef.inc
|
||||
@@ -80,6 +80,7 @@
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport
|
||||
#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
|
||||
+#undef PROTOBUF_ALIGNAS
|
||||
|
||||
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
From 08ac7188f414218ac9d764e29e7aa64a6bfc2f96 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Sun, 31 May 2020 10:02:03 +0000
|
||||
Subject: [PATCH] disable clang-format for generated code in blink
|
||||
|
||||
For GCC builds clang-format might be not available. Additionally,
|
||||
current scripts look for clang-format within chromium sources and
|
||||
don't consider system clang-format.
|
||||
---
|
||||
.../bindings/scripts/bind_gen/codegen_utils.py | 10 +---------
|
||||
1 file changed, 1 insertion(+), 9 deletions(-)
|
||||
|
||||
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
index 7021f1a..33bf5bf 100644
|
||||
--- a/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
+++ b/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py
|
||||
@@ -150,12 +150,4 @@ def write_code_node_to_file(code_node, filepath):
|
||||
|
||||
rendered_text = render_code_node(code_node)
|
||||
|
||||
- format_result = style_format.auto_format(rendered_text, filename=filepath)
|
||||
- if not format_result.did_succeed:
|
||||
- raise RuntimeError("Style-formatting failed: filename = {filename}\n"
|
||||
- "---- stderr ----\n"
|
||||
- "{stderr}:".format(
|
||||
- filename=format_result.filename,
|
||||
- stderr=format_result.error_message))
|
||||
-
|
||||
- web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents)
|
||||
+ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From c4f6e8cd34a245c3640b86a91c9694d69594d80b Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Wed, 16 Sep 2020 15:05:02 +0000
|
||||
Subject: [PATCH] IWYU: ui::CursorFactory is now required independent from
|
||||
Ozone
|
||||
|
||||
---
|
||||
.../ui/views/chrome_browser_main_extra_parts_views_linux.cc | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
||||
index 5a97d61..ccedd2a 100644
|
||||
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
||||
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "chrome/browser/themes/theme_service_aura_linux.h"
|
||||
#include "chrome/browser/ui/browser_list.h"
|
||||
#include "chrome/browser/ui/views/theme_profile_key.h"
|
||||
+#include "ui/base/cursor/cursor_factory.h"
|
||||
#include "ui/display/screen.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
|
||||
@@ -15,10 +16,6 @@
|
||||
#include "ui/gtk/gtk_ui_delegate.h"
|
||||
#endif
|
||||
|
||||
-#if defined(USE_OZONE)
|
||||
-#include "ui/base/cursor/cursor_factory.h"
|
||||
-#endif
|
||||
-
|
||||
#if defined(USE_X11)
|
||||
#include "ui/gfx/x/connection.h" // nogncheck
|
||||
#if BUILDFLAG(USE_GTK)
|
||||
--
|
||||
2.26.2
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
Bug: https://bugs.gentoo.org/750038
|
||||
Upstream bug: https://crbug.com/1135070
|
||||
|
||||
--- a/content/browser/service_worker/service_worker_container_host.cc
|
||||
+++ b/content/browser/service_worker/service_worker_container_host.cc
|
||||
@@ -626,6 +626,16 @@
|
||||
int64_t registration_id) {
|
||||
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
|
||||
DCHECK(base::Contains(registration_object_hosts_, registration_id));
|
||||
+
|
||||
+ // ServiceWorkerRegistrationObjectHost to be deleted may have the last reference to
|
||||
+ // ServiceWorkerRegistration that indirectly owns this ServiceWorkerContainerHost.
|
||||
+ // If we erase the object host directly from the map, |this| could be deleted
|
||||
+ // during the map operation and may crash. To avoid the case, we take the
|
||||
+ // ownership of the object host from the map first, and then erase the entry
|
||||
+ // from the map. See https://crbug.com/1135070 for details.
|
||||
+ std::unique_ptr<ServiceWorkerRegistrationObjectHost> to_be_deleted =
|
||||
+ std::move(registration_object_hosts_[registration_id]);
|
||||
+ DCHECK(to_be_deleted);
|
||||
registration_object_hosts_.erase(registration_id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
From f4d0b0eb899005b4b8b6388e1d8bb82cc0018fc8 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Gilbert <floppym@gentoo.org>
|
||||
Date: Thu, 1 Oct 2020 18:14:51 +0000
|
||||
Subject: [PATCH] Disable various compiler configs
|
||||
|
||||
---
|
||||
build/config/compiler/BUILD.gn | 71 ++++++++--------------------------
|
||||
1 file changed, 17 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index 4f6461b..b5d2c77 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -254,8 +254,6 @@ config("compiler") {
|
||||
|
||||
configs += [
|
||||
# See the definitions below.
|
||||
- ":clang_revision",
|
||||
- ":compiler_cpu_abi",
|
||||
":compiler_codegen",
|
||||
":compiler_deterministic",
|
||||
]
|
||||
@@ -480,36 +478,6 @@ config("compiler") {
|
||||
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
|
||||
}
|
||||
|
||||
- if (is_clang && !is_nacl && !use_xcode_clang) {
|
||||
- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
|
||||
-
|
||||
- cflags += [
|
||||
- # TODO(hans): Remove this once Clang generates better optimized debug info
|
||||
- # by default. https://crbug.com/765793
|
||||
- "-mllvm",
|
||||
- "-instcombine-lower-dbg-declare=0",
|
||||
- ]
|
||||
-
|
||||
- # Pinned clang has enable-dse-memoryssa enabled by default but it's broken,
|
||||
- # so we have to force it off.
|
||||
- # Trunk clang has it disabled by default but it might work, so we force it
|
||||
- # on so the ToT bots can check if it works now.
|
||||
- if (!llvm_force_head_revision) {
|
||||
- cflags += [
|
||||
- # TODO(https://crbug.com/1127713): Investigate, remove.
|
||||
- "-mllvm",
|
||||
- "-enable-dse-memoryssa=false",
|
||||
- ]
|
||||
- }
|
||||
- if (llvm_force_head_revision) {
|
||||
- cflags += [
|
||||
- # TODO(https://crbug.com/1127713): Investigate, remove.
|
||||
- "-mllvm",
|
||||
- "-enable-dse-memoryssa=true",
|
||||
- ]
|
||||
- }
|
||||
- }
|
||||
-
|
||||
# C11/C++11 compiler flags setup.
|
||||
# ---------------------------
|
||||
if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) ||
|
||||
@@ -1571,7 +1539,7 @@ config("chromium_code") {
|
||||
defines = [ "_HAS_NODISCARD" ]
|
||||
}
|
||||
} else {
|
||||
- cflags = [ "-Wall" ]
|
||||
+ cflags = []
|
||||
if (treat_warnings_as_errors) {
|
||||
cflags += [ "-Werror" ]
|
||||
|
||||
@@ -1580,10 +1548,6 @@ config("chromium_code") {
|
||||
# well.
|
||||
ldflags = [ "-Werror" ]
|
||||
}
|
||||
- if (is_clang) {
|
||||
- # Enable extra warnings for chromium_code when we control the compiler.
|
||||
- cflags += [ "-Wextra" ]
|
||||
- }
|
||||
|
||||
# In Chromium code, we define __STDC_foo_MACROS in order to get the
|
||||
# C99 macros on Mac and Linux.
|
||||
@@ -1592,15 +1556,6 @@ config("chromium_code") {
|
||||
"__STDC_FORMAT_MACROS",
|
||||
]
|
||||
|
||||
- if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
|
||||
- current_cpu != "s390" && current_cpu != "ppc64" &&
|
||||
- current_cpu != "mips" && current_cpu != "mips64") {
|
||||
- # Non-chromium code is not guaranteed to compile cleanly with
|
||||
- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
|
||||
- # disabled, so only do that for Release build.
|
||||
- defines += [ "_FORTIFY_SOURCE=2" ]
|
||||
- }
|
||||
-
|
||||
if (is_mac) {
|
||||
cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
|
||||
cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
|
||||
@@ -1998,7 +1953,8 @@ config("default_stack_frames") {
|
||||
}
|
||||
|
||||
# Default "optimization on" config.
|
||||
-config("optimize") {
|
||||
+config("optimize") { }
|
||||
+config("xoptimize") {
|
||||
if (is_win) {
|
||||
if (chrome_pgo_phase != 2) {
|
||||
# Favor size over speed, /O1 must be before the common flags.
|
||||
@@ -2033,7 +1989,8 @@ config("optimize") {
|
||||
}
|
||||
|
||||
# Turn off optimizations.
|
||||
-config("no_optimize") {
|
||||
+config("no_optimize") { }
|
||||
+config("xno_optimize") {
|
||||
if (is_win) {
|
||||
cflags = [
|
||||
"/Od", # Disable optimization.
|
||||
@@ -2073,7 +2030,8 @@ config("no_optimize") {
|
||||
# Turns up the optimization level. On Windows, this implies whole program
|
||||
# optimization and link-time code generation which is very expensive and should
|
||||
# be used sparingly.
|
||||
-config("optimize_max") {
|
||||
+config("optimize_max") { }
|
||||
+config("xoptimize_max") {
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -2105,7 +2063,8 @@ config("optimize_max") {
|
||||
#
|
||||
# TODO(crbug.com/621335) - rework how all of these configs are related
|
||||
# so that we don't need this disclaimer.
|
||||
-config("optimize_speed") {
|
||||
+config("optimize_speed") { }
|
||||
+config("xoptimize_speed") {
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -2130,7 +2089,8 @@ config("optimize_speed") {
|
||||
}
|
||||
}
|
||||
|
||||
-config("optimize_fuzzing") {
|
||||
+config("optimize_fuzzing") { }
|
||||
+config("xoptimize_fuzzing") {
|
||||
cflags = [ "-O1" ] + common_optimize_on_cflags
|
||||
ldflags = common_optimize_on_ldflags
|
||||
visibility = [ ":default_optimization" ]
|
||||
@@ -2247,7 +2207,8 @@ config("win_pdbaltpath") {
|
||||
}
|
||||
|
||||
# Full symbols.
|
||||
-config("symbols") {
|
||||
+config("symbols") { }
|
||||
+config("xsymbols") {
|
||||
if (is_win) {
|
||||
if (is_clang) {
|
||||
cflags = [ "/Z7" ] # Debug information in the .obj files.
|
||||
@@ -2355,7 +2316,8 @@ config("symbols") {
|
||||
# Minimal symbols.
|
||||
# This config guarantees to hold symbol for stack trace which are shown to user
|
||||
# when crash happens in unittests running on buildbot.
|
||||
-config("minimal_symbols") {
|
||||
+config("minimal_symbols") { }
|
||||
+config("xminimal_symbols") {
|
||||
if (is_win) {
|
||||
# Functions, files, and line tables only.
|
||||
cflags = []
|
||||
@@ -2408,7 +2370,8 @@ config("minimal_symbols") {
|
||||
# This configuration contains function names only. That is, the compiler is
|
||||
# told to not generate debug information and the linker then just puts function
|
||||
# names in the final debug information.
|
||||
-config("no_symbols") {
|
||||
+config("no_symbols") { }
|
||||
+config("xno_symbols") {
|
||||
if (is_win) {
|
||||
ldflags = [ "/DEBUG" ]
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 0c0af4cabb7490db473cd2c28f069956974a4d98 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Fri, 2 Oct 2020 12:11:58 +0000
|
||||
Subject: [PATCH] IWYU: uint8_t is defined in stdint.h
|
||||
|
||||
---
|
||||
third_party/openscreen/src/util/crypto/random_bytes.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/third_party/openscreen/src/util/crypto/random_bytes.h b/third_party/openscreen/src/util/crypto/random_bytes.h
|
||||
index 3cb2fa8..025b52c 100644
|
||||
--- a/third_party/openscreen/src/util/crypto/random_bytes.h
|
||||
+++ b/third_party/openscreen/src/util/crypto/random_bytes.h
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
+#include <stdint.h>
|
||||
+
|
||||
namespace openscreen {
|
||||
|
||||
std::array<uint8_t, 16> GenerateRandomBytes16();
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From 4f4604877f3b666ac7a373ae443e3c3795424569 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Hartmann <stha09@googlemail.com>
|
||||
Date: Fri, 6 Nov 2020 11:18:42 +0000
|
||||
Subject: [PATCH] GCC: fix attribute on function definition
|
||||
|
||||
GCC does not accept attributes at the end for function definitions.
|
||||
Solution is to move it before function name. Otherwise GCC fails like
|
||||
this:
|
||||
|
||||
../../base/compiler_specific.h:97:28: error: attributes are not allowed
|
||||
on a function-definition
|
||||
97 | #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
| ^~~~~~~~~~~~~
|
||||
../../media/gpu/vaapi/vaapi_wrapper.h:322:36: note: in
|
||||
expansion of macro 'WARN_UNUSED_RESULT'
|
||||
322 | const T* data) WARN_UNUSED_RESULT {
|
||||
| ^~~~~~~~~~~~~~~~~~
|
||||
---
|
||||
media/gpu/vaapi/vaapi_wrapper.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
|
||||
index fd1fd82..deeda1f 100644
|
||||
--- a/media/gpu/vaapi/vaapi_wrapper.h
|
||||
+++ b/media/gpu/vaapi/vaapi_wrapper.h
|
||||
@@ -318,8 +318,8 @@ class MEDIA_GPU_EXPORT VaapiWrapper
|
||||
// Convenient templatized version of SubmitBuffer() where |size| is deduced to
|
||||
// be the size of the type of |*data|.
|
||||
template <typename T>
|
||||
- bool SubmitBuffer(VABufferType va_buffer_type,
|
||||
- const T* data) WARN_UNUSED_RESULT {
|
||||
+ bool WARN_UNUSED_RESULT SubmitBuffer(VABufferType va_buffer_type,
|
||||
+ const T* data) {
|
||||
return SubmitBuffer(va_buffer_type, sizeof(T), data);
|
||||
}
|
||||
// Batch-version of SubmitBuffer(), where the lock for accessing libva is
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/base/strings/char_traits.h
|
||||
+++ b/base/strings/char_traits.h
|
||||
@@ -67,9 +67,9 @@
|
||||
return __builtin_memcmp(s1, s2, n);
|
||||
#else
|
||||
for (; n; --n, ++s1, ++s2) {
|
||||
- if (*s1 < *s2)
|
||||
+ if ((unsigned char)*s1 < (unsigned char)*s2)
|
||||
return -1;
|
||||
- if (*s1 > *s2)
|
||||
+ if ((unsigned char)*s1 > (unsigned char)*s2)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -0,0 +1,100 @@
|
||||
From f25787b72c20e97cdeb74e037dc1ff56a88b45c6 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Wagner <bungeman@google.com>
|
||||
Date: Tue, 1 Dec 2020 20:22:00 -0500
|
||||
Subject: [PATCH] Subpixel anti-aliasing in FreeType 2.8.1+
|
||||
|
||||
FreeType 2.8.1 and later always provide some form of subpixel
|
||||
anti-aliasing.
|
||||
|
||||
Bug: skia:10950,skia:6663
|
||||
Change-Id: I666cc942e73b73073cdabf900c25faa10d9aaf0f
|
||||
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339861
|
||||
Reviewed-by: Herb Derby <herb@google.com>
|
||||
Commit-Queue: Ben Wagner <bungeman@google.com>
|
||||
---
|
||||
src/ports/SkFontHost_FreeType.cpp | 33 ++++++++++++++++++++-----------
|
||||
1 file changed, 22 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
|
||||
index 990eff4f5e..c0aeb792da 100644
|
||||
--- a/third_party/skia/src/ports/SkFontHost_FreeType.cpp
|
||||
+++ b/third_party/skia/src/ports/SkFontHost_FreeType.cpp
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "src/utils/SkMatrix22.h"
|
||||
|
||||
#include <memory>
|
||||
+#include <tuple>
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_ADVANCES_H
|
||||
@@ -147,13 +148,16 @@ public:
|
||||
// *reinterpret_cast<void**>(&procPtr) = dlsym(self, "proc");
|
||||
// because clang has not implemented DR573. See http://clang.llvm.org/cxx_dr_status.html .
|
||||
|
||||
- FT_Int major, minor, patch;
|
||||
- FT_Library_Version(fLibrary, &major, &minor, &patch);
|
||||
+ using Version = std::tuple<FT_Int, FT_Int, FT_Int>;
|
||||
+ Version version;
|
||||
+ FT_Library_Version(fLibrary, &std::get<0>(version),
|
||||
+ &std::get<1>(version),
|
||||
+ &std::get<2>(version));
|
||||
|
||||
#if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02070100
|
||||
fGetVarDesignCoordinates = FT_Get_Var_Design_Coordinates;
|
||||
#elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
|
||||
- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 0))) {
|
||||
+ if (Version(2,7,0) <= version) {
|
||||
//The FreeType library is already loaded, so symbols are available in process.
|
||||
void* self = dlopen(nullptr, RTLD_LAZY);
|
||||
if (self) {
|
||||
@@ -166,7 +170,7 @@ public:
|
||||
#if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02070200
|
||||
FT_Set_Default_Properties(fLibrary);
|
||||
#elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
|
||||
- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 1))) {
|
||||
+ if (Version(2,7,1) <= version) {
|
||||
//The FreeType library is already loaded, so symbols are available in process.
|
||||
void* self = dlopen(nullptr, RTLD_LAZY);
|
||||
if (self) {
|
||||
@@ -185,7 +189,7 @@ public:
|
||||
#if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080000
|
||||
fLightHintingIsYOnly = true;
|
||||
#else
|
||||
- if (major > 2 || ((major == 2 && minor > 8) || (major == 2 && minor == 8 && patch >= 0))) {
|
||||
+ if (Version(2,8,0) <= version) {
|
||||
fLightHintingIsYOnly = true;
|
||||
}
|
||||
#endif
|
||||
@@ -194,7 +198,7 @@ public:
|
||||
#if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080100
|
||||
fGetVarAxisFlags = FT_Get_Var_Axis_Flags;
|
||||
#elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
|
||||
- if (major > 2 || ((major == 2 && minor > 7) || (major == 2 && minor == 7 && patch >= 0))) {
|
||||
+ if (Version(2,7,0) <= version) {
|
||||
//The FreeType library is already loaded, so symbols are available in process.
|
||||
void* self = dlopen(nullptr, RTLD_LAZY);
|
||||
if (self) {
|
||||
@@ -204,11 +208,18 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
- // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
|
||||
- // The default has changed over time, so this doesn't mean the same thing to all users.
|
||||
- if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
|
||||
- fIsLCDSupported = true;
|
||||
- fLCDExtra = 2; //Using a filter adds one full pixel to each side.
|
||||
+ fIsLCDSupported =
|
||||
+ // Subpixel anti-aliasing may be unfiltered until the LCD filter is set.
|
||||
+ // Newer versions may still need this, so this test with side effects must come first.
|
||||
+ // The default has changed over time, so this doesn't mean the same thing to all users.
|
||||
+ (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) ||
|
||||
+
|
||||
+ // In 2.8.1 and later FreeType always provides some form of subpixel anti-aliasing.
|
||||
+ ((SK_FREETYPE_MINIMUM_RUNTIME_VERSION) >= 0x02080100) ||
|
||||
+ (Version(2,8,1) <= version);
|
||||
+
|
||||
+ if (fIsLCDSupported) {
|
||||
+ fLCDExtra = 2; // Using a filter may require up to one full pixel to each side.
|
||||
}
|
||||
}
|
||||
~FreeTypeLibrary() {
|
||||
@@ -0,0 +1,58 @@
|
||||
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-10-07 09:38:47.000000000 -0700
|
||||
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 2020-10-08 14:09:34.550174093 -0700
|
||||
@@ -698,7 +698,6 @@
|
||||
// The X11/ANGLE implementation can use |vaapi_wrapper_| to copy from an
|
||||
// internal libva buffer into an X Pixmap without having to use a processing
|
||||
// wrapper.
|
||||
-#if !defined(USE_X11)
|
||||
// If we aren't in BufferAllocationMode::kNone, we have to allocate a
|
||||
// |vpp_vaapi_wrapper_| for VaapiPicture to DownloadFromSurface() the VA's
|
||||
// internal decoded frame.
|
||||
@@ -708,6 +707,7 @@
|
||||
VaapiWrapper::kVideoProcess, VAProfileNone,
|
||||
base::Bind(&ReportVaapiErrorToUMA,
|
||||
"Media.VaapiVideoDecodeAccelerator.Vpp.VAAPIError"));
|
||||
+#if !defined(USE_X11)
|
||||
RETURN_AND_NOTIFY_ON_FAILURE(vpp_vaapi_wrapper_,
|
||||
"Failed to initialize VppVaapiWrapper",
|
||||
PLATFORM_FAILURE, );
|
||||
@@ -715,11 +715,15 @@
|
||||
RETURN_AND_NOTIFY_ON_FAILURE(
|
||||
vpp_vaapi_wrapper_->CreateContext(gfx::Size()),
|
||||
"Failed to create Context", PLATFORM_FAILURE, );
|
||||
+#else
|
||||
+ if (vpp_vaapi_wrapper_)
|
||||
+ vpp_vaapi_wrapper_->CreateContext(gfx::Size());
|
||||
+#endif // !defined(USE_X11)
|
||||
}
|
||||
- vaapi_wrapper_for_picture = vpp_vaapi_wrapper_;
|
||||
+ vaapi_wrapper_for_picture = (vpp_vaapi_wrapper_)?
|
||||
+ vpp_vaapi_wrapper_:vaapi_wrapper_for_picture;
|
||||
}
|
||||
|
||||
-#endif // !defined(USE_X11)
|
||||
|
||||
for (size_t i = 0; i < buffers.size(); ++i) {
|
||||
// TODO(b/139460315): Create with buffers[i] once the AMD driver issue is
|
||||
--- a/ui/gl/gl_image_native_pixmap.cc 2020-05-18 11:40:06.000000000 -0700
|
||||
+++ b/ui/gl/gl_image_native_pixmap.cc 2020-05-22 02:07:16.007770442 -0700
|
||||
@@ -288,6 +288,8 @@
|
||||
std::move(scoped_fd));
|
||||
}
|
||||
|
||||
+ handle.planes[0].size = size_.GetArea();
|
||||
+
|
||||
return handle;
|
||||
#endif // !defined(OS_FUCHSIA)
|
||||
}
|
||||
--- a/gpu/command_buffer/service/error_state.cc 2020-05-18 11:39:22.000000000 -0700
|
||||
+++ b/gpu/command_buffer/service/error_state.cc 2020-05-22 13:43:09.181180388 -0700
|
||||
@@ -115,6 +115,8 @@
|
||||
// buffer.
|
||||
error = GL_NO_ERROR;
|
||||
}
|
||||
+ if (error == GL_INVALID_ENUM)
|
||||
+ error = GL_NO_ERROR;
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user