形式
Diff
投稿日時
2020-08-08 10:16
公開期間
無期限
  1. diff --git a/gn/toolchain/BUILD.gn b/gn/toolchain/BUILD.gn
  2. index 4517710946..f49d3b9b39 100644
  3. --- a/gn/toolchain/BUILD.gn
  4. +++ b/gn/toolchain/BUILD.gn
  5. @@ -67,7 +67,7 @@ toolchain("msvc") {
  6. if (target_cpu == "x86") {
  7. # Toolchain asset includes a script that configures for x86 building.
  8. # We don't support x86 builds with local MSVC installations.
  9. - env_setup = "$shell $win_sdk/bin/SetEnv.cmd /x86 && "
  10. + # env_setup = "$shell $win_sdk/bin/SetEnv.cmd /x86 && "
  11. } else if (target_cpu == "arm64") {
  12. # ARM64 compiler is incomplete - it relies on DLLs located in the host toolchain directory.
  13. env_setup = "$shell set \"PATH=%PATH%;$win_vc\\Tools\\MSVC\\$win_toolchain_version\\bin\\HostX64\\x64\" && "
  14. @@ -201,7 +201,7 @@ toolchain("msvc") {
  15. tool("copy") {
  16. cp_py = rebase_path("../cp.py")
  17. - command = "python \"$cp_py\" {{source}} {{output}}"
  18. + command = "$shell python \"$cp_py\" {{source}} {{output}}"
  19. description = "copy {{source}} {{output}}"
  20. }
  21. }
  22. @@ -341,13 +341,13 @@ template("gcc_like_toolchain") {
  23. tool("copy") {
  24. cp_py = rebase_path("../cp.py")
  25. - command = "python \"$cp_py\" {{source}} {{output}}"
  26. + command = "$shell python \"$cp_py\" {{source}} {{output}}"
  27. description = "copy {{source}} {{output}}"
  28. }
  29. tool("copy_bundle_data") {
  30. cp_py = rebase_path("../cp.py")
  31. - command = "python \"$cp_py\" {{source}} {{output}}"
  32. + command = "$shell python \"$cp_py\" {{source}} {{output}}"
  33. description = "copy_bundle_data {{source}} {{output}}"
  34. }
  35. diff --git a/include/core/SkM44.h b/include/core/SkM44.h
  36. index 63b3ac140b..d32921d96e 100644
  37. --- a/include/core/SkM44.h
  38. +++ b/include/core/SkM44.h
  39. @@ -405,7 +405,7 @@ private:
  40. friend class SkMatrixPriv;
  41. };
  42. -SkM44 Sk3LookAt(const SkV3& eye, const SkV3& center, const SkV3& up);
  43. -SkM44 Sk3Perspective(float near, float far, float angle);
  44. +SK_API SkM44 Sk3LookAt(const SkV3& eye, const SkV3& center, const SkV3& up);
  45. +SK_API SkM44 Sk3Perspective(float near, float far, float angle);
  46. #endif
  47. diff --git a/include/core/SkString.h b/include/core/SkString.h
  48. index 6f1d972da2..5bee2dc218 100644
  49. --- a/include/core/SkString.h
  50. +++ b/include/core/SkString.h
  51. @@ -270,7 +270,7 @@ private:
  52. };
  53. /// Creates a new string and writes into it using a printf()-style format.
  54. -SkString SkStringPrintf(const char* format, ...) SK_PRINTF_LIKE(1, 2);
  55. +SK_API SkString SkStringPrintf(const char* format, ...) SK_PRINTF_LIKE(1, 2);
  56. /// This makes it easier to write a caller as a VAR_ARGS function where the format string is
  57. /// optional.
  58. static inline SkString SkStringPrintf() { return SkString(); }
  59. diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h
  60. index f9533d7261..41de226110 100644
  61. --- a/include/private/SkPathRef.h
  62. +++ b/include/private/SkPathRef.h
  63. @@ -21,6 +21,7 @@
  64. #include <atomic>
  65. #include <limits>
  66. +#include <tuple>
  67. class SkRBuffer;
  68. class SkWBuffer;
  69. diff --git a/include/private/SkThreadID.h b/include/private/SkThreadID.h
  70. index 06b9be7317..ac3d29f825 100644
  71. --- a/include/private/SkThreadID.h
  72. +++ b/include/private/SkThreadID.h
  73. @@ -12,7 +12,7 @@
  74. typedef int64_t SkThreadID;
  75. -SkThreadID SkGetThreadID();
  76. +SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID();
  77. const SkThreadID kIllegalThreadID = 0;
  78. diff --git a/include/utils/SkCustomTypeface.h b/include/utils/SkCustomTypeface.h
  79. index 61f32afed5..ffe3ad8d34 100644
  80. --- a/include/utils/SkCustomTypeface.h
  81. +++ b/include/utils/SkCustomTypeface.h
  82. @@ -19,7 +19,7 @@
  83. class SkStream;
  84. -class SkCustomTypefaceBuilder {
  85. +class SK_API SkCustomTypefaceBuilder {
  86. public:
  87. SkCustomTypefaceBuilder();
  88. diff --git a/modules/skottie/BUILD.gn b/modules/skottie/BUILD.gn
  89. index dbba5122da..99ac6ab532 100644
  90. --- a/modules/skottie/BUILD.gn
  91. +++ b/modules/skottie/BUILD.gn
  92. @@ -9,6 +9,9 @@ if (skia_enable_skottie) {
  93. config("public_config") {
  94. defines = [ "SK_ENABLE_SKOTTIE" ]
  95. include_dirs = [ "include" ]
  96. + if (is_component_build) {
  97. + defines += [ "SKOTTIE_DLL" ]
  98. + }
  99. }
  100. component("skottie") {
  101. @@ -24,6 +27,7 @@ if (skia_enable_skottie) {
  102. "../sksg",
  103. "../skshaper",
  104. ]
  105. + defines = [ "SKOTTIE_IMPLEMENTATION=1" ]
  106. }
  107. if (defined(is_skia_standalone)) {
  108. diff --git a/modules/skottie/include/ExternalLayer.h b/modules/skottie/include/ExternalLayer.h
  109. index 4513fd5f48..f717b27f87 100644
  110. --- a/modules/skottie/include/ExternalLayer.h
  111. +++ b/modules/skottie/include/ExternalLayer.h
  112. @@ -9,6 +9,7 @@
  113. #define SkottieExternalLayer_DEFINED
  114. #include "include/core/SkRefCnt.h"
  115. +#include "modules/skottie/include/SkottieConfig.h"
  116. class SkCanvas;
  117. struct SkSize;
  118. @@ -18,7 +19,7 @@ namespace skottie {
  119. /**
  120. * Interface for externally-rendered layers.
  121. */
  122. -class ExternalLayer : public SkRefCnt {
  123. +class SKOTTIE_API ExternalLayer : public SkRefCnt {
  124. public:
  125. /** Render layer content into the given canvas.
  126. *
  127. @@ -34,7 +35,7 @@ public:
  128. * Embedders can register interceptors with animation builders, to substitute target layers
  129. * with arbitrary/externally-controlled content (see ExternalLayer above).
  130. */
  131. -class PrecompInterceptor : public SkRefCnt {
  132. +class SKOTTIE_API PrecompInterceptor : public SkRefCnt {
  133. public:
  134. /**
  135. * Invoked at animation build time, for each precomp layer.
  136. diff --git a/modules/skottie/include/Skottie.h b/modules/skottie/include/Skottie.h
  137. index c519068b43..f56dc4c3d5 100644
  138. --- a/modules/skottie/include/Skottie.h
  139. +++ b/modules/skottie/include/Skottie.h
  140. @@ -13,6 +13,7 @@
  141. #include "include/core/SkSize.h"
  142. #include "include/core/SkString.h"
  143. #include "include/core/SkTypes.h"
  144. +#include "modules/skottie/include/SkottieConfig.h"
  145. #include "modules/skottie/include/ExternalLayer.h"
  146. #include "modules/skottie/include/SkottieProperty.h"
  147. #include "modules/skresources/include/SkResources.h"
  148. @@ -43,7 +44,7 @@ using ResourceProvider = skresources::ResourceProvider;
  149. /**
  150. * A Logger subclass can be used to receive Animation::Builder parsing errors and warnings.
  151. */
  152. -class SK_API Logger : public SkRefCnt {
  153. +class SKOTTIE_API Logger : public SkRefCnt {
  154. public:
  155. enum class Level {
  156. kWarning,
  157. @@ -56,13 +57,13 @@ public:
  158. /**
  159. * Interface for receiving AE composition markers at Animation build time.
  160. */
  161. -class SK_API MarkerObserver : public SkRefCnt {
  162. +class SKOTTIE_API MarkerObserver : public SkRefCnt {
  163. public:
  164. // t0,t1 are in the Animation::seek() domain.
  165. virtual void onMarker(const char name[], float t0, float t1) = 0;
  166. };
  167. -class SK_API Animation : public SkNVRefCnt<Animation> {
  168. +class SKOTTIE_API Animation : public SkNVRefCnt<Animation> {
  169. public:
  170. class Builder final {
  171. public:
  172. diff --git a/modules/skottie/include/SkottieConfig.h b/modules/skottie/include/SkottieConfig.h
  173. new file mode 100644
  174. index 0000000000..7743f1cd1f
  175. --- /dev/null
  176. +++ b/modules/skottie/include/SkottieConfig.h
  177. @@ -0,0 +1,25 @@
  178. +
  179. +#ifndef SkottieConfig_DEFINED
  180. +#define SkottieConfig_DEFINED
  181. +
  182. +#if !defined(SKOTTIE_IMPLEMENTATION)
  183. + #define SKOTTIE_IMPLEMENTATION 0
  184. +#endif
  185. +
  186. +#if !defined(SKOTTIE_API)
  187. + #if defined(SKOTTIE_DLL)
  188. + #if defined(_MSC_VER)
  189. + #if SKOTTIE_IMPLEMENTATION
  190. + #define SKOTTIE_API __declspec(dllexport)
  191. + #else
  192. + #define SKOTTIE_API __declspec(dllimport)
  193. + #endif
  194. + #else
  195. + #define SKOTTIE_API __attribute__((visibility("default")))
  196. + #endif
  197. + #else
  198. + #define SKOTTIE_API
  199. + #endif
  200. +#endif
  201. +
  202. +#endif
  203. diff --git a/modules/skottie/include/SkottieProperty.h b/modules/skottie/include/SkottieProperty.h
  204. index 2355984b86..62fa24da7c 100644
  205. --- a/modules/skottie/include/SkottieProperty.h
  206. +++ b/modules/skottie/include/SkottieProperty.h
  207. @@ -13,6 +13,8 @@
  208. #include "include/core/SkRefCnt.h"
  209. #include "include/core/SkTypeface.h"
  210. #include "include/utils/SkTextUtils.h"
  211. +
  212. +#include "modules/skottie/include/SkottieConfig.h"
  213. #include "modules/skottie/src/text/SkottieShaper.h"
  214. #include <functional>
  215. @@ -31,7 +33,7 @@ namespace skottie {
  216. using ColorPropertyValue = SkColor;
  217. using OpacityPropertyValue = float;
  218. -struct TextPropertyValue {
  219. +struct SKOTTIE_API TextPropertyValue {
  220. sk_sp<SkTypeface> fTypeface;
  221. SkString fText;
  222. float fTextSize = 0,
  223. @@ -51,7 +53,7 @@ struct TextPropertyValue {
  224. bool operator!=(const TextPropertyValue& other) const;
  225. };
  226. -struct TransformPropertyValue {
  227. +struct SKOTTIE_API TransformPropertyValue {
  228. SkPoint fAnchorPoint,
  229. fPosition;
  230. SkVector fScale;
  231. @@ -70,7 +72,7 @@ namespace internal { class AnimationBuilder; }
  232. * and the internal scene-graph representation.
  233. */
  234. template <typename ValueT, typename NodeT>
  235. -class SK_API PropertyHandle final {
  236. +class PropertyHandle final {
  237. public:
  238. explicit PropertyHandle(sk_sp<NodeT> node) : fNode(std::move(node)) {}
  239. ~PropertyHandle();
  240. @@ -106,7 +108,7 @@ using TransformPropertyHandle = PropertyHandle<TransformPropertyValue,
  241. * various properties of layer and shape nodes. The |node_name| argument corresponds to the
  242. * name ("nm") node property.
  243. */
  244. -class SK_API PropertyObserver : public SkRefCnt {
  245. +class SKOTTIE_API PropertyObserver : public SkRefCnt {
  246. public:
  247. template <typename T>
  248. using LazyHandle = std::function<std::unique_ptr<T>()>;
  249. diff --git a/modules/skottie/skottie.gni b/modules/skottie/skottie.gni
  250. index 3b64e1dac6..685998e4a7 100644
  251. --- a/modules/skottie/skottie.gni
  252. +++ b/modules/skottie/skottie.gni
  253. @@ -8,6 +8,7 @@ _src = get_path_info("src", "abspath")
  254. _include = get_path_info("include", "abspath")
  255. skia_skottie_public = [
  256. + "$_include/SkottieConfig.h",
  257. "$_include/Skottie.h",
  258. "$_include/ExternalLayer.h",
  259. "$_include/SkottieProperty.h",
  260. diff --git a/modules/skparagraph/BUILD.gn b/modules/skparagraph/BUILD.gn
  261. index 48e09296c8..6b3bdc17d9 100644
  262. --- a/modules/skparagraph/BUILD.gn
  263. +++ b/modules/skparagraph/BUILD.gn
  264. @@ -15,6 +15,9 @@ if (skia_enable_skparagraph) {
  265. "include",
  266. "utils",
  267. ]
  268. + if (is_component_build) {
  269. + defines = [ "SKPARAGRAPH_DLL" ]
  270. + }
  271. }
  272. component("skparagraph") {
  273. @@ -32,6 +35,7 @@ if (skia_enable_skparagraph) {
  274. "../skshaper",
  275. "//third_party/icu",
  276. ]
  277. + defines = [ "SKPARAGRAPH_IMPLEMENTATION=1" ]
  278. }
  279. config("utils_config") {
  280. diff --git a/modules/skparagraph/include/DartTypes.h b/modules/skparagraph/include/DartTypes.h
  281. index 415d5dfa72..efe3ee93e9 100644
  282. --- a/modules/skparagraph/include/DartTypes.h
  283. +++ b/modules/skparagraph/include/DartTypes.h
  284. @@ -5,6 +5,7 @@
  285. #include "include/core/SkRect.h"
  286. #include "include/core/SkTypes.h"
  287. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  288. #include <iterator>
  289. #include <limits>
  290. diff --git a/modules/skparagraph/include/FontCollection.h b/modules/skparagraph/include/FontCollection.h
  291. index f7336286a8..cc1a56569e 100644
  292. --- a/modules/skparagraph/include/FontCollection.h
  293. +++ b/modules/skparagraph/include/FontCollection.h
  294. @@ -7,6 +7,7 @@
  295. #include "include/core/SkFontMgr.h"
  296. #include "include/core/SkRefCnt.h"
  297. #include "include/private/SkTHash.h"
  298. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  299. #include "modules/skparagraph/include/ParagraphCache.h"
  300. #include "modules/skparagraph/include/TextStyle.h"
  301. @@ -15,7 +16,7 @@ namespace textlayout {
  302. class TextStyle;
  303. class Paragraph;
  304. -class FontCollection : public SkRefCnt {
  305. +class SKPARAGRAPH_API FontCollection : public SkRefCnt {
  306. public:
  307. FontCollection();
  308. diff --git a/modules/skparagraph/include/Metrics.h b/modules/skparagraph/include/Metrics.h
  309. index 49e944437f..e1c58a6e54 100644
  310. --- a/modules/skparagraph/include/Metrics.h
  311. +++ b/modules/skparagraph/include/Metrics.h
  312. @@ -3,6 +3,7 @@
  313. #define Metrics_DEFINED
  314. #include <map>
  315. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  316. #include "modules/skparagraph/include/TextStyle.h"
  317. namespace skia {
  318. diff --git a/modules/skparagraph/include/Paragraph.h b/modules/skparagraph/include/Paragraph.h
  319. index 4e99931830..124ba45cf2 100644
  320. --- a/modules/skparagraph/include/Paragraph.h
  321. +++ b/modules/skparagraph/include/Paragraph.h
  322. @@ -2,6 +2,7 @@
  323. #ifndef Paragraph_DEFINED
  324. #define Paragraph_DEFINED
  325. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  326. #include "modules/skparagraph/include/FontCollection.h"
  327. #include "modules/skparagraph/include/Metrics.h"
  328. #include "modules/skparagraph/include/ParagraphStyle.h"
  329. @@ -12,7 +13,7 @@ class SkCanvas;
  330. namespace skia {
  331. namespace textlayout {
  332. -class Paragraph {
  333. +class SKPARAGRAPH_API Paragraph {
  334. public:
  335. Paragraph(ParagraphStyle style, sk_sp<FontCollection> fonts);
  336. diff --git a/modules/skparagraph/include/ParagraphBuilder.h b/modules/skparagraph/include/ParagraphBuilder.h
  337. index 29c061da7c..f4f614b974 100644
  338. --- a/modules/skparagraph/include/ParagraphBuilder.h
  339. +++ b/modules/skparagraph/include/ParagraphBuilder.h
  340. @@ -6,6 +6,7 @@
  341. #include <stack>
  342. #include <string>
  343. #include <tuple>
  344. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  345. #include "modules/skparagraph/include/FontCollection.h"
  346. #include "modules/skparagraph/include/Paragraph.h"
  347. #include "modules/skparagraph/include/ParagraphStyle.h"
  348. diff --git a/modules/skparagraph/include/ParagraphCache.h b/modules/skparagraph/include/ParagraphCache.h
  349. index 1d477a1b13..6ad9ab2bc7 100644
  350. --- a/modules/skparagraph/include/ParagraphCache.h
  351. +++ b/modules/skparagraph/include/ParagraphCache.h
  352. @@ -3,6 +3,7 @@
  353. #define ParagraphCache_DEFINED
  354. #include "include/private/SkMutex.h"
  355. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  356. #include "src/core/SkLRUCache.h"
  357. #include <functional> // std::function
  358. @@ -27,7 +28,7 @@ class ParagraphCacheValue;
  359. bool operator==(const ParagraphCacheKey& a, const ParagraphCacheKey& b);
  360. -class ParagraphCache {
  361. +class SKPARAGRAPH_API ParagraphCache {
  362. public:
  363. ParagraphCache();
  364. ~ParagraphCache();
  365. diff --git a/modules/skparagraph/include/ParagraphStyle.h b/modules/skparagraph/include/ParagraphStyle.h
  366. index 682bae07d0..43ae5b77c0 100644
  367. --- a/modules/skparagraph/include/ParagraphStyle.h
  368. +++ b/modules/skparagraph/include/ParagraphStyle.h
  369. @@ -5,6 +5,7 @@
  370. #include "include/core/SkFontStyle.h"
  371. #include "include/core/SkScalar.h"
  372. #include "include/core/SkString.h"
  373. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  374. #include "modules/skparagraph/include/DartTypes.h"
  375. #include "modules/skparagraph/include/TextStyle.h"
  376. @@ -18,7 +19,7 @@
  377. namespace skia {
  378. namespace textlayout {
  379. -struct StrutStyle {
  380. +struct SKPARAGRAPH_API StrutStyle {
  381. StrutStyle();
  382. const std::vector<SkString>& getFontFamilies() const { return fFontFamilies; }
  383. @@ -68,7 +69,7 @@ private:
  384. bool fHeightOverride;
  385. };
  386. -struct ParagraphStyle {
  387. +struct SKPARAGRAPH_API ParagraphStyle {
  388. ParagraphStyle();
  389. bool operator==(const ParagraphStyle& rhs) const {
  390. diff --git a/modules/skparagraph/include/SkParagraphConfig.h b/modules/skparagraph/include/SkParagraphConfig.h
  391. new file mode 100644
  392. index 0000000000..a079bd9d6e
  393. --- /dev/null
  394. +++ b/modules/skparagraph/include/SkParagraphConfig.h
  395. @@ -0,0 +1,25 @@
  396. +
  397. +#ifndef SkParagraphConfig_DEFINED
  398. +#define SkParagraphConfig_DEFINED
  399. +
  400. +#if !defined(SKPARAGRAPH_IMPLEMENTATION)
  401. + #define SKPARAGRAPH_IMPLEMENTATION 0
  402. +#endif
  403. +
  404. +#if !defined(SKPARAGRAPH_API)
  405. + #if defined(SKPARAGRAPH_DLL)
  406. + #if defined(_MSC_VER)
  407. + #if SKPARAGRAPH_IMPLEMENTATION
  408. + #define SKPARAGRAPH_API __declspec(dllexport)
  409. + #else
  410. + #define SKPARAGRAPH_API __declspec(dllimport)
  411. + #endif
  412. + #else
  413. + #define SKPARAGRAPH_API __attribute__((visibility("default")))
  414. + #endif
  415. + #else
  416. + #define SKPARAGRAPH_API
  417. + #endif
  418. +#endif
  419. +
  420. +#endif
  421. diff --git a/modules/skparagraph/include/TextShadow.h b/modules/skparagraph/include/TextShadow.h
  422. index a580b9c370..77e0a23510 100644
  423. --- a/modules/skparagraph/include/TextShadow.h
  424. +++ b/modules/skparagraph/include/TextShadow.h
  425. @@ -4,11 +4,12 @@
  426. #include "include/core/SkColor.h"
  427. #include "include/core/SkPoint.h"
  428. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  429. namespace skia {
  430. namespace textlayout {
  431. -class TextShadow {
  432. +class SKPARAGRAPH_API TextShadow {
  433. public:
  434. SkColor fColor = SK_ColorBLACK;
  435. SkPoint fOffset;
  436. diff --git a/modules/skparagraph/include/TextStyle.h b/modules/skparagraph/include/TextStyle.h
  437. index b1feaa4d60..44df43363b 100644
  438. --- a/modules/skparagraph/include/TextStyle.h
  439. +++ b/modules/skparagraph/include/TextStyle.h
  440. @@ -9,6 +9,7 @@
  441. #include "include/core/SkFontStyle.h"
  442. #include "include/core/SkPaint.h"
  443. #include "include/core/SkScalar.h"
  444. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  445. #include "modules/skparagraph/include/DartTypes.h"
  446. #include "modules/skparagraph/include/TextShadow.h"
  447. @@ -151,7 +152,7 @@ struct PlaceholderStyle {
  448. SkScalar fBaselineOffset;
  449. };
  450. -class TextStyle {
  451. +class SKPARAGRAPH_API TextStyle {
  452. public:
  453. TextStyle();
  454. TextStyle(const TextStyle& other, bool placeholder);
  455. diff --git a/modules/skparagraph/include/TypefaceFontProvider.h b/modules/skparagraph/include/TypefaceFontProvider.h
  456. index 727659d85d..15e9c9407a 100644
  457. --- a/modules/skparagraph/include/TypefaceFontProvider.h
  458. +++ b/modules/skparagraph/include/TypefaceFontProvider.h
  459. @@ -10,11 +10,13 @@
  460. #include "include/core/SkFontMgr.h"
  461. #include "include/core/SkStream.h"
  462. #include "include/core/SkString.h"
  463. +#include "modules/skparagraph/include/SkParagraphConfig.h"
  464. +#include "modules/skparagraph/include/Paragraph.h"
  465. namespace skia {
  466. namespace textlayout {
  467. -class TypefaceFontStyleSet : public SkFontStyleSet {
  468. +class SKPARAGRAPH_API TypefaceFontStyleSet : public SkFontStyleSet {
  469. public:
  470. explicit TypefaceFontStyleSet(const SkString& familyName);
  471. @@ -33,7 +35,7 @@ private:
  472. SkString fAlias;
  473. };
  474. -class TypefaceFontProvider : public SkFontMgr {
  475. +class SKPARAGRAPH_API TypefaceFontProvider : public SkFontMgr {
  476. public:
  477. size_t registerTypeface(sk_sp<SkTypeface> typeface);
  478. size_t registerTypeface(sk_sp<SkTypeface> typeface, const SkString& alias);
  479. diff --git a/modules/skparagraph/skparagraph.gni b/modules/skparagraph/skparagraph.gni
  480. index 0221d78680..ed4594fc55 100644
  481. --- a/modules/skparagraph/skparagraph.gni
  482. +++ b/modules/skparagraph/skparagraph.gni
  483. @@ -6,6 +6,7 @@ _include = get_path_info("include", "abspath")
  484. _utils = get_path_info("utils", "abspath")
  485. skparagraph_public = [
  486. + "$_include/SkParagraphConfig.h",
  487. "$_include/ParagraphStyle.h",
  488. "$_include/TextStyle.h",
  489. "$_include/TextShadow.h",
  490. diff --git a/modules/skresources/include/SkResources.h b/modules/skresources/include/SkResources.h
  491. index c5bdb81dfa..af6b2baa36 100644
  492. --- a/modules/skresources/include/SkResources.h
  493. +++ b/modules/skresources/include/SkResources.h
  494. @@ -26,7 +26,7 @@ namespace skresources {
  495. /**
  496. * Image asset proxy interface.
  497. */
  498. -class SK_API ImageAsset : public SkRefCnt {
  499. +class ImageAsset : public SkRefCnt {
  500. public:
  501. /**
  502. * Returns true if the image asset is animated.
  503. @@ -75,7 +75,7 @@ private:
  504. * ResourceProvider is an interface that lets rich-content modules defer loading of external
  505. * resources (images, fonts, etc.) to embedding clients.
  506. */
  507. -class SK_API ResourceProvider : public SkRefCnt {
  508. +class ResourceProvider : public SkRefCnt {
  509. public:
  510. /**
  511. * Load a generic resource (currently only nested animations) specified by |path| + |name|,
  512. diff --git a/modules/sksg/BUILD.gn b/modules/sksg/BUILD.gn
  513. index 3bf998b173..0ca969729a 100644
  514. --- a/modules/sksg/BUILD.gn
  515. +++ b/modules/sksg/BUILD.gn
  516. @@ -7,6 +7,9 @@ import("../../gn/skia.gni")
  517. config("public_config") {
  518. include_dirs = [ "include" ]
  519. + if (is_component_build) {
  520. + defines = [ "SKSG_DLL" ]
  521. + }
  522. }
  523. component("sksg") {
  524. @@ -16,6 +19,7 @@ component("sksg") {
  525. sources = skia_sksg_sources
  526. configs += [ "../../:skia_private" ]
  527. deps = [ "../..:skia" ]
  528. + defines = [ "SKSG_IMPLEMENTATION=1" ]
  529. }
  530. if (defined(is_skia_standalone) && skia_enable_tools) {
  531. diff --git a/modules/sksg/include/SkSGClipEffect.h b/modules/sksg/include/SkSGClipEffect.h
  532. index 6614c6a404..203165b64d 100644
  533. --- a/modules/sksg/include/SkSGClipEffect.h
  534. +++ b/modules/sksg/include/SkSGClipEffect.h
  535. @@ -18,7 +18,7 @@ class GeometryNode;
  536. * Concrete Effect node, applying a clip to its descendants.
  537. *
  538. */
  539. -class ClipEffect final : public EffectNode {
  540. +class SKSG_API ClipEffect final : public EffectNode {
  541. public:
  542. static sk_sp<ClipEffect> Make(sk_sp<RenderNode> child, sk_sp<GeometryNode> clip,
  543. bool aa = false) {
  544. diff --git a/modules/sksg/include/SkSGColorFilter.h b/modules/sksg/include/SkSGColorFilter.h
  545. index a10882127a..4fa3af0296 100644
  546. --- a/modules/sksg/include/SkSGColorFilter.h
  547. +++ b/modules/sksg/include/SkSGColorFilter.h
  548. @@ -23,7 +23,7 @@ class Color;
  549. /**
  550. * Base class for nodes which apply a color filter when rendering their descendants.
  551. */
  552. -class ColorFilter : public EffectNode {
  553. +class SKSG_API ColorFilter : public EffectNode {
  554. protected:
  555. explicit ColorFilter(sk_sp<RenderNode>);
  556. @@ -45,7 +45,7 @@ private:
  557. *
  558. * Allows attaching non-sksg color filters to the render tree.
  559. */
  560. -class ExternalColorFilter final : public EffectNode {
  561. +class SKSG_API ExternalColorFilter final : public EffectNode {
  562. public:
  563. static sk_sp<ExternalColorFilter> Make(sk_sp<RenderNode> child);
  564. @@ -67,7 +67,7 @@ private:
  565. /**
  566. * Concrete SkModeColorFilter Effect node.
  567. */
  568. -class ModeColorFilter final : public ColorFilter {
  569. +class SKSG_API ModeColorFilter final : public ColorFilter {
  570. public:
  571. ~ModeColorFilter() override;
  572. @@ -92,7 +92,7 @@ private:
  573. * based on input luminance (where the colors are evenly distributed across the luminance domain),
  574. * then mixes with the input based on weight. Leaves alpha unchanged.
  575. */
  576. -class GradientColorFilter final : public ColorFilter {
  577. +class SKSG_API GradientColorFilter final : public ColorFilter {
  578. public:
  579. ~GradientColorFilter() override;
  580. diff --git a/modules/sksg/include/SkSGDashEffect.h b/modules/sksg/include/SkSGDashEffect.h
  581. index 341e71e5fb..b781a271ce 100644
  582. --- a/modules/sksg/include/SkSGDashEffect.h
  583. +++ b/modules/sksg/include/SkSGDashEffect.h
  584. @@ -22,7 +22,7 @@ namespace sksg {
  585. * intervals is odd, they are repeated once more to attain an even sequence (same as SVG
  586. * stroke-dasharray: https://www.w3.org/TR/SVG11/painting.html#StrokeDasharrayProperty).
  587. */
  588. -class DashEffect final : public GeometryNode {
  589. +class SKSG_API DashEffect final : public GeometryNode {
  590. public:
  591. static sk_sp<DashEffect> Make(sk_sp<GeometryNode> child) {
  592. return child ? sk_sp<DashEffect>(new DashEffect(std::move(child))) : nullptr;
  593. diff --git a/modules/sksg/include/SkSGDraw.h b/modules/sksg/include/SkSGDraw.h
  594. index 0889ebfde7..4e6bed337f 100644
  595. --- a/modules/sksg/include/SkSGDraw.h
  596. +++ b/modules/sksg/include/SkSGDraw.h
  597. @@ -21,7 +21,7 @@ namespace sksg {
  598. *
  599. * Think Skia SkCanvas::drawFoo(foo, paint) calls.
  600. */
  601. -class Draw : public RenderNode {
  602. +class SKSG_API Draw : public RenderNode {
  603. public:
  604. static sk_sp<Draw> Make(sk_sp<GeometryNode> geo, sk_sp<PaintNode> paint) {
  605. return (geo && paint) ? sk_sp<Draw>(new Draw(std::move(geo), std::move(paint))) : nullptr;
  606. diff --git a/modules/sksg/include/SkSGEffectNode.h b/modules/sksg/include/SkSGEffectNode.h
  607. index 005a99c9ea..c6af119a1b 100644
  608. --- a/modules/sksg/include/SkSGEffectNode.h
  609. +++ b/modules/sksg/include/SkSGEffectNode.h
  610. @@ -18,7 +18,7 @@ namespace sksg {
  611. *
  612. * This includes transforms, clipping, filters, etc.
  613. */
  614. -class EffectNode : public RenderNode {
  615. +class SKSG_API EffectNode : public RenderNode {
  616. protected:
  617. explicit EffectNode(sk_sp<RenderNode>, uint32_t inval_traits = 0);
  618. ~EffectNode() override;
  619. diff --git a/modules/sksg/include/SkSGGeometryNode.h b/modules/sksg/include/SkSGGeometryNode.h
  620. index d9d4e8ddec..88da3b657d 100644
  621. --- a/modules/sksg/include/SkSGGeometryNode.h
  622. +++ b/modules/sksg/include/SkSGGeometryNode.h
  623. @@ -22,7 +22,7 @@ namespace sksg {
  624. *
  625. * Think SkRect, SkPath, etc.
  626. */
  627. -class GeometryNode : public Node {
  628. +class SKSG_API GeometryNode : public Node {
  629. public:
  630. void clip(SkCanvas*, bool antiAlias) const;
  631. void draw(SkCanvas*, const SkPaint&) const;
  632. diff --git a/modules/sksg/include/SkSGGeometryTransform.h b/modules/sksg/include/SkSGGeometryTransform.h
  633. index 400ab8a069..b7d8ddfe6e 100644
  634. --- a/modules/sksg/include/SkSGGeometryTransform.h
  635. +++ b/modules/sksg/include/SkSGGeometryTransform.h
  636. @@ -21,7 +21,7 @@ class Transform;
  637. /**
  638. * Concrete Effect node, binding a Matrix to a GeometryNode.
  639. */
  640. -class GeometryTransform final : public GeometryNode {
  641. +class SKSG_API GeometryTransform final : public GeometryNode {
  642. public:
  643. static sk_sp<GeometryTransform> Make(sk_sp<GeometryNode> child, sk_sp<Transform> transform) {
  644. return child && transform
  645. diff --git a/modules/sksg/include/SkSGGradient.h b/modules/sksg/include/SkSGGradient.h
  646. index f76c7b836d..e0130007b4 100644
  647. --- a/modules/sksg/include/SkSGGradient.h
  648. +++ b/modules/sksg/include/SkSGGradient.h
  649. @@ -22,7 +22,7 @@ namespace sksg {
  650. /**
  651. * Gradient base class.
  652. */
  653. -class Gradient : public Shader {
  654. +class SKSG_API Gradient : public Shader {
  655. public:
  656. struct ColorStop {
  657. SkScalar fPosition;
  658. @@ -52,7 +52,7 @@ private:
  659. using INHERITED = Shader;
  660. };
  661. -class LinearGradient final : public Gradient {
  662. +class SKSG_API LinearGradient final : public Gradient {
  663. public:
  664. static sk_sp<LinearGradient> Make() {
  665. return sk_sp<LinearGradient>(new LinearGradient());
  666. @@ -74,7 +74,7 @@ private:
  667. using INHERITED = Gradient;
  668. };
  669. -class RadialGradient final : public Gradient {
  670. +class SKSG_API RadialGradient final : public Gradient {
  671. public:
  672. static sk_sp<RadialGradient> Make() {
  673. return sk_sp<RadialGradient>(new RadialGradient());
  674. diff --git a/modules/sksg/include/SkSGGroup.h b/modules/sksg/include/SkSGGroup.h
  675. index 085f7a66ab..1a612bb69d 100644
  676. --- a/modules/sksg/include/SkSGGroup.h
  677. +++ b/modules/sksg/include/SkSGGroup.h
  678. @@ -17,7 +17,7 @@ namespace sksg {
  679. /**
  680. * Concrete node, grouping together multiple descendants.
  681. */
  682. -class Group : public RenderNode {
  683. +class SKSG_API Group : public RenderNode {
  684. public:
  685. static sk_sp<Group> Make() {
  686. return sk_sp<Group>(new Group(std::vector<sk_sp<RenderNode>>()));
  687. diff --git a/modules/sksg/include/SkSGImage.h b/modules/sksg/include/SkSGImage.h
  688. index 178662a0c5..8e841bb49a 100644
  689. --- a/modules/sksg/include/SkSGImage.h
  690. +++ b/modules/sksg/include/SkSGImage.h
  691. @@ -20,7 +20,7 @@ namespace sksg {
  692. * Concrete rendering node, wrapping an SkImage.
  693. *
  694. */
  695. -class Image final : public RenderNode {
  696. +class SKSG_API Image final : public RenderNode {
  697. public:
  698. static sk_sp<Image> Make(sk_sp<SkImage> image) {
  699. return sk_sp<Image>(new Image(std::move(image)));
  700. diff --git a/modules/sksg/include/SkSGInvalidationController.h b/modules/sksg/include/SkSGInvalidationController.h
  701. index df496ba68a..1269fcf42d 100644
  702. --- a/modules/sksg/include/SkSGInvalidationController.h
  703. +++ b/modules/sksg/include/SkSGInvalidationController.h
  704. @@ -10,6 +10,7 @@
  705. #include "include/core/SkMatrix.h"
  706. #include "include/core/SkTypes.h"
  707. +#include "modules/sksg/include/SkSGNode.h"
  708. #include <vector>
  709. @@ -22,7 +23,7 @@ namespace sksg {
  710. *
  711. * Tracks dirty regions for repaint.
  712. */
  713. -class InvalidationController {
  714. +class SKSG_API InvalidationController {
  715. public:
  716. InvalidationController();
  717. InvalidationController(const InvalidationController&) = delete;
  718. diff --git a/modules/sksg/include/SkSGMaskEffect.h b/modules/sksg/include/SkSGMaskEffect.h
  719. index 4497297f21..0ddabe8370 100644
  720. --- a/modules/sksg/include/SkSGMaskEffect.h
  721. +++ b/modules/sksg/include/SkSGMaskEffect.h
  722. @@ -16,7 +16,7 @@ namespace sksg {
  723. * Concrete Effect node, applying a mask to its descendants.
  724. *
  725. */
  726. -class MaskEffect final : public EffectNode {
  727. +class SKSG_API MaskEffect final : public EffectNode {
  728. public:
  729. enum class Mode : uint32_t {
  730. kAlphaNormal,
  731. diff --git a/modules/sksg/include/SkSGMerge.h b/modules/sksg/include/SkSGMerge.h
  732. index 95993605df..2e5a2c62a7 100644
  733. --- a/modules/sksg/include/SkSGMerge.h
  734. +++ b/modules/sksg/include/SkSGMerge.h
  735. @@ -22,7 +22,7 @@ namespace sksg {
  736. /**
  737. * Concrete Geometry node, combining other geometries based on Mode.
  738. */
  739. -class Merge final : public GeometryNode {
  740. +class SKSG_API Merge final : public GeometryNode {
  741. public:
  742. enum class Mode {
  743. // Append path mode.
  744. diff --git a/modules/sksg/include/SkSGNode.h b/modules/sksg/include/SkSGNode.h
  745. index 271aa39daf..15c202463b 100644
  746. --- a/modules/sksg/include/SkSGNode.h
  747. +++ b/modules/sksg/include/SkSGNode.h
  748. @@ -13,6 +13,26 @@
  749. #include <vector>
  750. +#if !defined(SKSG_IMPLEMENTATION)
  751. + #define SKSG_IMPLEMENTATION 0
  752. +#endif
  753. +
  754. +#if !defined(SKSG_API)
  755. + #if defined(SKSG_DLL)
  756. + #if defined(_MSC_VER)
  757. + #if SKSG_IMPLEMENTATION
  758. + #define SKSG_API __declspec(dllexport)
  759. + #else
  760. + #define SKSG_API __declspec(dllimport)
  761. + #endif
  762. + #else
  763. + #define SKSG_API __attribute__((visibility("default")))
  764. + #endif
  765. + #else
  766. + #define SKSG_API
  767. + #endif
  768. +#endif
  769. +
  770. class SkCanvas;
  771. class SkMatrix;
  772. @@ -29,7 +49,7 @@ class InvalidationController;
  773. * Note: egress edges are only implemented/supported in container subclasses
  774. * (e.g. Group, Effect, Draw).
  775. */
  776. -class Node : public SkRefCnt {
  777. +class SKSG_API Node : public SkRefCnt {
  778. public:
  779. // Traverse the DAG and revalidate any dependant/invalidated nodes.
  780. // Returns the bounding box for the DAG fragment.
  781. diff --git a/modules/sksg/include/SkSGOpacityEffect.h b/modules/sksg/include/SkSGOpacityEffect.h
  782. index 126ed3fa0b..09144c7d46 100644
  783. --- a/modules/sksg/include/SkSGOpacityEffect.h
  784. +++ b/modules/sksg/include/SkSGOpacityEffect.h
  785. @@ -16,7 +16,7 @@ namespace sksg {
  786. * Concrete Effect node, applying opacity to its descendants.
  787. *
  788. */
  789. -class OpacityEffect final : public EffectNode {
  790. +class SKSG_API OpacityEffect final : public EffectNode {
  791. public:
  792. static sk_sp<OpacityEffect> Make(sk_sp<RenderNode> child, float opacity = 1) {
  793. return child ? sk_sp<OpacityEffect>(new OpacityEffect(std::move(child), opacity)) : nullptr;
  794. diff --git a/modules/sksg/include/SkSGPaint.h b/modules/sksg/include/SkSGPaint.h
  795. index 59c0de56ba..eb66fba6c9 100644
  796. --- a/modules/sksg/include/SkSGPaint.h
  797. +++ b/modules/sksg/include/SkSGPaint.h
  798. @@ -23,7 +23,7 @@ class Shader;
  799. *
  800. * Roughly equivalent to Skia's SkPaint.
  801. */
  802. -class PaintNode : public Node {
  803. +class SKSG_API PaintNode : public Node {
  804. public:
  805. SkPaint makePaint() const;
  806. @@ -57,7 +57,7 @@ private:
  807. /**
  808. * Concrete Paint node, wrapping an SkColor.
  809. */
  810. -class Color : public PaintNode {
  811. +class SKSG_API Color : public PaintNode {
  812. public:
  813. static sk_sp<Color> Make(SkColor c);
  814. @@ -77,7 +77,7 @@ private:
  815. /**
  816. * Shader-based paint.
  817. */
  818. -class ShaderPaint final : public PaintNode {
  819. +class SKSG_API ShaderPaint final : public PaintNode {
  820. public:
  821. ~ShaderPaint() override;
  822. diff --git a/modules/sksg/include/SkSGPath.h b/modules/sksg/include/SkSGPath.h
  823. index 167fea1b0d..be59140015 100644
  824. --- a/modules/sksg/include/SkSGPath.h
  825. +++ b/modules/sksg/include/SkSGPath.h
  826. @@ -20,7 +20,7 @@ namespace sksg {
  827. /**
  828. * Concrete Geometry node, wrapping an SkPath.
  829. */
  830. -class Path : public GeometryNode {
  831. +class SKSG_API Path : public GeometryNode {
  832. public:
  833. static sk_sp<Path> Make() { return sk_sp<Path>(new Path(SkPath())); }
  834. static sk_sp<Path> Make(const SkPath& r) { return sk_sp<Path>(new Path(r)); }
  835. diff --git a/modules/sksg/include/SkSGPlane.h b/modules/sksg/include/SkSGPlane.h
  836. index 994ed6b3e6..5dd016720a 100644
  837. --- a/modules/sksg/include/SkSGPlane.h
  838. +++ b/modules/sksg/include/SkSGPlane.h
  839. @@ -18,7 +18,7 @@ namespace sksg {
  840. /**
  841. * Concrete Geometry node, representing the whole canvas.
  842. */
  843. -class Plane final : public GeometryNode {
  844. +class SKSG_API Plane final : public GeometryNode {
  845. public:
  846. static sk_sp<Plane> Make() { return sk_sp<Plane>(new Plane()); }
  847. diff --git a/modules/sksg/include/SkSGRect.h b/modules/sksg/include/SkSGRect.h
  848. index fa39a8fe02..a2a6a091d8 100644
  849. --- a/modules/sksg/include/SkSGRect.h
  850. +++ b/modules/sksg/include/SkSGRect.h
  851. @@ -22,7 +22,7 @@ namespace sksg {
  852. /**
  853. * Concrete Geometry node, wrapping an SkRect.
  854. */
  855. -class Rect final : public GeometryNode {
  856. +class SKSG_API Rect final : public GeometryNode {
  857. public:
  858. static sk_sp<Rect> Make() { return sk_sp<Rect>(new Rect(SkRect::MakeEmpty())); }
  859. static sk_sp<Rect> Make(const SkRect& r) { return sk_sp<Rect>(new Rect(r)); }
  860. @@ -68,7 +68,7 @@ private:
  861. /**
  862. * Concrete Geometry node, wrapping an SkRRect.
  863. */
  864. -class RRect final : public GeometryNode {
  865. +class SKSG_API RRect final : public GeometryNode {
  866. public:
  867. static sk_sp<RRect> Make() { return sk_sp<RRect>(new RRect(SkRRect())); }
  868. static sk_sp<RRect> Make(const SkRRect& rr) { return sk_sp<RRect>(new RRect(rr)); }
  869. diff --git a/modules/sksg/include/SkSGRenderEffect.h b/modules/sksg/include/SkSGRenderEffect.h
  870. index 1c0f93b006..f6ed0f0ef2 100644
  871. --- a/modules/sksg/include/SkSGRenderEffect.h
  872. +++ b/modules/sksg/include/SkSGRenderEffect.h
  873. @@ -28,7 +28,7 @@ namespace sksg {
  874. /**
  875. * Shader base class.
  876. */
  877. -class Shader : public Node {
  878. +class SKSG_API Shader : public Node {
  879. public:
  880. ~Shader() override;
  881. @@ -53,7 +53,7 @@ private:
  882. /**
  883. * Attaches a shader to the render DAG.
  884. */
  885. -class ShaderEffect final : public EffectNode {
  886. +class SKSG_API ShaderEffect final : public EffectNode {
  887. public:
  888. ~ShaderEffect() override;
  889. @@ -77,7 +77,7 @@ private:
  890. /**
  891. * Attaches a mask shader to the render DAG.
  892. */
  893. -class MaskShaderEffect final : public EffectNode {
  894. +class SKSG_API MaskShaderEffect final : public EffectNode {
  895. public:
  896. static sk_sp<MaskShaderEffect> Make(sk_sp<RenderNode>, sk_sp<SkShader> = nullptr);
  897. @@ -97,7 +97,7 @@ private:
  898. /**
  899. * ImageFilter base class.
  900. */
  901. -class ImageFilter : public Node {
  902. +class SKSG_API ImageFilter : public Node {
  903. public:
  904. ~ImageFilter() override;
  905. @@ -129,7 +129,7 @@ private:
  906. /**
  907. * Attaches an ImageFilter (chain) to the render DAG.
  908. */
  909. -class ImageFilterEffect final : public EffectNode {
  910. +class SKSG_API ImageFilterEffect final : public EffectNode {
  911. public:
  912. ~ImageFilterEffect() override;
  913. @@ -152,7 +152,7 @@ private:
  914. /**
  915. * Wrapper for externally-managed SkImageFilters.
  916. */
  917. -class ExternalImageFilter final : public ImageFilter {
  918. +class SKSG_API ExternalImageFilter final : public ImageFilter {
  919. public:
  920. ~ExternalImageFilter() override;
  921. @@ -173,7 +173,7 @@ private:
  922. /**
  923. * SkDropShadowImageFilter node.
  924. */
  925. -class DropShadowImageFilter final : public ImageFilter {
  926. +class SKSG_API DropShadowImageFilter final : public ImageFilter {
  927. public:
  928. ~DropShadowImageFilter() override;
  929. @@ -203,7 +203,7 @@ private:
  930. /**
  931. * SkBlurImageFilter node.
  932. */
  933. -class BlurImageFilter final : public ImageFilter {
  934. +class SKSG_API BlurImageFilter final : public ImageFilter {
  935. public:
  936. ~BlurImageFilter() override;
  937. @@ -227,7 +227,7 @@ private:
  938. /**
  939. * Applies a SkBlendMode to descendant render nodes.
  940. */
  941. -class BlendModeEffect final : public EffectNode {
  942. +class SKSG_API BlendModeEffect final : public EffectNode {
  943. public:
  944. ~BlendModeEffect() override;
  945. diff --git a/modules/sksg/include/SkSGRenderNode.h b/modules/sksg/include/SkSGRenderNode.h
  946. index db01d49096..8de17d1031 100644
  947. --- a/modules/sksg/include/SkSGRenderNode.h
  948. +++ b/modules/sksg/include/SkSGRenderNode.h
  949. @@ -23,7 +23,7 @@ namespace sksg {
  950. /**
  951. * Base class for nodes which can render to a canvas.
  952. */
  953. -class RenderNode : public Node {
  954. +class SKSG_API RenderNode : public Node {
  955. protected:
  956. struct RenderContext;
  957. @@ -49,7 +49,7 @@ protected:
  958. // Paint property overrides.
  959. // These are deferred until we can determine whether they can be applied to the individual
  960. // draw paints, or whether they require content isolation (applied to a layer).
  961. - struct RenderContext {
  962. + struct SKSG_API RenderContext {
  963. sk_sp<SkColorFilter> fColorFilter;
  964. sk_sp<SkShader> fShader;
  965. sk_sp<SkShader> fMaskShader;
  966. @@ -64,7 +64,7 @@ protected:
  967. void modulatePaint(const SkMatrix& ctm, SkPaint*, bool is_layer_paint = false) const;
  968. };
  969. - class ScopedRenderContext final {
  970. + class SKSG_API ScopedRenderContext final {
  971. public:
  972. ScopedRenderContext(SkCanvas*, const RenderContext*);
  973. ~ScopedRenderContext();
  974. @@ -129,7 +129,7 @@ private:
  975. * should derive from this class instead of RenderNode. It handles
  976. * various book-keeping, and provides a controlled extension point.
  977. */
  978. -class CustomRenderNode : public RenderNode {
  979. +class SKSG_API CustomRenderNode : public RenderNode {
  980. protected:
  981. explicit CustomRenderNode(std::vector<sk_sp<RenderNode>>&& children);
  982. ~CustomRenderNode() override;
  983. diff --git a/modules/sksg/include/SkSGRoundEffect.h b/modules/sksg/include/SkSGRoundEffect.h
  984. index 20a02d0468..cd57f8a8f5 100644
  985. --- a/modules/sksg/include/SkSGRoundEffect.h
  986. +++ b/modules/sksg/include/SkSGRoundEffect.h
  987. @@ -17,7 +17,7 @@ namespace sksg {
  988. /**
  989. * Concrete Geometry node, applying a rounded-corner effect to its child.
  990. */
  991. -class RoundEffect final : public GeometryNode {
  992. +class SKSG_API RoundEffect final : public GeometryNode {
  993. public:
  994. static sk_sp<RoundEffect> Make(sk_sp<GeometryNode> child) {
  995. return child ? sk_sp<RoundEffect>(new RoundEffect(std::move(child))) : nullptr;
  996. diff --git a/modules/sksg/include/SkSGScene.h b/modules/sksg/include/SkSGScene.h
  997. index 8ad19a2193..f619a29660 100644
  998. --- a/modules/sksg/include/SkSGScene.h
  999. +++ b/modules/sksg/include/SkSGScene.h
  1000. @@ -8,6 +8,8 @@
  1001. #ifndef SkSGScene_DEFINED
  1002. #define SkSGScene_DEFINED
  1003. +#include "modules/sksg/include/SkSGNode.h"
  1004. +
  1005. #include "include/core/SkRefCnt.h"
  1006. #include "include/core/SkTypes.h"
  1007. @@ -26,7 +28,7 @@ class RenderNode;
  1008. * Holds a scene root. Provides high-level methods for rendering.
  1009. *
  1010. */
  1011. -class Scene final {
  1012. +class SKSG_API Scene final {
  1013. public:
  1014. static std::unique_ptr<Scene> Make(sk_sp<RenderNode> root);
  1015. ~Scene();
  1016. diff --git a/modules/sksg/include/SkSGText.h b/modules/sksg/include/SkSGText.h
  1017. index 10ac04c70a..4515e46c23 100644
  1018. --- a/modules/sksg/include/SkSGText.h
  1019. +++ b/modules/sksg/include/SkSGText.h
  1020. @@ -25,7 +25,7 @@ namespace sksg {
  1021. /**
  1022. * Concrete Geometry node, wrapping a (shaped) SkTextBlob.
  1023. */
  1024. -class Text final : public GeometryNode {
  1025. +class SKSG_API Text final : public GeometryNode {
  1026. public:
  1027. static sk_sp<Text> Make(sk_sp<SkTypeface> tf, const SkString& text);
  1028. ~Text() override;
  1029. @@ -73,7 +73,7 @@ private:
  1030. /**
  1031. * Concrete Geometry node, wrapping an external SkTextBlob.
  1032. */
  1033. -class TextBlob final : public GeometryNode {
  1034. +class SKSG_API TextBlob final : public GeometryNode {
  1035. public:
  1036. static sk_sp<TextBlob> Make(sk_sp<SkTextBlob> = nullptr);
  1037. ~TextBlob() override;
  1038. diff --git a/modules/sksg/include/SkSGTransform.h b/modules/sksg/include/SkSGTransform.h
  1039. index 3c1c013086..37ddd5b7a1 100644
  1040. --- a/modules/sksg/include/SkSGTransform.h
  1041. +++ b/modules/sksg/include/SkSGTransform.h
  1042. @@ -8,6 +8,7 @@
  1043. #ifndef SkSGTransform_DEFINED
  1044. #define SkSGTransform_DEFINED
  1045. +#include "include/core/SkM44.h"
  1046. #include "modules/sksg/include/SkSGEffectNode.h"
  1047. class SkM44;
  1048. @@ -18,7 +19,7 @@ namespace sksg {
  1049. /**
  1050. * Transformations base class.
  1051. */
  1052. -class Transform : public Node {
  1053. +class SKSG_API Transform : public Node {
  1054. public:
  1055. // Compose T' = A x B
  1056. static sk_sp<Transform> MakeConcat(sk_sp<Transform> a, sk_sp<Transform> b);
  1057. @@ -79,10 +80,22 @@ private:
  1058. using INHERITED = Transform;
  1059. };
  1060. +template <>
  1061. +inline SkMatrix Matrix<SkMatrix>::asMatrix() const { return fMatrix; }
  1062. +
  1063. +template <>
  1064. +inline SkM44 Matrix<SkMatrix>::asM44() const { return SkM44(fMatrix); }
  1065. +
  1066. +template <>
  1067. +inline SkMatrix Matrix<SkM44>::asMatrix() const { return fMatrix.asM33(); }
  1068. +
  1069. +template <>
  1070. +inline SkM44 Matrix<SkM44>::asM44() const { return fMatrix; }
  1071. +
  1072. /**
  1073. * Concrete Effect node, binding a Transform to a RenderNode.
  1074. */
  1075. -class TransformEffect final : public EffectNode {
  1076. +class SKSG_API TransformEffect final : public EffectNode {
  1077. public:
  1078. static sk_sp<TransformEffect> Make(sk_sp<RenderNode> child, sk_sp<Transform> transform) {
  1079. return child && transform
  1080. diff --git a/modules/sksg/include/SkSGTrimEffect.h b/modules/sksg/include/SkSGTrimEffect.h
  1081. index 804f028d80..79991a8a0e 100644
  1082. --- a/modules/sksg/include/SkSGTrimEffect.h
  1083. +++ b/modules/sksg/include/SkSGTrimEffect.h
  1084. @@ -21,7 +21,7 @@ namespace sksg {
  1085. /**
  1086. * Concrete Geometry node, applying a trim effect to its child.
  1087. */
  1088. -class TrimEffect final : public GeometryNode {
  1089. +class SKSG_API TrimEffect final : public GeometryNode {
  1090. public:
  1091. static sk_sp<TrimEffect> Make(sk_sp<GeometryNode> child) {
  1092. return child ? sk_sp<TrimEffect>(new TrimEffect(std::move(child))) : nullptr;
  1093. diff --git a/modules/sksg/src/SkSGTransform.cpp b/modules/sksg/src/SkSGTransform.cpp
  1094. index 7f317527b2..e8e08a5676 100644
  1095. --- a/modules/sksg/src/SkSGTransform.cpp
  1096. +++ b/modules/sksg/src/SkSGTransform.cpp
  1097. @@ -128,18 +128,6 @@ private:
  1098. } // namespace
  1099. -template <>
  1100. -SkMatrix Matrix<SkMatrix>::asMatrix() const { return fMatrix; }
  1101. -
  1102. -template <>
  1103. -SkM44 Matrix<SkMatrix>::asM44() const { return SkM44(fMatrix); }
  1104. -
  1105. -template <>
  1106. -SkMatrix Matrix<SkM44>::asMatrix() const { return fMatrix.asM33(); }
  1107. -
  1108. -template <>
  1109. -SkM44 Matrix<SkM44>::asM44() const { return fMatrix; }
  1110. -
  1111. // Transform nodes don't generate damage on their own, but via ancestor TransformEffects.
  1112. Transform::Transform() : INHERITED(kBubbleDamage_Trait) {}
  1113. diff --git a/src/core/SkTextBlobPriv.h b/src/core/SkTextBlobPriv.h
  1114. index 5394b50d5d..2fa56a9cab 100644
  1115. --- a/src/core/SkTextBlobPriv.h
  1116. +++ b/src/core/SkTextBlobPriv.h
  1117. @@ -199,7 +199,7 @@ private:
  1118. * .....
  1119. * }
  1120. */
  1121. -class SkTextBlobRunIterator {
  1122. +class SK_API SkTextBlobRunIterator {
  1123. public:
  1124. SkTextBlobRunIterator(const SkTextBlob* blob);
  1125. diff --git a/src/utils/SkJSON.h b/src/utils/SkJSON.h
  1126. index d3f0b1d48f..970d64cd5b 100644
  1127. --- a/src/utils/SkJSON.h
  1128. +++ b/src/utils/SkJSON.h
  1129. @@ -53,7 +53,7 @@ namespace skjson {
  1130. * }
  1131. * }
  1132. */
  1133. -class alignas(8) Value {
  1134. +class SK_API alignas(8) Value {
  1135. public:
  1136. enum class Type {
  1137. kNull,
  1138. @@ -209,7 +209,7 @@ private:
  1139. #endif
  1140. };
  1141. -class NullValue final : public Value {
  1142. +class SK_API NullValue final : public Value {
  1143. public:
  1144. static constexpr Type kType = Type::kNull;
  1145. @@ -321,7 +321,7 @@ struct Member {
  1146. Value fValue;
  1147. };
  1148. -class ObjectValue final : public VectorValue<Member, Value::Type::kObject> {
  1149. +class SK_API ObjectValue final : public VectorValue<Member, Value::Type::kObject> {
  1150. public:
  1151. ObjectValue(const Member* src, size_t size, SkArenaAlloc& alloc);
  1152. @@ -332,7 +332,7 @@ public:
  1153. }
  1154. };
  1155. -class DOM final : public SkNoncopyable {
  1156. +class SK_API DOM final : public SkNoncopyable {
  1157. public:
  1158. DOM(const char*, size_t);
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト