@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
|
@@ -19,10 +19,7 @@
|
|
|
19
19
|
#include <string.h>
|
|
20
20
|
#include <atomic>
|
|
21
21
|
#include <string>
|
|
22
|
-
|
|
23
|
-
namespace skstd {
|
|
24
|
-
class string_view;
|
|
25
|
-
}
|
|
22
|
+
#include <string_view>
|
|
26
23
|
|
|
27
24
|
/* Some helper functions for C strings */
|
|
28
25
|
static inline bool SkStrStartsWith(const char string[], const char prefixStr[]) {
|
|
@@ -126,7 +123,7 @@ public:
|
|
|
126
123
|
SkString(const SkString&);
|
|
127
124
|
SkString(SkString&&);
|
|
128
125
|
explicit SkString(const std::string&);
|
|
129
|
-
explicit SkString(
|
|
126
|
+
explicit SkString(std::string_view);
|
|
130
127
|
~SkString();
|
|
131
128
|
|
|
132
129
|
bool isEmpty() const { return 0 == fRec->fLength; }
|
|
@@ -220,11 +217,11 @@ public:
|
|
|
220
217
|
void prependScalar(SkScalar value) { this->insertScalar((size_t)-1, value); }
|
|
221
218
|
|
|
222
219
|
void printf(const char format[], ...) SK_PRINTF_LIKE(2, 3);
|
|
223
|
-
void printVAList(const char format[], va_list);
|
|
220
|
+
void printVAList(const char format[], va_list) SK_PRINTF_LIKE(2, 0);
|
|
224
221
|
void appendf(const char format[], ...) SK_PRINTF_LIKE(2, 3);
|
|
225
|
-
void appendVAList(const char format[], va_list);
|
|
222
|
+
void appendVAList(const char format[], va_list) SK_PRINTF_LIKE(2, 0);
|
|
226
223
|
void prependf(const char format[], ...) SK_PRINTF_LIKE(2, 3);
|
|
227
|
-
void prependVAList(const char format[], va_list);
|
|
224
|
+
void prependVAList(const char format[], va_list) SK_PRINTF_LIKE(2, 0);
|
|
228
225
|
|
|
229
226
|
void remove(size_t offset, size_t length);
|
|
230
227
|
|
|
@@ -38,6 +38,8 @@ class GrRecordingContext;
|
|
|
38
38
|
class GrRenderTarget;
|
|
39
39
|
enum GrSurfaceOrigin: int;
|
|
40
40
|
|
|
41
|
+
namespace skgpu::graphite { class Recorder; }
|
|
42
|
+
|
|
41
43
|
/** \class SkSurface
|
|
42
44
|
SkSurface is responsible for managing the pixels that a canvas draws into. The pixels can be
|
|
43
45
|
allocated either in CPU memory (a raster surface) or on the GPU (a GrRenderTarget surface).
|
|
@@ -517,6 +519,12 @@ public:
|
|
|
517
519
|
*/
|
|
518
520
|
GrRecordingContext* recordingContext();
|
|
519
521
|
|
|
522
|
+
/** Returns the recorder being used by the SkSurface.
|
|
523
|
+
|
|
524
|
+
@return the recorder, if available; nullptr otherwise
|
|
525
|
+
*/
|
|
526
|
+
skgpu::graphite::Recorder* recorder();
|
|
527
|
+
|
|
520
528
|
#if SK_SUPPORT_GPU
|
|
521
529
|
enum BackendHandleAccess {
|
|
522
530
|
kFlushRead_BackendHandleAccess, //!< back-end object is readable
|
|
@@ -910,6 +918,19 @@ public:
|
|
|
910
918
|
};
|
|
911
919
|
|
|
912
920
|
#if SK_SUPPORT_GPU
|
|
921
|
+
/** If a surface is GPU texture backed, is being drawn with MSAA, and there is a resolve
|
|
922
|
+
texture, this call will insert a resolve command into the stream of gpu commands. In order
|
|
923
|
+
for the resolve to actually have an effect, the work still needs to be flushed and submitted
|
|
924
|
+
to the GPU after recording the resolve command. If a resolve is not supported or the
|
|
925
|
+
SkSurface has no dirty work to resolve, then this call is a no-op.
|
|
926
|
+
|
|
927
|
+
This call is most useful when the SkSurface is created by wrapping a single sampled gpu
|
|
928
|
+
texture, but asking Skia to render with MSAA. If the client wants to use the wrapped texture
|
|
929
|
+
outside of Skia, the only way to trigger a resolve is either to call this command or use
|
|
930
|
+
SkSurface::flush.
|
|
931
|
+
*/
|
|
932
|
+
void resolveMSAA();
|
|
933
|
+
|
|
913
934
|
/** Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface
|
|
914
935
|
MSAA. A call to GrDirectContext::submit is always required to ensure work is actually sent
|
|
915
936
|
to the gpu. Some specific API details:
|
|
@@ -29,7 +29,12 @@ struct SkAdvancedTypefaceMetrics;
|
|
|
29
29
|
struct SkScalerContextEffects;
|
|
30
30
|
struct SkScalerContextRec;
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
using SkTypefaceID = uint32_t;
|
|
33
|
+
|
|
34
|
+
// SkFontID is deprecated, please use SkTypefaceID.
|
|
35
|
+
using SkFontID = SkTypefaceID;
|
|
36
|
+
|
|
37
|
+
|
|
33
38
|
/** Machine endian. */
|
|
34
39
|
typedef uint32_t SkFontTableTag;
|
|
35
40
|
|
|
@@ -91,13 +96,13 @@ public:
|
|
|
91
96
|
/** Return a 32bit value for this typeface, unique for the underlying font
|
|
92
97
|
data. Will never return 0.
|
|
93
98
|
*/
|
|
94
|
-
|
|
99
|
+
SkTypefaceID uniqueID() const { return fUniqueID; }
|
|
95
100
|
|
|
96
101
|
/** Return the uniqueID for the specified typeface. If the face is null,
|
|
97
102
|
resolve it to the default font and return its uniqueID. Will never
|
|
98
103
|
return 0.
|
|
99
104
|
*/
|
|
100
|
-
static
|
|
105
|
+
static SkTypefaceID UniqueID(const SkTypeface* face);
|
|
101
106
|
|
|
102
107
|
/** Returns true if the two typefaces reference the same underlying font,
|
|
103
108
|
handling either being null (treating null as the default font)
|
|
@@ -319,6 +324,15 @@ public:
|
|
|
319
324
|
*/
|
|
320
325
|
std::unique_ptr<SkStreamAsset> openStream(int* ttcIndex) const;
|
|
321
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Return a stream for the contents of the font data.
|
|
329
|
+
* Returns nullptr on failure or if the font data isn't already available in stream form.
|
|
330
|
+
* Use when the stream can be used opportunistically but the calling code would prefer
|
|
331
|
+
* to fall back to table access if creating the stream would be expensive.
|
|
332
|
+
* Otherwise acts the same as openStream.
|
|
333
|
+
*/
|
|
334
|
+
std::unique_ptr<SkStreamAsset> openExistingStream(int* ttcIndex) const;
|
|
335
|
+
|
|
322
336
|
/**
|
|
323
337
|
* Return a scalercontext for the given descriptor. It may return a
|
|
324
338
|
* stub scalercontext that will not crash, but will draw nothing.
|
|
@@ -377,6 +391,8 @@ protected:
|
|
|
377
391
|
|
|
378
392
|
virtual std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const = 0;
|
|
379
393
|
|
|
394
|
+
virtual std::unique_ptr<SkStreamAsset> onOpenExistingStream(int* ttcIndex) const;
|
|
395
|
+
|
|
380
396
|
virtual bool onGlyphMaskNeedsCurrentColor() const = 0;
|
|
381
397
|
|
|
382
398
|
virtual int onGetVariationDesignPosition(
|
|
@@ -443,7 +459,7 @@ private:
|
|
|
443
459
|
friend class SkFont; // getGlyphToUnicodeMap
|
|
444
460
|
|
|
445
461
|
private:
|
|
446
|
-
|
|
462
|
+
SkTypefaceID fUniqueID;
|
|
447
463
|
SkFontStyle fStyle;
|
|
448
464
|
mutable SkRect fBounds;
|
|
449
465
|
mutable SkOnce fBoundsOnce;
|
|
@@ -263,8 +263,10 @@
|
|
|
263
263
|
|
|
264
264
|
#if defined(SK_BUILD_FOR_GOOGLE3)
|
|
265
265
|
void SkDebugfForDumpStackTrace(const char* data, void* unused);
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
namespace base {
|
|
267
|
+
void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg);
|
|
268
|
+
}
|
|
269
|
+
# define SK_DUMP_GOOGLE3_STACK() ::base::DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr)
|
|
268
270
|
#else
|
|
269
271
|
# define SK_DUMP_GOOGLE3_STACK()
|
|
270
272
|
#endif
|
|
@@ -392,8 +394,10 @@
|
|
|
392
394
|
# define GR_TEST_UTILS 0
|
|
393
395
|
#endif
|
|
394
396
|
|
|
395
|
-
#
|
|
396
|
-
#
|
|
397
|
+
#if !SK_SUPPORT_GPU
|
|
398
|
+
#define SK_GPU_V1 0 // always false if Ganesh is disabled
|
|
399
|
+
#elif !defined(SK_GPU_V1)
|
|
400
|
+
# define SK_GPU_V1 1 // otherwise default to v1 enabled
|
|
397
401
|
#endif
|
|
398
402
|
|
|
399
403
|
#if defined(SK_HISTOGRAM_ENUMERATION) || \
|
|
@@ -500,7 +504,7 @@ typedef unsigned U16CPU;
|
|
|
500
504
|
/** @return false or true based on the condition
|
|
501
505
|
*/
|
|
502
506
|
template <typename T> static constexpr bool SkToBool(const T& x) {
|
|
503
|
-
return
|
|
507
|
+
return (bool)x;
|
|
504
508
|
}
|
|
505
509
|
|
|
506
510
|
static constexpr int16_t SK_MaxS16 = INT16_MAX;
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
#ifndef SkGradientShader_DEFINED
|
|
9
9
|
#define SkGradientShader_DEFINED
|
|
10
10
|
|
|
11
|
+
#include "include/core/SkRefCnt.h"
|
|
11
12
|
#include "include/core/SkShader.h"
|
|
13
|
+
#include "include/core/SkTileMode.h"
|
|
14
|
+
|
|
15
|
+
class SkColorSpace;
|
|
12
16
|
|
|
13
17
|
/** \class SkGradientShader
|
|
14
18
|
|
|
@@ -100,9 +104,7 @@ public:
|
|
|
100
104
|
uint32_t flags, const SkMatrix* localMatrix);
|
|
101
105
|
static sk_sp<SkShader> MakeLinear(const SkPoint pts[2],
|
|
102
106
|
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
|
|
103
|
-
const SkScalar pos[], int count, SkTileMode mode)
|
|
104
|
-
return MakeLinear(pts, colors, std::move(colorSpace), pos, count, mode, 0, nullptr);
|
|
105
|
-
}
|
|
107
|
+
const SkScalar pos[], int count, SkTileMode mode);
|
|
106
108
|
|
|
107
109
|
/** Returns a shader that generates a radial gradient given the center and radius.
|
|
108
110
|
<p />
|
|
@@ -146,10 +148,7 @@ public:
|
|
|
146
148
|
uint32_t flags, const SkMatrix* localMatrix);
|
|
147
149
|
static sk_sp<SkShader> MakeRadial(const SkPoint& center, SkScalar radius,
|
|
148
150
|
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
|
|
149
|
-
const SkScalar pos[], int count, SkTileMode mode)
|
|
150
|
-
return MakeRadial(center, radius, colors, std::move(colorSpace), pos, count, mode,
|
|
151
|
-
0, nullptr);
|
|
152
|
-
}
|
|
151
|
+
const SkScalar pos[], int count, SkTileMode mode);
|
|
153
152
|
|
|
154
153
|
/**
|
|
155
154
|
* Returns a shader that generates a conical gradient given two circles, or
|
|
@@ -186,10 +185,7 @@ public:
|
|
|
186
185
|
const SkPoint& end, SkScalar endRadius,
|
|
187
186
|
const SkColor4f colors[],
|
|
188
187
|
sk_sp<SkColorSpace> colorSpace, const SkScalar pos[],
|
|
189
|
-
int count, SkTileMode mode)
|
|
190
|
-
return MakeTwoPointConical(start, startRadius, end, endRadius, colors,
|
|
191
|
-
std::move(colorSpace), pos, count, mode, 0, nullptr);
|
|
192
|
-
}
|
|
188
|
+
int count, SkTileMode mode);
|
|
193
189
|
|
|
194
190
|
/** Returns a shader that generates a sweep gradient given a center.
|
|
195
191
|
<p />
|
|
@@ -248,15 +244,10 @@ public:
|
|
|
248
244
|
static sk_sp<SkShader> MakeSweep(SkScalar cx, SkScalar cy,
|
|
249
245
|
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
|
|
250
246
|
const SkScalar pos[], int count,
|
|
251
|
-
uint32_t flags, const SkMatrix* localMatrix)
|
|
252
|
-
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count,
|
|
253
|
-
SkTileMode::kClamp, 0, 360, flags, localMatrix);
|
|
254
|
-
}
|
|
247
|
+
uint32_t flags, const SkMatrix* localMatrix);
|
|
255
248
|
static sk_sp<SkShader> MakeSweep(SkScalar cx, SkScalar cy,
|
|
256
249
|
const SkColor4f colors[], sk_sp<SkColorSpace> colorSpace,
|
|
257
|
-
const SkScalar pos[], int count)
|
|
258
|
-
return MakeSweep(cx, cy, colors, std::move(colorSpace), pos, count, 0, nullptr);
|
|
259
|
-
}
|
|
250
|
+
const SkScalar pos[], int count);
|
|
260
251
|
|
|
261
252
|
static void RegisterFlattenables();
|
|
262
253
|
};
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
#include "include/core/SkString.h"
|
|
19
19
|
#include "include/private/SkOnce.h"
|
|
20
20
|
#include "include/private/SkSLSampleUsage.h"
|
|
21
|
-
#include "include/private/SkTOptional.h"
|
|
22
21
|
|
|
23
22
|
#include <string>
|
|
23
|
+
#include <optional>
|
|
24
24
|
#include <vector>
|
|
25
25
|
|
|
26
26
|
#ifdef SK_ENABLE_SKSL
|
|
@@ -103,9 +103,10 @@ public:
|
|
|
103
103
|
|
|
104
104
|
class Options {
|
|
105
105
|
public:
|
|
106
|
-
// For testing purposes,
|
|
107
|
-
// run the inliner directly, but they still get an inlining pass once they are
|
|
108
|
-
|
|
106
|
+
// For testing purposes, disables optimization and inlining. (Normally, Runtime Effects
|
|
107
|
+
// don't run the inliner directly, but they still get an inlining pass once they are
|
|
108
|
+
// painted.)
|
|
109
|
+
bool forceUnoptimized = false;
|
|
109
110
|
|
|
110
111
|
private:
|
|
111
112
|
friend class SkRuntimeEffect;
|
|
@@ -120,7 +121,7 @@ public:
|
|
|
120
121
|
// Similarly: Public SkSL does not allow access to sk_FragCoord. The semantics of that
|
|
121
122
|
// variable are confusing, and expose clients to implementation details of saveLayer and
|
|
122
123
|
// image filters.
|
|
123
|
-
bool
|
|
124
|
+
bool usePrivateRTShaderModule = false;
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
// If the effect is compiled successfully, `effect` will be non-null.
|
|
@@ -184,7 +185,10 @@ public:
|
|
|
184
185
|
ChildPtr(sk_sp<SkColorFilter> cf) : fChild(std::move(cf)) {}
|
|
185
186
|
ChildPtr(sk_sp<SkBlender> b) : fChild(std::move(b)) {}
|
|
186
187
|
|
|
187
|
-
|
|
188
|
+
// Asserts that the flattenable is either null, or one of the legal derived types
|
|
189
|
+
ChildPtr(sk_sp<SkFlattenable> f);
|
|
190
|
+
|
|
191
|
+
std::optional<ChildType> type() const;
|
|
188
192
|
|
|
189
193
|
SkShader* shader() const;
|
|
190
194
|
SkColorFilter* colorFilter() const;
|
|
@@ -198,12 +202,10 @@ public:
|
|
|
198
202
|
sk_sp<SkShader> makeShader(sk_sp<SkData> uniforms,
|
|
199
203
|
sk_sp<SkShader> children[],
|
|
200
204
|
size_t childCount,
|
|
201
|
-
const SkMatrix* localMatrix
|
|
202
|
-
bool isOpaque) const;
|
|
205
|
+
const SkMatrix* localMatrix = nullptr) const;
|
|
203
206
|
sk_sp<SkShader> makeShader(sk_sp<SkData> uniforms,
|
|
204
207
|
SkSpan<ChildPtr> children,
|
|
205
|
-
const SkMatrix* localMatrix
|
|
206
|
-
bool isOpaque) const;
|
|
208
|
+
const SkMatrix* localMatrix = nullptr) const;
|
|
207
209
|
|
|
208
210
|
sk_sp<SkImage> makeImage(GrRecordingContext*,
|
|
209
211
|
sk_sp<SkData> uniforms,
|
|
@@ -266,6 +268,7 @@ private:
|
|
|
266
268
|
kAllowBlender_Flag = 0x08,
|
|
267
269
|
kSamplesOutsideMain_Flag = 0x10,
|
|
268
270
|
kUsesColorTransform_Flag = 0x20,
|
|
271
|
+
kAlwaysOpaque_Flag = 0x40,
|
|
269
272
|
};
|
|
270
273
|
|
|
271
274
|
SkRuntimeEffect(std::unique_ptr<SkSL::Program> baseProgram,
|
|
@@ -293,7 +296,7 @@ private:
|
|
|
293
296
|
const Options& options,
|
|
294
297
|
SkSL::ProgramKind kind);
|
|
295
298
|
|
|
296
|
-
static SkSL::ProgramSettings MakeSettings(const Options& options
|
|
299
|
+
static SkSL::ProgramSettings MakeSettings(const Options& options);
|
|
297
300
|
|
|
298
301
|
uint32_t hash() const { return fHash; }
|
|
299
302
|
bool usesSampleCoords() const { return (fFlags & kUsesSampleCoords_Flag); }
|
|
@@ -302,6 +305,7 @@ private:
|
|
|
302
305
|
bool allowBlender() const { return (fFlags & kAllowBlender_Flag); }
|
|
303
306
|
bool samplesOutsideMain() const { return (fFlags & kSamplesOutsideMain_Flag); }
|
|
304
307
|
bool usesColorTransform() const { return (fFlags & kUsesColorTransform_Flag); }
|
|
308
|
+
bool alwaysOpaque() const { return (fFlags & kAlwaysOpaque_Flag); }
|
|
305
309
|
|
|
306
310
|
const SkFilterColorProgram* getFilterColorProgram();
|
|
307
311
|
|
|
@@ -481,7 +485,7 @@ public:
|
|
|
481
485
|
SkRuntimeShaderBuilder(const SkRuntimeShaderBuilder&) = default;
|
|
482
486
|
~SkRuntimeShaderBuilder();
|
|
483
487
|
|
|
484
|
-
sk_sp<SkShader> makeShader(const SkMatrix* localMatrix
|
|
488
|
+
sk_sp<SkShader> makeShader(const SkMatrix* localMatrix = nullptr);
|
|
485
489
|
sk_sp<SkImage> makeImage(GrRecordingContext*,
|
|
486
490
|
const SkMatrix* localMatrix,
|
|
487
491
|
SkImageInfo resultInfo,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 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 skgpu_GpuTypes_DEFINED
|
|
9
|
+
#define skgpu_GpuTypes_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkTypes.h"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This file includes numerous public types that are used by all of our gpu backends.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
namespace skgpu {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Value passed into various callbacks to tell the client the result of operations connected to a
|
|
21
|
+
* specific callback. The actual interpretation of kFailed and kSuccess are dependent on the
|
|
22
|
+
* specific callbacks and are documented with the callback itself.
|
|
23
|
+
*/
|
|
24
|
+
enum class CallbackResult : bool {
|
|
25
|
+
kFailed = true,
|
|
26
|
+
kSuccess = true,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
} // namespace skgpu
|
|
31
|
+
|
|
32
|
+
#endif // skgpu_GpuTypes_DEFINED
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
#include "include/gpu/GrTypes.h"
|
|
14
14
|
#ifdef SK_GL
|
|
15
15
|
#include "include/gpu/gl/GrGLTypes.h"
|
|
16
|
-
#include "include/private/GrGLTypesPriv.h"
|
|
16
|
+
#include "include/private/gpu/ganesh/GrGLTypesPriv.h"
|
|
17
17
|
#endif
|
|
18
18
|
#include "include/gpu/mock/GrMockTypes.h"
|
|
19
19
|
#ifdef SK_VULKAN
|
|
20
20
|
#include "include/gpu/vk/GrVkTypes.h"
|
|
21
|
-
#include "include/private/GrVkTypesPriv.h"
|
|
21
|
+
#include "include/private/gpu/ganesh/GrVkTypesPriv.h"
|
|
22
22
|
#endif
|
|
23
23
|
|
|
24
24
|
#ifdef SK_DAWN
|
|
@@ -31,7 +31,7 @@ class GrGLTextureParameters;
|
|
|
31
31
|
class GrColorFormatDesc;
|
|
32
32
|
|
|
33
33
|
#ifdef SK_DAWN
|
|
34
|
-
#include "
|
|
34
|
+
#include "webgpu/webgpu_cpp.h"
|
|
35
35
|
#endif
|
|
36
36
|
|
|
37
37
|
#ifdef SK_METAL
|
|
@@ -39,7 +39,7 @@ class GrColorFormatDesc;
|
|
|
39
39
|
#endif
|
|
40
40
|
|
|
41
41
|
#ifdef SK_DIRECT3D
|
|
42
|
-
#include "include/private/GrD3DTypesMinimal.h"
|
|
42
|
+
#include "include/private/gpu/ganesh/GrD3DTypesMinimal.h"
|
|
43
43
|
class GrD3DResourceState;
|
|
44
44
|
#endif
|
|
45
45
|
|
|
@@ -137,6 +137,8 @@ public:
|
|
|
137
137
|
* GrGLFormat::kUnknown.
|
|
138
138
|
*/
|
|
139
139
|
GrGLFormat asGLFormat() const;
|
|
140
|
+
|
|
141
|
+
GrGLenum asGLFormatEnum() const;
|
|
140
142
|
#endif
|
|
141
143
|
|
|
142
144
|
#ifdef SK_VULKAN
|
|
@@ -640,4 +642,3 @@ private:
|
|
|
640
642
|
#endif
|
|
641
643
|
|
|
642
644
|
#endif
|
|
643
|
-
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#include "include/gpu/GrDriverBugWorkarounds.h"
|
|
15
15
|
#include "include/gpu/GrTypes.h"
|
|
16
16
|
#include "include/gpu/ShaderErrorHandler.h"
|
|
17
|
-
#include "include/private/GrTypesPriv.h"
|
|
17
|
+
#include "include/private/gpu/ganesh/GrTypesPriv.h"
|
|
18
18
|
|
|
19
19
|
#include <vector>
|
|
20
20
|
|
|
@@ -169,13 +169,6 @@ struct SK_API GrContextOptions {
|
|
|
169
169
|
*/
|
|
170
170
|
bool fAvoidStencilBuffers = false;
|
|
171
171
|
|
|
172
|
-
/**
|
|
173
|
-
* If true, texture fetches from mip-mapped textures will be biased to read larger MIP levels.
|
|
174
|
-
* This has the effect of sharpening those textures, at the cost of some aliasing, and possible
|
|
175
|
-
* performance impact.
|
|
176
|
-
*/
|
|
177
|
-
bool fSharpenMipmappedTextures = false;
|
|
178
|
-
|
|
179
172
|
/**
|
|
180
173
|
* Enables driver workaround to use draws instead of HW clears, e.g. glClear on the GL backend.
|
|
181
174
|
*/
|
|
@@ -253,6 +246,7 @@ struct SK_API GrContextOptions {
|
|
|
253
246
|
|
|
254
247
|
/**
|
|
255
248
|
* If true, and if supported, enables hardware tessellation in the caps.
|
|
249
|
+
* DEPRECATED: This value is ignored; experimental hardware tessellation is always disabled.
|
|
256
250
|
*/
|
|
257
251
|
bool fEnableExperimentalHardwareTessellation = false;
|
|
258
252
|
|
|
@@ -260,7 +254,9 @@ struct SK_API GrContextOptions {
|
|
|
260
254
|
* If true, then add 1 pixel padding to all glyph masks in the atlas to support bi-lerp
|
|
261
255
|
* rendering of all glyphs. This must be set to true to use GrSlug.
|
|
262
256
|
*/
|
|
263
|
-
#if defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG)
|
|
257
|
+
#if defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG) || \
|
|
258
|
+
defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_SERIALIZE) || \
|
|
259
|
+
defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_STRIKE_SERIALIZE)
|
|
264
260
|
bool fSupportBilerpFromGlyphAtlas = true;
|
|
265
261
|
#else
|
|
266
262
|
bool fSupportBilerpFromGlyphAtlas = false;
|
|
@@ -282,6 +278,12 @@ struct SK_API GrContextOptions {
|
|
|
282
278
|
* Private options that are only meant for testing within Skia's tools.
|
|
283
279
|
*/
|
|
284
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Testing-only mode to exercise allocation failures in the flush-time callback objects.
|
|
283
|
+
* For now it only simulates allocation failure during the preFlush callback.
|
|
284
|
+
*/
|
|
285
|
+
bool fFailFlushTimeCallbacks = false;
|
|
286
|
+
|
|
285
287
|
/**
|
|
286
288
|
* Prevents use of dual source blending, to test that all xfer modes work correctly without it.
|
|
287
289
|
*/
|
|
@@ -298,12 +300,6 @@ struct SK_API GrContextOptions {
|
|
|
298
300
|
*/
|
|
299
301
|
bool fSuppressFramebufferFetch = false;
|
|
300
302
|
|
|
301
|
-
/**
|
|
302
|
-
* If greater than zero and less than the actual hardware limit, overrides the maximum number of
|
|
303
|
-
* tessellation segments supported by the caps.
|
|
304
|
-
*/
|
|
305
|
-
int fMaxTessellationSegmentsOverride = 0;
|
|
306
|
-
|
|
307
303
|
/**
|
|
308
304
|
* If true, then all paths are processed as if "setIsVolatile" had been called.
|
|
309
305
|
*/
|
|
@@ -342,11 +338,6 @@ struct SK_API GrContextOptions {
|
|
|
342
338
|
*/
|
|
343
339
|
int fResourceCacheLimitOverride = -1;
|
|
344
340
|
|
|
345
|
-
/**
|
|
346
|
-
* If true, then always try to use hardware tessellation, regardless of how small a path may be.
|
|
347
|
-
*/
|
|
348
|
-
bool fAlwaysPreferHardwareTessellation = false;
|
|
349
|
-
|
|
350
341
|
/**
|
|
351
342
|
* Maximum width and height of internal texture atlases.
|
|
352
343
|
*/
|
|
@@ -114,6 +114,13 @@ public:
|
|
|
114
114
|
*/
|
|
115
115
|
GrBackendFormat compressedBackendFormat(SkImage::CompressionType c) const;
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Gets the maximum supported sample count for a color type. 1 is returned if only non-MSAA
|
|
119
|
+
* rendering is supported for the color type. 0 is returned if rendering to this color type
|
|
120
|
+
* is not supported at all.
|
|
121
|
+
*/
|
|
122
|
+
int maxSurfaceSampleCountForColorType(SkColorType colorType) const;
|
|
123
|
+
|
|
117
124
|
bool isValid() const { return nullptr != fCaps; }
|
|
118
125
|
|
|
119
126
|
bool operator==(const GrContextThreadSafeProxy& that) const {
|
|
@@ -29,9 +29,7 @@ struct GrMockOptions;
|
|
|
29
29
|
class GrPath;
|
|
30
30
|
class GrResourceCache;
|
|
31
31
|
class GrResourceProvider;
|
|
32
|
-
class GrStrikeCache;
|
|
33
32
|
class GrSurfaceProxy;
|
|
34
|
-
class GrSwizzle;
|
|
35
33
|
class GrTextureProxy;
|
|
36
34
|
struct GrVkBackendContext;
|
|
37
35
|
|
|
@@ -42,7 +40,14 @@ class SkSurfaceProps;
|
|
|
42
40
|
class SkTaskGroup;
|
|
43
41
|
class SkTraceMemoryDump;
|
|
44
42
|
|
|
45
|
-
namespace skgpu {
|
|
43
|
+
namespace skgpu {
|
|
44
|
+
class Swizzle;
|
|
45
|
+
namespace v1 { class SmallPathAtlasMgr; }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
namespace sktext::gpu {
|
|
49
|
+
class StrikeCache;
|
|
50
|
+
}
|
|
46
51
|
|
|
47
52
|
class SK_API GrDirectContext : public GrRecordingContext {
|
|
48
53
|
public:
|
|
@@ -508,7 +513,7 @@ public:
|
|
|
508
513
|
* pixmap(s). Compatible, in this case, means that the backend format will be the result
|
|
509
514
|
* of calling defaultBackendFormat on the base pixmap's colortype. The src data can be deleted
|
|
510
515
|
* when this call returns.
|
|
511
|
-
* If numLevels is 1 a non-
|
|
516
|
+
* If numLevels is 1 a non-mipmapped texture will result. If a mipmapped texture is desired
|
|
512
517
|
* the data for all the mipmap levels must be provided. In the mipmapped case all the
|
|
513
518
|
* colortypes of the provided pixmaps must be the same. Additionally, all the miplevels
|
|
514
519
|
* must be sized correctly (please see SkMipmap::ComputeLevelSize and ComputeLevelCount). The
|
|
@@ -692,7 +697,7 @@ public:
|
|
|
692
697
|
* finishedProc to be notified when the data has been uploaded by the gpu and the texture can be
|
|
693
698
|
* deleted. The client is required to call `submit` to send the upload work to the gpu.
|
|
694
699
|
* The finishedProc will always get called even if we failed to create the GrBackendTexture
|
|
695
|
-
* If numLevels is 1 a non-
|
|
700
|
+
* If numLevels is 1 a non-mipmapped texture will result. If a mipmapped texture is desired
|
|
696
701
|
* the data for all the mipmap levels must be provided. Additionally, all the miplevels
|
|
697
702
|
* must be sized correctly (please see SkMipmap::ComputeLevelSize and ComputeLevelCount).
|
|
698
703
|
* For the Vulkan backend the layout of the created VkImage will be:
|
|
@@ -735,7 +740,7 @@ public:
|
|
|
735
740
|
* finishedProc to be notified when the data has been uploaded by the gpu and the texture can be
|
|
736
741
|
* deleted. The client is required to call `submit` to send the upload work to the gpu.
|
|
737
742
|
* The finishedProc will always get called even if we failed to create the GrBackendTexture.
|
|
738
|
-
* If a
|
|
743
|
+
* If a mipmapped texture is passed in, the data for all the mipmap levels must be provided.
|
|
739
744
|
* Additionally, all the miplevels must be sized correctly (please see
|
|
740
745
|
* SkMipMap::ComputeLevelSize and ComputeLevelCount).
|
|
741
746
|
* For the Vulkan backend after a successful update the layout of the created VkImage will be:
|
|
@@ -854,11 +859,11 @@ private:
|
|
|
854
859
|
// after all of its users. Clients of fTaskGroup will generally want to ensure that they call
|
|
855
860
|
// wait() on it as they are being destroyed, to avoid the possibility of pending tasks being
|
|
856
861
|
// invoked after objects they depend upon have already been destroyed.
|
|
857
|
-
std::unique_ptr<SkTaskGroup>
|
|
858
|
-
std::unique_ptr<
|
|
859
|
-
sk_sp<GrGpu>
|
|
860
|
-
std::unique_ptr<GrResourceCache>
|
|
861
|
-
std::unique_ptr<GrResourceProvider>
|
|
862
|
+
std::unique_ptr<SkTaskGroup> fTaskGroup;
|
|
863
|
+
std::unique_ptr<sktext::gpu::StrikeCache> fStrikeCache;
|
|
864
|
+
sk_sp<GrGpu> fGpu;
|
|
865
|
+
std::unique_ptr<GrResourceCache> fResourceCache;
|
|
866
|
+
std::unique_ptr<GrResourceProvider> fResourceProvider;
|
|
862
867
|
|
|
863
868
|
bool fDidTestPMConversions;
|
|
864
869
|
// true if the PM/UPM conversion succeeded; false otherwise
|
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
max_fragment_uniform_vectors_32) \
|
|
31
31
|
GPU_OP(MAX_MSAA_SAMPLE_COUNT_4, \
|
|
32
32
|
max_msaa_sample_count_4) \
|
|
33
|
-
GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \
|
|
34
|
-
max_texture_size_limit_4096) \
|
|
35
33
|
GPU_OP(PACK_PARAMETERS_WORKAROUND_WITH_PACK_BUFFER, \
|
|
36
34
|
pack_parameters_workaround_with_pack_buffer) \
|
|
37
35
|
GPU_OP(REMOVE_POW_WITH_CONSTANT_EXPONENT, \
|