Skip to content

Commit ae6aac0

Browse files
committed
updated for windows compile.
1 parent bdeae99 commit ae6aac0

24 files changed

+90
-42
lines changed

gn/BUILDCONFIG.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if (target_os == "win") {
162162
clang_win_version = exec_script("//gn/highest_version_dir.py",
163163
[
164164
"$clang_win/lib/clang",
165-
"[0-9]+\.[0-9]+\.[0-9]+",
165+
"[0-9]+",
166166
],
167167
"trim string")
168168
}

gn/toolchain/BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ toolchain("msvc") {
135135
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
136136

137137
# Label names may have spaces so pdbname must be quoted.
138-
command = "$env_setup $cc_wrapper $cl /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
138+
command = "$env_setup $cc_wrapper $cl /nologo /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_c}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
139139
depsformat = "msvc"
140140
outputs =
141141
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ]
@@ -147,7 +147,7 @@ toolchain("msvc") {
147147
pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb"
148148

149149
# Label names may have spaces so pdbname must be quoted.
150-
command = "$env_setup $cc_wrapper $cl /nologo /showIncludes /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
150+
command = "$env_setup $cc_wrapper $cl /nologo /FC {{defines}} {{include_dirs}} {{cflags}} $cl_m32_flag {{cflags_cc}} /c {{source}} /Fo{{output}} /Fd\"$pdbname\""
151151
depsformat = "msvc"
152152
outputs =
153153
[ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj" ]

include/effects/SkRuntimeEffect.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Program;
6666
class SK_API SkRuntimeEffect : public SkRefCnt {
6767
public:
6868
// Reflected description of a uniform variable in the effect's SkSL
69-
struct Uniform {
69+
struct SK_API Uniform {
7070
enum class Type {
7171
kFloat,
7272
kFloat2,
@@ -127,7 +127,7 @@ class SK_API SkRuntimeEffect : public SkRefCnt {
127127
int index;
128128
};
129129

130-
class Options {
130+
class SK_API Options {
131131
public:
132132
// For testing purposes, disables optimization and inlining. (Normally, Runtime Effects
133133
// don't run the inliner directly, but they still get an inlining pass once they are
@@ -187,7 +187,7 @@ class SK_API SkRuntimeEffect : public SkRefCnt {
187187
}
188188

189189
// Object that allows passing a SkShader, SkColorFilter or SkBlender as a child
190-
class ChildPtr {
190+
class SK_API ChildPtr {
191191
public:
192192
ChildPtr() = default;
193193
ChildPtr(sk_sp<SkShader> s) : fChild(std::move(s)) {}
@@ -347,9 +347,9 @@ class SK_API SkRuntimeEffect : public SkRefCnt {
347347
};
348348

349349
/** Base class for SkRuntimeShaderBuilder, defined below. */
350-
class SkRuntimeEffectBuilder {
350+
class SK_API SkRuntimeEffectBuilder {
351351
public:
352-
struct BuilderUniform {
352+
struct SK_API BuilderUniform {
353353
// Copy 'val' to this variable. No type conversion is performed - 'val' must be same
354354
// size as expected by the effect. Information about the variable can be queried by
355355
// looking at fVar. If the size is incorrect, no copy will be performed, and debug
@@ -404,7 +404,7 @@ class SkRuntimeEffectBuilder {
404404
const SkRuntimeEffect::Uniform* fVar; // nullptr if the variable was not found
405405
};
406406

407-
struct BuilderChild {
407+
struct SK_API BuilderChild {
408408
template <typename T> BuilderChild& operator=(sk_sp<T> val) {
409409
if (!fChild) {
410410
SkDEBUGFAIL("Assigning to missing child");

modules/skparagraph/BUILD.gn

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ if (skia_enable_skparagraph && skia_enable_skshaper && skia_enable_skunicode &&
1616
skia_use_harfbuzz) {
1717
config("public_config") {
1818
defines = [ "SK_ENABLE_PARAGRAPH" ]
19+
if (is_component_build) {
20+
defines += [ "SKPARAGRAPH_DLL" ]
21+
}
1922
include_dirs = [
2023
"include",
2124
"utils",
@@ -32,6 +35,7 @@ if (skia_enable_skparagraph && skia_enable_skshaper && skia_enable_skunicode &&
3235
"../skshaper",
3336
"../skunicode",
3437
]
38+
defines = [ "SKPARAGRAPH_IMPLEMENTATION=1" ]
3539
}
3640

3741
config("utils_config") {

modules/skparagraph/include/DartTypes.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#ifndef DartTypes_DEFINED
44
#define DartTypes_DEFINED
55

6+
#include "paragraph_dll.h"
7+
68
#include "include/core/SkRect.h"
79
#include "include/core/SkTypes.h"
810

@@ -63,15 +65,15 @@ enum class TextDirection {
6365
kLtr,
6466
};
6567

66-
struct PositionWithAffinity {
68+
struct SKPARAGRAPH_API PositionWithAffinity {
6769
int32_t position;
6870
Affinity affinity;
6971

7072
PositionWithAffinity() : position(0), affinity(kDownstream) {}
7173
PositionWithAffinity(int32_t p, Affinity a) : position(p), affinity(a) {}
7274
};
7375

74-
struct TextBox {
76+
struct SKPARAGRAPH_API TextBox {
7577
SkRect rect;
7678
TextDirection direction;
7779

modules/skparagraph/include/FontArguments.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef FontArguments_DEFINED
33
#define FontArguments_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include <functional>
68
#include <vector>
79
#include "include/core/SkFontArguments.h"
@@ -10,7 +12,7 @@
1012
namespace skia {
1113
namespace textlayout {
1214

13-
class FontArguments {
15+
class SKPARAGRAPH_API FontArguments {
1416
public:
1517
FontArguments(const SkFontArguments&);
1618
FontArguments(const FontArguments&) = default;

modules/skparagraph/include/FontCollection.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef FontCollection_DEFINED
33
#define FontCollection_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include <memory>
68
#include <optional>
79
#include <set>
@@ -17,7 +19,7 @@ namespace textlayout {
1719

1820
class TextStyle;
1921
class Paragraph;
20-
class FontCollection : public SkRefCnt {
22+
class SKPARAGRAPH_API FontCollection : public SkRefCnt {
2123
public:
2224
FontCollection();
2325

modules/skparagraph/include/Metrics.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#ifndef Metrics_DEFINED
33
#define Metrics_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include <map>
68
#include "modules/skparagraph/include/TextStyle.h"
79

810
namespace skia {
911
namespace textlayout {
10-
class StyleMetrics {
12+
class SKPARAGRAPH_API StyleMetrics {
1113
public:
1214
StyleMetrics(const TextStyle* style) : text_style(style) {}
1315

@@ -36,7 +38,7 @@ class StyleMetrics {
3638
SkFontMetrics font_metrics;
3739
};
3840

39-
class LineMetrics {
41+
class SKPARAGRAPH_API LineMetrics {
4042
public:
4143
LineMetrics() { }
4244

modules/skparagraph/include/Paragraph.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef Paragraph_DEFINED
33
#define Paragraph_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "modules/skparagraph/include/FontCollection.h"
68
#include "modules/skparagraph/include/Metrics.h"
79
#include "modules/skparagraph/include/ParagraphStyle.h"
@@ -15,7 +17,7 @@ namespace textlayout {
1517

1618
class ParagraphPainter;
1719

18-
class Paragraph {
20+
class SKPARAGRAPH_API Paragraph {
1921

2022
public:
2123
Paragraph(ParagraphStyle style, sk_sp<FontCollection> fonts);

modules/skparagraph/include/ParagraphBuilder.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef ParagraphBuilder_DEFINED
33
#define ParagraphBuilder_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include <memory>
68
#include <stack>
79
#include <string>
@@ -15,7 +17,7 @@
1517
namespace skia {
1618
namespace textlayout {
1719

18-
class ParagraphBuilder {
20+
class SKPARAGRAPH_API ParagraphBuilder {
1921
public:
2022
ParagraphBuilder(const ParagraphStyle&, sk_sp<FontCollection>) { }
2123

modules/skparagraph/include/ParagraphCache.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef ParagraphCache_DEFINED
33
#define ParagraphCache_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "include/private/base/SkMutex.h"
68
#include "src/core/SkLRUCache.h"
79
#include <functional> // std::function
@@ -15,7 +17,7 @@ class ParagraphImpl;
1517
class ParagraphCacheKey;
1618
class ParagraphCacheValue;
1719

18-
class ParagraphCache {
20+
class SKPARAGRAPH_API ParagraphCache {
1921
public:
2022
ParagraphCache();
2123
~ParagraphCache();

modules/skparagraph/include/ParagraphPainter.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef ParagraphPainter_DEFINED
33
#define ParagraphPainter_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "include/core/SkPaint.h"
68
#include "include/core/SkTextBlob.h"
79

@@ -11,7 +13,7 @@
1113
namespace skia {
1214
namespace textlayout {
1315

14-
class ParagraphPainter {
16+
class SKPARAGRAPH_API ParagraphPainter {
1517
public:
1618
typedef int PaintID;
1719
typedef std::variant<SkPaint, PaintID> SkPaintOrID;

modules/skparagraph/include/ParagraphStyle.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef ParagraphStyle_DEFINED
33
#define ParagraphStyle_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "include/core/SkFontStyle.h"
68
#include "include/core/SkScalar.h"
79
#include "include/core/SkString.h"
@@ -18,7 +20,7 @@
1820
namespace skia {
1921
namespace textlayout {
2022

21-
struct StrutStyle {
23+
struct SKPARAGRAPH_API StrutStyle {
2224
StrutStyle();
2325

2426
const std::vector<SkString>& getFontFamilies() const { return fFontFamilies; }
@@ -75,7 +77,7 @@ struct StrutStyle {
7577
bool fHalfLeading;
7678
};
7779

78-
struct ParagraphStyle {
80+
struct SKPARAGRAPH_API ParagraphStyle {
7981
ParagraphStyle();
8082

8183
bool operator==(const ParagraphStyle& rhs) const {

modules/skparagraph/include/TextShadow.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
#ifndef TextShadow_DEFINED
33
#define TextShadow_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "include/core/SkColor.h"
68
#include "include/core/SkPoint.h"
79

810
namespace skia {
911
namespace textlayout {
1012

11-
class TextShadow {
13+
class SKPARAGRAPH_API TextShadow {
1214
public:
1315
SkColor fColor = SK_ColorBLACK;
1416
SkPoint fOffset;

modules/skparagraph/include/TextStyle.h

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef TextStyle_DEFINED
33
#define TextStyle_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include <optional>
68
#include <vector>
79
#include "include/core/SkColor.h"
@@ -67,7 +69,7 @@ enum StyleType {
6769
kWordSpacing
6870
};
6971

70-
struct Decoration {
72+
struct SKPARAGRAPH_API Decoration {
7173
TextDecoration fType;
7274
TextDecorationMode fMode;
7375
SkColor fColor;
@@ -121,7 +123,7 @@ struct FontFeature {
121123
int fValue;
122124
};
123125

124-
struct PlaceholderStyle {
126+
struct SKPARAGRAPH_API PlaceholderStyle {
125127
PlaceholderStyle() = default;
126128
PlaceholderStyle(SkScalar width, SkScalar height, PlaceholderAlignment alignment,
127129
TextBaseline baseline, SkScalar offset)
@@ -148,7 +150,7 @@ struct PlaceholderStyle {
148150
SkScalar fBaselineOffset = 0;
149151
};
150152

151-
class TextStyle {
153+
class SKPARAGRAPH_API TextStyle {
152154
public:
153155
TextStyle() = default;
154156
TextStyle(const TextStyle& other) = default;
@@ -287,7 +289,7 @@ class TextStyle {
287289
void setPlaceholder() { fIsPlaceholder = true; }
288290

289291
private:
290-
static const std::vector<SkString>* kDefaultFontFamilies;
292+
//static const std::vector<SkString>* kDefaultFontFamilies;
291293

292294
Decoration fDecoration = {
293295
TextDecoration::kNoDecoration,
@@ -301,7 +303,7 @@ class TextStyle {
301303

302304
SkFontStyle fFontStyle;
303305

304-
std::vector<SkString> fFontFamilies = *kDefaultFontFamilies;
306+
std::vector<SkString> fFontFamilies = std::vector<SkString>{SkString(DEFAULT_FONT_FAMILY)};
305307

306308
SkScalar fFontSize = 14.0;
307309
SkScalar fHeight = 1.0;
@@ -336,7 +338,7 @@ typedef size_t TextIndex;
336338
typedef SkRange<size_t> TextRange;
337339
const SkRange<size_t> EMPTY_TEXT = EMPTY_RANGE;
338340

339-
struct Block {
341+
struct SKPARAGRAPH_API Block {
340342
Block() = default;
341343
Block(size_t start, size_t end, const TextStyle& style) : fRange(start, end), fStyle(style) {}
342344
Block(TextRange textRange, const TextStyle& style) : fRange(textRange), fStyle(style) {}
@@ -356,7 +358,7 @@ typedef SkRange<size_t> BlockRange;
356358
const size_t EMPTY_BLOCK = EMPTY_INDEX;
357359
const SkRange<size_t> EMPTY_BLOCKS = EMPTY_RANGE;
358360

359-
struct Placeholder {
361+
struct SKPARAGRAPH_API Placeholder {
360362
Placeholder() = default;
361363
Placeholder(size_t start, size_t end, const PlaceholderStyle& style, const TextStyle& textStyle,
362364
BlockRange blocksBefore, TextRange textBefore)

modules/skparagraph/include/TypefaceFontProvider.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef TypefaceFontProvider_DEFINED
33
#define TypefaceFontProvider_DEFINED
44

5+
#include "paragraph_dll.h"
6+
57
#include "include/private/base/SkTArray.h"
68
#include "src/core/SkTHash.h"
79
#include <string>
@@ -14,7 +16,7 @@
1416
namespace skia {
1517
namespace textlayout {
1618

17-
class TypefaceFontStyleSet : public SkFontStyleSet {
19+
class SKPARAGRAPH_API TypefaceFontStyleSet : public SkFontStyleSet {
1820
public:
1921
explicit TypefaceFontStyleSet(const SkString& familyName);
2022

@@ -33,7 +35,7 @@ class TypefaceFontStyleSet : public SkFontStyleSet {
3335
SkString fAlias;
3436
};
3537

36-
class TypefaceFontProvider : public SkFontMgr {
38+
class SKPARAGRAPH_API TypefaceFontProvider : public SkFontMgr {
3739
public:
3840
size_t registerTypeface(sk_sp<SkTypeface> typeface);
3941
size_t registerTypeface(sk_sp<SkTypeface> typeface, const SkString& alias);

0 commit comments

Comments
 (0)