@shopify/react-native-skia 0.1.129 → 0.1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +1 -0
- package/cpp/api/JsiSkRuntimeEffect.h +7 -9
- package/cpp/api/JsiSkVertices.h +0 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +7 -1
- package/cpp/skia/include/core/SkAlphaType.h +45 -0
- package/cpp/skia/include/core/SkBitmap.h +4 -2
- package/cpp/skia/include/core/SkCanvas.h +31 -20
- package/cpp/skia/include/core/SkColor.h +1 -1
- package/cpp/skia/include/core/SkColorFilter.h +1 -0
- package/cpp/skia/include/core/SkColorType.h +66 -0
- package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +1 -1
- package/cpp/skia/include/core/SkDrawable.h +7 -0
- package/cpp/skia/include/core/SkEncodedImageFormat.h +1 -0
- package/cpp/skia/include/core/SkFont.h +4 -3
- package/cpp/skia/include/core/SkFontArguments.h +33 -1
- package/cpp/skia/include/core/SkGraphics.h +13 -0
- package/cpp/skia/include/core/SkImage.h +67 -22
- package/cpp/skia/include/core/SkImageEncoder.h +0 -3
- package/cpp/skia/include/core/SkImageGenerator.h +4 -3
- package/cpp/skia/include/core/SkImageInfo.h +35 -142
- package/cpp/skia/include/core/SkMesh.h +303 -0
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkOpenTypeSVGDecoder.h +30 -0
- package/cpp/skia/include/core/SkPaint.h +4 -19
- package/cpp/skia/include/core/SkPath.h +20 -33
- package/cpp/skia/include/core/SkPathBuilder.h +1 -6
- package/cpp/skia/include/core/SkPixelRef.h +1 -1
- package/cpp/skia/include/core/SkPixmap.h +3 -2
- package/cpp/skia/include/core/SkRSXform.h +1 -1
- package/cpp/skia/include/core/SkSamplingOptions.h +16 -5
- package/cpp/skia/include/core/SkSpan.h +5 -5
- package/cpp/skia/include/core/SkString.h +5 -8
- package/cpp/skia/include/core/SkSurface.h +21 -0
- package/cpp/skia/include/core/SkTypeface.h +20 -4
- package/cpp/skia/include/core/SkTypes.h +9 -5
- package/cpp/skia/include/effects/SkGradientShader.h +9 -18
- package/cpp/skia/include/effects/SkRuntimeEffect.h +16 -12
- package/cpp/skia/include/gpu/GpuTypes.h +32 -0
- package/cpp/skia/include/gpu/GrBackendSemaphore.h +1 -1
- package/cpp/skia/include/gpu/GrBackendSurface.h +6 -5
- package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +1 -1
- package/cpp/skia/include/gpu/GrContextOptions.h +11 -20
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +7 -0
- package/cpp/skia/include/gpu/GrDirectContext.h +16 -11
- package/cpp/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +0 -2
- package/cpp/skia/include/gpu/GrRecordingContext.h +14 -7
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +6 -6
- package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +3 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -2
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +64 -0
- package/cpp/skia/include/gpu/graphite/Context.h +124 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +71 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +104 -0
- package/cpp/skia/include/gpu/graphite/Recording.h +39 -0
- package/cpp/skia/include/gpu/graphite/SkStuff.h +47 -0
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +91 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +24 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlTypes.h +68 -0
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -2
- package/cpp/skia/include/ports/SkCFObject.h +0 -4
- package/cpp/skia/include/ports/SkTypeface_win.h +2 -2
- package/cpp/skia/include/private/{GrSingleOwner.h → SingleOwner.h} +17 -10
- package/cpp/skia/include/private/SkChecksum.h +11 -0
- package/cpp/skia/include/private/SkEncodedInfo.h +22 -5
- package/cpp/skia/include/private/SkFloatingPoint.h +0 -53
- package/cpp/skia/include/private/SkImageInfoPriv.h +8 -2
- package/cpp/skia/include/private/SkMacros.h +13 -18
- package/cpp/skia/include/private/SkMutex.h +8 -0
- package/cpp/skia/include/private/SkPathRef.h +2 -16
- package/cpp/skia/include/private/SkSLDefines.h +9 -1
- package/cpp/skia/include/private/SkSLIRNode.h +6 -5
- package/cpp/skia/include/private/SkSLLayout.h +11 -10
- package/cpp/skia/include/private/SkSLModifiers.h +4 -3
- package/cpp/skia/include/private/SkSLProgramElement.h +2 -2
- package/cpp/skia/include/private/SkSLProgramKind.h +8 -5
- package/cpp/skia/include/private/SkSLStatement.h +2 -3
- package/cpp/skia/include/private/SkSLString.h +17 -56
- package/cpp/skia/include/private/SkSLSymbol.h +4 -4
- package/cpp/skia/include/private/SkShadowFlags.h +3 -1
- package/cpp/skia/include/private/SkStringView.h +47 -0
- package/cpp/skia/include/private/SkTArray.h +4 -3
- package/cpp/skia/include/private/SkTHash.h +66 -24
- package/cpp/skia/include/private/SkTLogic.h +2 -32
- package/cpp/skia/include/private/SkTemplates.h +2 -2
- package/cpp/skia/include/private/SkThreadAnnotations.h +4 -4
- package/cpp/skia/include/private/SkVx.h +28 -28
- package/cpp/skia/include/private/chromium/GrSlug.h +40 -3
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +12 -6
- package/cpp/skia/include/private/{GrContext_Base.h → gpu/ganesh/GrContext_Base.h} +7 -0
- package/cpp/skia/include/private/{GrD3DTypesMinimal.h → gpu/ganesh/GrD3DTypesMinimal.h} +0 -0
- package/cpp/skia/include/private/{GrDawnTypesPriv.h → gpu/ganesh/GrDawnTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrGLTypesPriv.h → gpu/ganesh/GrGLTypesPriv.h} +1 -0
- package/cpp/skia/include/private/{GrImageContext.h → gpu/ganesh/GrImageContext.h} +4 -4
- package/cpp/skia/include/private/{GrMockTypesPriv.h → gpu/ganesh/GrMockTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrMtlTypesPriv.h → gpu/ganesh/GrMtlTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrTypesPriv.h → gpu/ganesh/GrTypesPriv.h} +25 -367
- package/cpp/skia/include/private/{GrVkTypesPriv.h → gpu/ganesh/GrVkTypesPriv.h} +0 -0
- package/cpp/skia/include/private/gpu/graphite/MtlTypesPriv.h +74 -0
- package/cpp/skia/include/sksl/DSL.h +4 -0
- package/cpp/skia/include/sksl/DSLBlock.h +8 -3
- package/cpp/skia/include/sksl/DSLCase.h +6 -6
- package/cpp/skia/include/sksl/DSLCore.h +89 -78
- package/cpp/skia/include/sksl/DSLExpression.h +78 -45
- package/cpp/skia/include/sksl/DSLFunction.h +23 -18
- package/cpp/skia/include/sksl/DSLLayout.h +14 -16
- package/cpp/skia/include/sksl/DSLModifiers.h +7 -5
- package/cpp/skia/include/sksl/DSLRuntimeEffects.h +1 -1
- package/cpp/skia/include/sksl/DSLStatement.h +16 -10
- package/cpp/skia/include/sksl/DSLSymbols.h +7 -7
- package/cpp/skia/include/sksl/DSLType.h +27 -23
- package/cpp/skia/include/sksl/DSLVar.h +72 -61
- package/cpp/skia/include/sksl/SkSLErrorReporter.h +12 -49
- package/cpp/skia/include/sksl/SkSLOperator.h +151 -0
- package/cpp/skia/include/sksl/SkSLPosition.h +102 -0
- package/cpp/skia/include/svg/SkSVGCanvas.h +5 -1
- package/cpp/skia/include/utils/SkAnimCodecPlayer.h +7 -0
- package/cpp/skia/include/utils/SkCamera.h +2 -0
- package/cpp/skia/include/utils/SkCanvasStateUtils.h +4 -1
- package/cpp/skia/include/utils/SkCustomTypeface.h +6 -4
- package/cpp/skia/include/utils/SkNWayCanvas.h +34 -0
- package/cpp/skia/include/utils/SkNullCanvas.h +5 -1
- package/cpp/skia/include/utils/SkOrderedFontMgr.h +12 -0
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +30 -1
- package/cpp/skia/include/utils/SkParse.h +2 -0
- package/cpp/skia/include/utils/SkShadowUtils.h +3 -2
- package/cpp/skia/include/utils/SkTextUtils.h +8 -4
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +27 -1
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -0
- package/cpp/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h +32 -0
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +2 -0
- package/cpp/skia/modules/svg/include/SkSVGTypes.h +48 -9
- package/ios/RNSkia-iOS/PlatformContext.h +1 -1
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +1 -0
- package/ios/RNSkia-iOS/SkiaDrawView.mm +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +1 -2
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +1 -2
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +0 -1
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +2 -4
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +2 -2
- package/src/renderer/components/shaders/Shader.tsx +1 -3
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +1 -8
- package/cpp/skia/include/core/SkCustomMesh.h +0 -202
- package/cpp/skia/include/core/SkStringView.h +0 -185
- package/cpp/skia/include/private/SkPaintParamsKey.h +0 -110
- package/cpp/skia/include/private/SkShaderCodeDictionary.h +0 -63
- package/cpp/skia/include/private/SkTOptional.h +0 -362
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 Google LLC.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
5
|
+
* found in the LICENSE file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef SKSL_POSITION
|
|
9
|
+
#define SKSL_POSITION
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkTypes.h"
|
|
12
|
+
#include <string_view>
|
|
13
|
+
|
|
14
|
+
namespace SkSL {
|
|
15
|
+
|
|
16
|
+
class Position {
|
|
17
|
+
public:
|
|
18
|
+
Position()
|
|
19
|
+
: fStartOffset(-1)
|
|
20
|
+
, fLength(0) {}
|
|
21
|
+
|
|
22
|
+
static Position Range(int startOffset, int endOffset) {
|
|
23
|
+
SkASSERT(startOffset <= endOffset);
|
|
24
|
+
SkASSERT(startOffset <= 0xFFFFFF);
|
|
25
|
+
int length = endOffset - startOffset;
|
|
26
|
+
Position result;
|
|
27
|
+
result.fStartOffset = startOffset;
|
|
28
|
+
result.fLength = length <= 0xFF ? length : 0xFF;
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
bool valid() const {
|
|
33
|
+
return fStartOffset != -1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
int line(std::string_view source) const;
|
|
37
|
+
|
|
38
|
+
int startOffset() const {
|
|
39
|
+
SkASSERT(this->valid());
|
|
40
|
+
return fStartOffset;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
int endOffset() const {
|
|
44
|
+
SkASSERT(this->valid());
|
|
45
|
+
return fStartOffset + fLength;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Returns the position from this through, and including the entirety of, end.
|
|
49
|
+
Position rangeThrough(Position end) const {
|
|
50
|
+
if (fStartOffset == -1 || end.fStartOffset == -1) {
|
|
51
|
+
return *this;
|
|
52
|
+
}
|
|
53
|
+
SkASSERTF(this->startOffset() <= end.startOffset() && this->endOffset() <= end.endOffset(),
|
|
54
|
+
"Invalid range: (%d-%d) - (%d-%d)\n", this->startOffset(), this->endOffset(),
|
|
55
|
+
end.startOffset(), end.endOffset());
|
|
56
|
+
return Range(this->startOffset(), end.endOffset());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Returns a position representing the character immediately after this position
|
|
60
|
+
Position after() const {
|
|
61
|
+
int endOffset = this->endOffset();
|
|
62
|
+
return Range(endOffset, endOffset + 1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
bool operator==(const Position& other) const {
|
|
66
|
+
return fStartOffset == other.fStartOffset && fLength == other.fLength;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
bool operator!=(const Position& other) const {
|
|
70
|
+
return !(*this == other);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
bool operator>(const Position& other) const {
|
|
74
|
+
return fStartOffset > other.fStartOffset;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
bool operator>=(const Position& other) const {
|
|
78
|
+
return fStartOffset >= other.fStartOffset;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
bool operator<(const Position& other) const {
|
|
82
|
+
return fStartOffset < other.fStartOffset;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
bool operator<=(const Position& other) const {
|
|
86
|
+
return fStartOffset <= other.fStartOffset;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private:
|
|
90
|
+
int32_t fStartOffset : 24;
|
|
91
|
+
uint32_t fLength : 8;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
struct ForLoopPositions {
|
|
95
|
+
Position initPosition = Position();
|
|
96
|
+
Position conditionPosition = Position();
|
|
97
|
+
Position nextPosition = Position();
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
} // namespace SkSL
|
|
101
|
+
|
|
102
|
+
#endif
|
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
#ifndef SkSVGCanvas_DEFINED
|
|
9
9
|
#define SkSVGCanvas_DEFINED
|
|
10
10
|
|
|
11
|
-
#include "include/core/
|
|
11
|
+
#include "include/core/SkTypes.h"
|
|
12
12
|
|
|
13
|
+
#include <memory>
|
|
14
|
+
|
|
15
|
+
class SkCanvas;
|
|
13
16
|
class SkWStream;
|
|
17
|
+
struct SkRect;
|
|
14
18
|
|
|
15
19
|
class SK_API SkSVGCanvas {
|
|
16
20
|
public:
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
#define SkAnimCodecPlayer_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/codec/SkCodec.h"
|
|
12
|
+
#include "include/core/SkImageInfo.h"
|
|
13
|
+
#include "include/core/SkRefCnt.h"
|
|
14
|
+
#include "include/core/SkSize.h"
|
|
15
|
+
|
|
16
|
+
#include <stdint.h>
|
|
17
|
+
#include <memory>
|
|
18
|
+
#include <vector>
|
|
12
19
|
|
|
13
20
|
class SkImage;
|
|
14
21
|
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
#include "include/core/SkM44.h"
|
|
14
14
|
#include "include/core/SkMatrix.h"
|
|
15
|
+
#include "include/core/SkScalar.h"
|
|
16
|
+
#include "include/core/SkTypes.h"
|
|
15
17
|
#include "include/private/SkNoncopyable.h"
|
|
16
18
|
|
|
17
19
|
// NOTE -- This entire header / impl is deprecated, and will be removed from Skia soon.
|
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkFontMetrics.h"
|
|
12
12
|
#include "include/core/SkFontStyle.h"
|
|
13
|
-
#include "include/core/SkImage.h"
|
|
14
|
-
#include "include/core/SkPaint.h"
|
|
15
13
|
#include "include/core/SkPath.h"
|
|
16
|
-
#include "include/core/
|
|
17
|
-
#include "include/core/
|
|
14
|
+
#include "include/core/SkRefCnt.h"
|
|
15
|
+
#include "include/core/SkTypes.h"
|
|
18
16
|
|
|
19
17
|
#include <vector>
|
|
20
18
|
|
|
19
|
+
class SkImage;
|
|
20
|
+
class SkPaint;
|
|
21
|
+
class SkPicture;
|
|
21
22
|
class SkStream;
|
|
23
|
+
class SkTypeface;
|
|
22
24
|
|
|
23
25
|
class SkCustomTypefaceBuilder {
|
|
24
26
|
public:
|
|
@@ -9,10 +9,41 @@
|
|
|
9
9
|
#ifndef SkNWayCanvas_DEFINED
|
|
10
10
|
#define SkNWayCanvas_DEFINED
|
|
11
11
|
|
|
12
|
+
#include "include/core/SkBlendMode.h"
|
|
13
|
+
#include "include/core/SkCanvas.h"
|
|
12
14
|
#include "include/core/SkCanvasVirtualEnforcer.h"
|
|
15
|
+
#include "include/core/SkClipOp.h"
|
|
16
|
+
#include "include/core/SkColor.h"
|
|
17
|
+
#include "include/core/SkM44.h"
|
|
18
|
+
#include "include/core/SkRefCnt.h"
|
|
19
|
+
#include "include/core/SkSamplingOptions.h"
|
|
20
|
+
#include "include/core/SkScalar.h"
|
|
21
|
+
#include "include/core/SkTypes.h"
|
|
13
22
|
#include "include/private/SkTDArray.h"
|
|
14
23
|
#include "include/utils/SkNoDrawCanvas.h"
|
|
15
24
|
|
|
25
|
+
class SkData;
|
|
26
|
+
class SkDrawable;
|
|
27
|
+
class SkGlyphRunList;
|
|
28
|
+
class SkImage;
|
|
29
|
+
class SkMatrix;
|
|
30
|
+
class SkPaint;
|
|
31
|
+
class SkPath;
|
|
32
|
+
class SkPicture;
|
|
33
|
+
class SkRRect;
|
|
34
|
+
class SkRegion;
|
|
35
|
+
class SkShader;
|
|
36
|
+
class SkTextBlob;
|
|
37
|
+
class SkVertices;
|
|
38
|
+
struct SkDrawShadowRec;
|
|
39
|
+
struct SkPoint;
|
|
40
|
+
struct SkRSXform;
|
|
41
|
+
struct SkRect;
|
|
42
|
+
|
|
43
|
+
#if SK_SUPPORT_GPU
|
|
44
|
+
class GrSlug;
|
|
45
|
+
#endif
|
|
46
|
+
|
|
16
47
|
class SK_API SkNWayCanvas : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
|
|
17
48
|
public:
|
|
18
49
|
SkNWayCanvas(int width, int height);
|
|
@@ -39,6 +70,9 @@ protected:
|
|
|
39
70
|
void onDrawGlyphRunList(const SkGlyphRunList&, const SkPaint&) override;
|
|
40
71
|
void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
|
|
41
72
|
const SkPaint& paint) override;
|
|
73
|
+
#if SK_SUPPORT_GPU
|
|
74
|
+
void onDrawSlug(const GrSlug* slug) override;
|
|
75
|
+
#endif
|
|
42
76
|
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
|
|
43
77
|
const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint) override;
|
|
44
78
|
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
#ifndef SkNullCanvas_DEFINED
|
|
9
9
|
#define SkNullCanvas_DEFINED
|
|
10
10
|
|
|
11
|
-
#include "include/core/
|
|
11
|
+
#include "include/core/SkTypes.h"
|
|
12
|
+
|
|
13
|
+
#include <memory>
|
|
14
|
+
|
|
15
|
+
class SkCanvas;
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Creates a canvas that draws nothing. This is useful for performance testing.
|
|
@@ -9,7 +9,19 @@
|
|
|
9
9
|
#define SkOrderedFontMgr_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkFontMgr.h"
|
|
12
|
+
#include "include/core/SkRefCnt.h"
|
|
13
|
+
#include "include/core/SkTypes.h"
|
|
14
|
+
|
|
15
|
+
#include <memory>
|
|
12
16
|
#include <vector>
|
|
17
|
+
|
|
18
|
+
class SkData;
|
|
19
|
+
class SkFontStyle;
|
|
20
|
+
class SkStreamAsset;
|
|
21
|
+
class SkString;
|
|
22
|
+
class SkTypeface;
|
|
23
|
+
struct SkFontArguments;
|
|
24
|
+
|
|
13
25
|
/**
|
|
14
26
|
* Collects an order list of other font managers, and visits them in order
|
|
15
27
|
* when a request to find or match is issued.
|
|
@@ -8,10 +8,39 @@
|
|
|
8
8
|
#ifndef SkPaintFilterCanvas_DEFINED
|
|
9
9
|
#define SkPaintFilterCanvas_DEFINED
|
|
10
10
|
|
|
11
|
+
#include "include/core/SkBlendMode.h"
|
|
12
|
+
#include "include/core/SkCanvas.h"
|
|
11
13
|
#include "include/core/SkCanvasVirtualEnforcer.h"
|
|
14
|
+
#include "include/core/SkColor.h"
|
|
15
|
+
#include "include/core/SkImageInfo.h"
|
|
16
|
+
#include "include/core/SkRefCnt.h"
|
|
17
|
+
#include "include/core/SkSamplingOptions.h"
|
|
18
|
+
#include "include/core/SkScalar.h"
|
|
19
|
+
#include "include/core/SkSize.h"
|
|
20
|
+
#include "include/core/SkTypes.h"
|
|
21
|
+
#include "include/private/SkTDArray.h"
|
|
12
22
|
#include "include/utils/SkNWayCanvas.h"
|
|
13
23
|
|
|
14
|
-
class
|
|
24
|
+
class GrRecordingContext;
|
|
25
|
+
class SkData;
|
|
26
|
+
class SkDrawable;
|
|
27
|
+
class SkGlyphRunList;
|
|
28
|
+
class SkImage;
|
|
29
|
+
class SkMatrix;
|
|
30
|
+
class SkPaint;
|
|
31
|
+
class SkPath;
|
|
32
|
+
class SkPicture;
|
|
33
|
+
class SkPixmap;
|
|
34
|
+
class SkRRect;
|
|
35
|
+
class SkRegion;
|
|
36
|
+
class SkSurface;
|
|
37
|
+
class SkSurfaceProps;
|
|
38
|
+
class SkTextBlob;
|
|
39
|
+
class SkVertices;
|
|
40
|
+
struct SkDrawShadowRec;
|
|
41
|
+
struct SkPoint;
|
|
42
|
+
struct SkRSXform;
|
|
43
|
+
struct SkRect;
|
|
15
44
|
|
|
16
45
|
/** \class SkPaintFilterCanvas
|
|
17
46
|
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
#define SkShadowUtils_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkColor.h"
|
|
12
|
-
#include "include/core/SkPoint3.h"
|
|
13
12
|
#include "include/core/SkScalar.h"
|
|
13
|
+
#include "include/core/SkTypes.h"
|
|
14
14
|
#include "include/private/SkShadowFlags.h"
|
|
15
15
|
|
|
16
16
|
class SkCanvas;
|
|
17
17
|
class SkMatrix;
|
|
18
18
|
class SkPath;
|
|
19
|
-
|
|
19
|
+
struct SkPoint3;
|
|
20
|
+
struct SkRect;
|
|
20
21
|
|
|
21
22
|
class SK_API SkShadowUtils {
|
|
22
23
|
public:
|
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
#ifndef SkTextUtils_DEFINED
|
|
9
9
|
#define SkTextUtils_DEFINED
|
|
10
10
|
|
|
11
|
-
#include "include/core/
|
|
12
|
-
#include "include/core/
|
|
13
|
-
#include "include/core/
|
|
14
|
-
#include "include/core/SkString.h"
|
|
11
|
+
#include "include/core/SkFontTypes.h"
|
|
12
|
+
#include "include/core/SkScalar.h"
|
|
13
|
+
#include "include/core/SkTypes.h"
|
|
15
14
|
|
|
15
|
+
#include <string.h>
|
|
16
|
+
|
|
17
|
+
class SkCanvas;
|
|
18
|
+
class SkFont;
|
|
19
|
+
class SkPaint;
|
|
16
20
|
class SkPath;
|
|
17
21
|
|
|
18
22
|
class SK_API SkTextUtils {
|
|
@@ -71,6 +71,26 @@ public:
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
private:
|
|
74
|
+
class RestoreCurPos {
|
|
75
|
+
public:
|
|
76
|
+
explicit RestoreCurPos(SkSVGAttributeParser* self)
|
|
77
|
+
: fSelf(self), fCurPos(self->fCurPos) {}
|
|
78
|
+
|
|
79
|
+
~RestoreCurPos() {
|
|
80
|
+
if (fSelf) {
|
|
81
|
+
fSelf->fCurPos = this->fCurPos;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
void clear() { fSelf = nullptr; }
|
|
86
|
+
private:
|
|
87
|
+
SkSVGAttributeParser* fSelf;
|
|
88
|
+
const char* fCurPos;
|
|
89
|
+
|
|
90
|
+
RestoreCurPos( const RestoreCurPos&) = delete;
|
|
91
|
+
RestoreCurPos& operator=(const RestoreCurPos&) = delete;
|
|
92
|
+
};
|
|
93
|
+
|
|
74
94
|
// Stack-only
|
|
75
95
|
void* operator new(size_t) = delete;
|
|
76
96
|
void* operator new(size_t, void*) = delete;
|
|
@@ -82,6 +102,7 @@ private:
|
|
|
82
102
|
bool advanceWhile(F func);
|
|
83
103
|
|
|
84
104
|
bool matchStringToken(const char* token, const char** newPos = nullptr) const;
|
|
105
|
+
bool matchHexToken(const char** newPos) const;
|
|
85
106
|
|
|
86
107
|
bool parseWSToken();
|
|
87
108
|
bool parseEOSToken();
|
|
@@ -90,12 +111,16 @@ private:
|
|
|
90
111
|
bool parseExpectedStringToken(const char*);
|
|
91
112
|
bool parseScalarToken(SkScalar*);
|
|
92
113
|
bool parseInt32Token(int32_t*);
|
|
93
|
-
bool
|
|
114
|
+
bool parseEscape(SkUnichar*);
|
|
115
|
+
bool parseIdentToken(SkString*);
|
|
94
116
|
bool parseLengthUnitToken(SkSVGLength::Unit*);
|
|
95
117
|
bool parseNamedColorToken(SkColor*);
|
|
96
118
|
bool parseHexColorToken(SkColor*);
|
|
97
119
|
bool parseColorComponentToken(int32_t*);
|
|
120
|
+
bool parseColorToken(SkColor*);
|
|
98
121
|
bool parseRGBColorToken(SkColor*);
|
|
122
|
+
bool parseSVGColor(SkSVGColor*, SkSVGColor::Vars&&);
|
|
123
|
+
bool parseSVGColorType(SkSVGColorType*);
|
|
99
124
|
bool parseFuncIRI(SkSVGFuncIRI*);
|
|
100
125
|
|
|
101
126
|
// Transform helpers
|
|
@@ -127,6 +152,7 @@ private:
|
|
|
127
152
|
|
|
128
153
|
// The current position in the input string.
|
|
129
154
|
const char* fCurPos;
|
|
155
|
+
const char* fEndPos;
|
|
130
156
|
|
|
131
157
|
using INHERITED = SkNoncopyable;
|
|
132
158
|
};
|
|
@@ -19,6 +19,7 @@ class SkCanvas;
|
|
|
19
19
|
class SkDOM;
|
|
20
20
|
class SkStream;
|
|
21
21
|
class SkSVGNode;
|
|
22
|
+
struct SkSVGPresentationContext;
|
|
22
23
|
class SkSVGSVG;
|
|
23
24
|
|
|
24
25
|
class SkSVGDOM : public SkRefCnt {
|
|
@@ -81,6 +82,9 @@ public:
|
|
|
81
82
|
|
|
82
83
|
void render(SkCanvas*) const;
|
|
83
84
|
|
|
85
|
+
/** Render the node with the given id as if it were the only child of the root. */
|
|
86
|
+
void renderNode(SkCanvas*, SkSVGPresentationContext&, const char* id) const;
|
|
87
|
+
|
|
84
88
|
private:
|
|
85
89
|
SkSVGDOM(sk_sp<SkSVGSVG>, sk_sp<SkFontMgr>, sk_sp<skresources::ResourceProvider>,
|
|
86
90
|
SkSVGIDMapper&&);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Google Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
5
|
+
* found in the LICENSE file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef SkSVGOpenTypeSVGDecoder_DEFINED
|
|
9
|
+
#define SkSVGOpenTypeSVGDecoder_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkColor.h"
|
|
12
|
+
#include "include/core/SkOpenTypeSVGDecoder.h"
|
|
13
|
+
#include "include/core/SkSpan.h"
|
|
14
|
+
#include "include/core/SkTypes.h"
|
|
15
|
+
|
|
16
|
+
class SkCanvas;
|
|
17
|
+
class SkSVGDOM;
|
|
18
|
+
|
|
19
|
+
class SkSVGOpenTypeSVGDecoder : public SkOpenTypeSVGDecoder {
|
|
20
|
+
public:
|
|
21
|
+
static std::unique_ptr<SkOpenTypeSVGDecoder> Make(const uint8_t* svg, size_t svgLength);
|
|
22
|
+
size_t approximateSize() override;
|
|
23
|
+
bool render(SkCanvas&, int upem, SkGlyphID glyphId,
|
|
24
|
+
SkColor foregroundColor, SkSpan<SkColor> palette) override;
|
|
25
|
+
~SkSVGOpenTypeSVGDecoder() override;
|
|
26
|
+
private:
|
|
27
|
+
SkSVGOpenTypeSVGDecoder(sk_sp<SkSVGDOM> skSvg, size_t approximateSize);
|
|
28
|
+
sk_sp<SkSVGDOM> fSkSvg;
|
|
29
|
+
size_t fApproximateSize;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
#endif // SkSVGOpenTypeSVGDecoder_DEFINED
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
#include "include/core/SkRect.h"
|
|
16
16
|
#include "include/core/SkSize.h"
|
|
17
17
|
#include "include/core/SkTypes.h"
|
|
18
|
+
#include "include/private/SkTHash.h"
|
|
18
19
|
#include "modules/skresources/include/SkResources.h"
|
|
19
20
|
#include "modules/svg/include/SkSVGAttribute.h"
|
|
20
21
|
#include "modules/svg/include/SkSVGIDMapper.h"
|
|
@@ -51,6 +52,8 @@ struct SkSVGPresentationContext {
|
|
|
51
52
|
SkSVGPresentationContext(const SkSVGPresentationContext&) = default;
|
|
52
53
|
SkSVGPresentationContext& operator=(const SkSVGPresentationContext&) = default;
|
|
53
54
|
|
|
55
|
+
const SkTHashMap<SkString, SkSVGColorType>* fNamedColors = nullptr;
|
|
56
|
+
|
|
54
57
|
// Inherited presentation attributes, computed for the current node.
|
|
55
58
|
SkSVGPresentationAttributes fInherited;
|
|
56
59
|
};
|
|
@@ -97,9 +100,6 @@ public:
|
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
|
|
100
|
-
// Required until C++17 copy elision
|
|
101
|
-
BorrowedNode(BorrowedNode&&) = default;
|
|
102
|
-
|
|
103
103
|
~BorrowedNode() {
|
|
104
104
|
if (fOwner) {
|
|
105
105
|
*fOwner = std::move(fBorrowed);
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
#include "include/core/SkPath.h"
|
|
14
14
|
#include "include/core/SkPoint.h"
|
|
15
15
|
#include "include/core/SkRect.h"
|
|
16
|
+
#include "include/core/SkRefCnt.h"
|
|
16
17
|
#include "include/core/SkScalar.h"
|
|
18
|
+
#include "include/core/SkSpan.h"
|
|
17
19
|
#include "include/core/SkString.h"
|
|
18
20
|
#include "include/core/SkTypes.h"
|
|
19
21
|
#include "include/private/SkTDArray.h"
|
|
@@ -81,13 +83,25 @@ public:
|
|
|
81
83
|
fValue.set(std::move(value));
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
T* operator->()
|
|
86
|
+
T* operator->() {
|
|
85
87
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
|
86
88
|
SkASSERT(fValue.isValid());
|
|
87
89
|
return fValue.get();
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
T
|
|
92
|
+
const T* operator->() const {
|
|
93
|
+
SkASSERT(fState == SkSVGPropertyState::kValue);
|
|
94
|
+
SkASSERT(fValue.isValid());
|
|
95
|
+
return fValue.get();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
T& operator*() {
|
|
99
|
+
SkASSERT(fState == SkSVGPropertyState::kValue);
|
|
100
|
+
SkASSERT(fValue.isValid());
|
|
101
|
+
return *fValue;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const T& operator*() const {
|
|
91
105
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
|
92
106
|
SkASSERT(fValue.isValid());
|
|
93
107
|
return *fValue;
|
|
@@ -166,21 +180,44 @@ public:
|
|
|
166
180
|
kColor,
|
|
167
181
|
kICCColor,
|
|
168
182
|
};
|
|
183
|
+
using Vars = SkSTArray<1, SkString>;
|
|
184
|
+
|
|
185
|
+
SkSVGColor() : SkSVGColor(SK_ColorBLACK) {}
|
|
186
|
+
explicit SkSVGColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c), fVars(nullptr) {}
|
|
187
|
+
explicit SkSVGColor(Type t, Vars&& vars)
|
|
188
|
+
: fType(t), fColor(SK_ColorBLACK)
|
|
189
|
+
, fVars(vars.empty() ? nullptr : new RefCntVars(std::move(vars))) {}
|
|
190
|
+
explicit SkSVGColor(const SkSVGColorType& c, Vars&& vars)
|
|
191
|
+
: fType(Type::kColor), fColor(c)
|
|
192
|
+
, fVars(vars.empty() ? nullptr : new RefCntVars(std::move(vars))) {}
|
|
193
|
+
|
|
194
|
+
SkSVGColor(const SkSVGColor&) = default;
|
|
195
|
+
SkSVGColor& operator=(const SkSVGColor&) = default;
|
|
196
|
+
SkSVGColor(SkSVGColor&&) = default;
|
|
197
|
+
SkSVGColor& operator=(SkSVGColor&&) = default;
|
|
169
198
|
|
|
170
|
-
SkSVGColor() : fType(Type::kColor), fColor(SK_ColorBLACK) {}
|
|
171
|
-
explicit SkSVGColor(Type t) : fType(t), fColor(SK_ColorBLACK) {}
|
|
172
|
-
explicit SkSVGColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c) {}
|
|
173
199
|
bool operator==(const SkSVGColor& other) const {
|
|
174
|
-
return fType == other.fType && fColor == other.fColor;
|
|
200
|
+
return fType == other.fType && fColor == other.fColor && fVars == other.fVars;
|
|
175
201
|
}
|
|
176
202
|
bool operator!=(const SkSVGColor& other) const { return !(*this == other); }
|
|
177
203
|
|
|
178
204
|
Type type() const { return fType; }
|
|
179
205
|
const SkSVGColorType& color() const { SkASSERT(fType == Type::kColor); return fColor; }
|
|
206
|
+
SkSpan<const SkString> vars() const {
|
|
207
|
+
return fVars ? SkMakeSpan<const Vars>(fVars->fData) : SkSpan<const SkString>{nullptr, 0};
|
|
208
|
+
}
|
|
209
|
+
SkSpan< SkString> vars() {
|
|
210
|
+
return fVars ? SkMakeSpan< Vars>(fVars->fData) : SkSpan< SkString>{nullptr, 0};
|
|
211
|
+
}
|
|
180
212
|
|
|
181
213
|
private:
|
|
182
214
|
Type fType;
|
|
183
215
|
SkSVGColorType fColor;
|
|
216
|
+
struct RefCntVars : public SkNVRefCnt<RefCntVars> {
|
|
217
|
+
RefCntVars(Vars&& vars) : fData(std::move(vars)) {}
|
|
218
|
+
Vars fData;
|
|
219
|
+
};
|
|
220
|
+
sk_sp<RefCntVars> fVars;
|
|
184
221
|
};
|
|
185
222
|
|
|
186
223
|
class SkSVGPaint {
|
|
@@ -193,12 +230,14 @@ public:
|
|
|
193
230
|
|
|
194
231
|
SkSVGPaint() : fType(Type::kNone), fColor(SK_ColorBLACK) {}
|
|
195
232
|
explicit SkSVGPaint(Type t) : fType(t), fColor(SK_ColorBLACK) {}
|
|
196
|
-
explicit SkSVGPaint(
|
|
197
|
-
SkSVGPaint(const SkSVGIRI& iri,
|
|
198
|
-
: fType(Type::kIRI), fColor(fallback_color), fIRI(iri) {}
|
|
233
|
+
explicit SkSVGPaint(SkSVGColor c) : fType(Type::kColor), fColor(std::move(c)) {}
|
|
234
|
+
SkSVGPaint(const SkSVGIRI& iri, SkSVGColor fallback_color)
|
|
235
|
+
: fType(Type::kIRI), fColor(std::move(fallback_color)), fIRI(iri) {}
|
|
199
236
|
|
|
200
237
|
SkSVGPaint(const SkSVGPaint&) = default;
|
|
201
238
|
SkSVGPaint& operator=(const SkSVGPaint&) = default;
|
|
239
|
+
SkSVGPaint(SkSVGPaint&&) = default;
|
|
240
|
+
SkSVGPaint& operator=(SkSVGPaint&&) = default;
|
|
202
241
|
|
|
203
242
|
bool operator==(const SkSVGPaint& other) const {
|
|
204
243
|
return fType == other.fType && fColor == other.fColor && fIRI == other.fIRI;
|
|
@@ -33,7 +33,6 @@ const onDeclare = (0, _Declaration.createDeclaration)((_ref, children) => {
|
|
|
33
33
|
let {
|
|
34
34
|
uniforms,
|
|
35
35
|
source,
|
|
36
|
-
opaque,
|
|
37
36
|
...transform
|
|
38
37
|
} = _ref;
|
|
39
38
|
const processedUniforms = new Array(source.getUniformCount()).fill(0).flatMap((_, i) => {
|
|
@@ -64,7 +63,7 @@ const onDeclare = (0, _Declaration.createDeclaration)((_ref, children) => {
|
|
|
64
63
|
console.warn("Unused uniforms were provided: " + unusedUniform.join(", "));
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
return source.makeShaderWithChildren(processedUniforms,
|
|
66
|
+
return source.makeShaderWithChildren(processedUniforms, children.filter(_skia.isShader), (0, _processors.localMatrix)(transform));
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
const Shader = props => {
|