Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d1be5d6

Browse files
brianosmanSkia Commit-Bot
authored and
Skia Commit-Bot
committed
Fix skshaper in component builds
It was building a shared library, but had no exports (on Windows). We think the correct model for modules in the future is for each one to be a separate DLL linked against the public API/exports of Skia. This serves as the model for that. Doing this with other modules will probably require exporting more symbols from Skia. Change-Id: I116b1635533d755ae71e8df5aa234270b7f77a31 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267477 Reviewed-by: Mike Klein <[email protected]> Commit-Queue: Brian Osman <[email protected]>
1 parent ce9e060 commit d1be5d6

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

modules/skshaper/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if (skia_enable_skshaper) {
2626
deps = [
2727
"../..:skia",
2828
]
29+
defines = [ "SKSHAPER_IMPLEMENTATION=1" ]
2930
sources = skia_shaper_primitive_sources
3031
if (skia_use_icu && skia_use_harfbuzz) {
3132
sources += skia_shaper_harfbuzz_sources

modules/skshaper/include/SkShaper.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@
1717

1818
#include <memory>
1919

20+
#if !defined(SKSHAPER_IMPLEMENTATION)
21+
#define SKSHAPER_IMPLEMENTATION 0
22+
#endif
23+
24+
#if !defined(SKSHAPER_API)
25+
#if defined(SKIA_DLL)
26+
#if defined(_MSC_VER)
27+
#if SKSHAPER_IMPLEMENTATION
28+
#define SKSHAPER_API __declspec(dllexport)
29+
#else
30+
#define SKSHAPER_API __declspec(dllimport)
31+
#endif
32+
#else
33+
#define SKSHAPER_API __attribute__((visibility("default")))
34+
#endif
35+
#else
36+
#define SKSHAPER_API
37+
#endif
38+
#endif
39+
2040
class SkFont;
2141
class SkFontMgr;
2242

@@ -26,7 +46,7 @@ class SkFontMgr;
2646
2747
If compiled without HarfBuzz, fall back on SkPaint::textToGlyphs.
2848
*/
29-
class SkShaper {
49+
class SKSHAPER_API SkShaper {
3050
public:
3151
static std::unique_ptr<SkShaper> MakePrimitive();
3252
#ifdef SK_SHAPER_HARFBUZZ_AVAILABLE
@@ -232,7 +252,7 @@ class SkShaper {
232252
/**
233253
* Helper for shaping text directly into a SkTextBlob.
234254
*/
235-
class SkTextBlobBuilderRunHandler final : public SkShaper::RunHandler {
255+
class SKSHAPER_API SkTextBlobBuilderRunHandler final : public SkShaper::RunHandler {
236256
public:
237257
SkTextBlobBuilderRunHandler(const char* utf8Text, SkPoint offset)
238258
: fUtf8Text(utf8Text)

0 commit comments

Comments
 (0)