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

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト