Roll third_party/skia/ 6c113cb8d..ee68f3edf (416 commits)

https://skia.googlesource.com/skia.git/+log/6c113cb8d7f9..ee68f3edfa96

Created with:
  roll-dep third_party/skia

Also ports the SK_API changes made to Chromium in crrev.com/1094677
(required after https://skia-review.googlesource.com/c/skia/+/631901)
and crrev.com/1095663.

Change-Id: I7a40d47d04e954636c94b27b9579a42f4be53a78
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/103630
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
diff --git a/DEPS b/DEPS
index 50cb2e0..c521da6 100644
--- a/DEPS
+++ b/DEPS
@@ -148,7 +148,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling skia
   # and whatever else without interference from each other.
-  'skia_revision': '6c113cb8d7f92c08eb933f18bea5cc2f85ac286e',
+  'skia_revision': 'ee68f3edfa96935274ad3e7703a09b808d79011e',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling test_fonts
   # and whatever else without interference from each other.
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index ea1439b..0eecb12 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -68,17 +68,17 @@
 
 # Internal-facing config for Skia library code.
 config("skia_library_config") {
-  defines = []
+  # Turn on SK_API to export Skia's public API
+  defines = [
+    "IS_SKIA_IMPL=1",
+    "SKIA_IMPLEMENTATION=1",
+  ]
 
   # Skia uses C++17 language features in its internal code. Previously Skia was built with
   # "-std=c++17". See http://crbug.com/1257145 for why this was a bad idea.
   cflags_cc = [ "-Wno-c++17-extensions" ]
   cflags_objcc = [ "-Wno-c++17-extensions" ]
 
-  if (is_component_build) {
-    defines += [ "SKIA_IMPLEMENTATION=1" ]
-  }
-
   if (current_cpu == "arm") {
     if (arm_use_neon) {
       defines += [ "SK_ARM_HAS_NEON" ]
diff --git a/skia/config/SkPdfiumUserConfig.h b/skia/config/SkPdfiumUserConfig.h
index 2c8a9a8..d92b042 100644
--- a/skia/config/SkPdfiumUserConfig.h
+++ b/skia/config/SkPdfiumUserConfig.h
@@ -123,6 +123,7 @@
  */
 // #define SK_HISTOGRAM_BOOLEAN(name, value)
 // #define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value)
+#include "third_party/base/component_export.h"
 
 // ===== Begin Chrome-specific definitions =====
 
@@ -131,6 +132,9 @@
 
 #define GR_MAX_OFFSCREEN_AA_DIM 512
 
+// Handle exporting using base/component_export.h
+#define SK_API COMPONENT_EXPORT(SKIA)
+
 // Log the file and line number for assertions.
 #if defined(SK_BUILD_FOR_WIN) && !defined(__clang__)
 // String formatting with this toolchain not supported.
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 9f4617c..1c6c3d2 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -529,6 +529,7 @@
     "base/bits.h",
     "base/check.h",
     "base/check_op.h",
+    "base/component_export.h",
     "base/containers/adapters.h",
     "base/containers/contains.h",
     "base/cxx17_backports.h",
diff --git a/third_party/base/component_export.h b/third_party/base/component_export.h
new file mode 100644
index 0000000..65c142f
--- /dev/null
+++ b/third_party/base/component_export.h
@@ -0,0 +1,76 @@
+// Copyright 2018 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BASE_COMPONENT_EXPORT_H_
+#define THIRD_PARTY_BASE_COMPONENT_EXPORT_H_
+
+// Used to annotate symbols which are exported by the component named
+// |component|. Note that this only does the right thing if the corresponding
+// component target's sources are compiled with |IS_$component_IMPL| defined
+// as 1. For example:
+//
+//   class COMPONENT_EXPORT(FOO) Bar {};
+//
+// If IS_FOO_IMPL=1 at compile time, then Bar will be annotated using the
+// COMPONENT_EXPORT_ANNOTATION macro defined below. Otherwise it will be
+// annotated using the COMPONENT_IMPORT_ANNOTATION macro.
+#define COMPONENT_EXPORT(component)                         \
+  COMPONENT_MACRO_CONDITIONAL_(IS_##component##_IMPL,       \
+                               COMPONENT_EXPORT_ANNOTATION, \
+                               COMPONENT_IMPORT_ANNOTATION)
+
+// Indicates whether the current compilation unit is being compiled as part of
+// the implementation of the component named |component|. Expands to |1| if
+// |IS_$component_IMPL| is defined as |1|; expands to |0| otherwise.
+//
+// Note in particular that if |IS_$component_IMPL| is not defined at all, it is
+// still fine to test INSIDE_COMPONENT_IMPL(component), which expands to |0| as
+// expected.
+#define INSIDE_COMPONENT_IMPL(component) \
+  COMPONENT_MACRO_CONDITIONAL_(IS_##component##_IMPL, 1, 0)
+
+// Compiler-specific macros to annotate for export or import of a symbol. No-op
+// in non-component builds. These should not see much if any direct use.
+// Instead use the COMPONENT_EXPORT macro defined above.
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+#define COMPONENT_EXPORT_ANNOTATION __declspec(dllexport)
+#define COMPONENT_IMPORT_ANNOTATION __declspec(dllimport)
+#else  // defined(WIN32)
+#define COMPONENT_EXPORT_ANNOTATION __attribute__((visibility("default")))
+#define COMPONENT_IMPORT_ANNOTATION
+#endif  // defined(WIN32)
+#else   // defined(COMPONENT_BUILD)
+#define COMPONENT_EXPORT_ANNOTATION
+#define COMPONENT_IMPORT_ANNOTATION
+#endif  // defined(COMPONENT_BUILD)
+
+// Below this point are several internal utility macros used for the
+// implementation of the above macros. Not intended for external use.
+
+// Helper for conditional expansion to one of two token strings. If |condition|
+// expands to |1| then this macro expands to |consequent|; otherwise it expands
+// to |alternate|.
+#define COMPONENT_MACRO_CONDITIONAL_(condition, consequent, alternate) \
+  COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_(                              \
+      COMPONENT_MACRO_CONDITIONAL_COMMA_(condition), consequent, alternate)
+
+// Expands to a comma (,) iff its first argument expands to |1|. Used in
+// conjunction with |COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_()|, as the presence
+// or absense of an extra comma can be used to conditionally shift subsequent
+// argument positions and thus influence which argument is selected.
+#define COMPONENT_MACRO_CONDITIONAL_COMMA_(...) \
+  COMPONENT_MACRO_CONDITIONAL_COMMA_IMPL_(__VA_ARGS__, )
+#define COMPONENT_MACRO_CONDITIONAL_COMMA_IMPL_(x, ...) \
+  COMPONENT_MACRO_CONDITIONAL_COMMA_##x##_
+#define COMPONENT_MACRO_CONDITIONAL_COMMA_1_ ,
+
+// Helper which simply selects its third argument. Used in conjunction with
+// |COMPONENT_MACRO_CONDITIONAL_COMMA_()| above to implement conditional macro
+// expansion.
+#define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_(...) \
+  COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(__VA_ARGS__)
+#define COMPONENT_MACRO_SELECT_THIRD_ARGUMENT_IMPL_(a, b, c, ...) c
+
+#endif  // THIRD_PARTY_BASE_COMPONENT_EXPORT_H_