@shopify/react-native-skia 1.11.9-next.1 → 1.11.10
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/CMakeLists.txt +153 -30
- package/android/build.gradle +1 -1
- package/cpp/skia/include/codec/SkCodec.h +2 -7
- package/cpp/skia/include/config/SkUserConfig.h +0 -11
- package/cpp/skia/include/core/SkCanvas.h +7 -11
- package/cpp/skia/include/core/SkColor.h +0 -10
- package/cpp/skia/include/core/SkColorSpace.h +2 -184
- package/cpp/skia/include/core/SkColorType.h +32 -114
- package/cpp/skia/include/core/SkFontScanner.h +8 -5
- package/cpp/skia/include/core/SkFontStyle.h +1 -1
- package/cpp/skia/include/core/SkMaskFilter.h +8 -0
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPath.h +1 -1
- package/cpp/skia/include/core/SkRRect.h +1 -3
- package/cpp/skia/include/core/SkShader.h +3 -3
- package/cpp/skia/include/core/SkString.h +8 -8
- package/cpp/skia/include/core/SkSurface.h +0 -14
- package/cpp/skia/include/core/SkTypeface.h +7 -24
- package/cpp/skia/include/effects/SkGradientShader.h +1 -6
- package/cpp/skia/include/effects/SkRuntimeEffect.h +0 -1
- package/cpp/skia/include/encode/SkPngEncoder.h +0 -14
- package/cpp/skia/include/gpu/GpuTypes.h +0 -9
- package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +133 -135
- package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +0 -5
- package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +3 -3
- package/cpp/skia/include/gpu/ganesh/GrTypes.h +9 -14
- package/cpp/skia/include/gpu/graphite/Context.h +2 -25
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +5 -23
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +1 -20
- package/cpp/skia/include/gpu/graphite/Image.h +0 -1
- package/cpp/skia/include/gpu/graphite/Recorder.h +0 -6
- package/cpp/skia/include/gpu/graphite/Recording.h +1 -3
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +36 -4
- package/cpp/skia/include/gpu/graphite/precompile/Precompile.h +2 -3
- package/cpp/skia/include/pathops/SkPathOps.h +1 -9
- package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +0 -3
- package/cpp/skia/include/private/SkPathRef.h +21 -15
- package/cpp/skia/include/private/base/SkAttributes.h +10 -16
- package/cpp/skia/include/private/base/SkMutex.h +0 -8
- package/cpp/skia/include/private/base/SkTArray.h +1 -1
- package/cpp/skia/include/private/base/SkTDArray.h +1 -1
- package/cpp/skia/include/private/base/SkTemplates.h +11 -24
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
- package/cpp/skia/include/sksl/SkSLDebugTrace.h +3 -0
- package/cpp/skia/modules/skcms/src/Transform_inl.h +20 -20
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +3 -4
- package/cpp/skia/modules/skcms/src/skcms_public.h +15 -19
- package/cpp/skia/modules/skresources/include/SkResources.h +1 -3
- package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +0 -2
- package/cpp/skia/modules/svg/include/SkSVGShape.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +0 -4
- package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
- package/cpp/skia/src/core/SkLRUCache.h +13 -19
- package/cpp/skia/src/core/SkTHash.h +4 -50
- package/cpp/skia/src/gpu/ganesh/gl/GrGLDefines.h +0 -1
- package/lib/commonjs/external/reanimated/textures.js +3 -4
- package/lib/commonjs/external/reanimated/textures.js.map +1 -1
- package/lib/commonjs/headless/index.d.ts +1 -1
- package/lib/commonjs/headless/index.js +2 -2
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +2 -2
- package/lib/commonjs/renderer/Canvas.js +28 -11
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +2 -2
- package/lib/commonjs/renderer/Offscreen.js +4 -4
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -5
- package/lib/commonjs/sksg/Container.d.ts +1 -3
- package/lib/commonjs/sksg/Container.js +1 -7
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig.d.ts +1 -1
- package/lib/commonjs/sksg/HostConfig.js +6 -36
- package/lib/commonjs/sksg/HostConfig.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig2.d.ts +19 -0
- package/lib/commonjs/sksg/HostConfig2.js +159 -0
- package/lib/commonjs/sksg/HostConfig2.js.map +1 -0
- package/lib/commonjs/sksg/Reconciler.d.ts +2 -3
- package/lib/commonjs/sksg/Reconciler.js +6 -16
- package/lib/commonjs/sksg/Reconciler.js.map +1 -1
- package/lib/module/Platform/Platform.web.js +1 -1
- package/lib/module/Platform/Platform.web.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +2 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +3 -3
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +5 -3
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/external/reanimated/buffers.js +2 -1
- package/lib/module/external/reanimated/buffers.js.map +1 -1
- package/lib/module/external/reanimated/textures.js +4 -5
- package/lib/module/external/reanimated/textures.js.map +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/external/reanimated/useVideo.js +23 -10
- package/lib/module/external/reanimated/useVideo.js.map +1 -1
- package/lib/module/headless/index.d.ts +1 -1
- package/lib/module/headless/index.js +2 -2
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +2 -2
- package/lib/module/renderer/Canvas.js +28 -10
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +2 -2
- package/lib/module/renderer/Offscreen.js +4 -4
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/__tests__/setup.d.ts +5 -5
- package/lib/module/skia/core/Vector.js +1 -1
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +4 -1
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +1 -1
- package/lib/module/skia/web/Host.js +7 -1
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkAnimatedImage.js +6 -3
- package/lib/module/skia/web/JsiSkAnimatedImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +6 -3
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.js +6 -3
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js +6 -3
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -3
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.js +6 -3
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +6 -3
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +12 -8
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.js +6 -3
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.js +6 -3
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +8 -5
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +6 -3
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilder.js +3 -2
- package/lib/module/skia/web/JsiSkParagraphBuilder.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphStyle.js +15 -15
- package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +6 -3
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.js +6 -3
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +6 -3
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -3
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js +6 -3
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js +6 -3
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js +6 -3
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js +6 -3
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -3
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkSVG.js +8 -5
- package/lib/module/skia/web/JsiSkSVG.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.js +6 -3
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js +6 -3
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js +6 -3
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js +6 -3
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +4 -1
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.js +6 -3
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/skia/web/JsiVideo.js +5 -2
- package/lib/module/skia/web/JsiVideo.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +1 -3
- package/lib/module/sksg/Container.js +8 -11
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/HostConfig.d.ts +1 -1
- package/lib/module/sksg/HostConfig.js +7 -36
- package/lib/module/sksg/HostConfig.js.map +1 -1
- package/lib/module/sksg/HostConfig2.d.ts +19 -0
- package/lib/module/sksg/HostConfig2.js +152 -0
- package/lib/module/sksg/HostConfig2.js.map +1 -0
- package/lib/module/sksg/Reconciler.d.ts +2 -3
- package/lib/module/sksg/Reconciler.js +11 -16
- package/lib/module/sksg/Reconciler.js.map +1 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js +5 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.js +6 -3
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Visitor.js +1 -1
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.js +4 -2
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Shaders.js +3 -2
- package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +12 -9
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +5 -1
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.js +4 -1
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js +2 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +1 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/typescript/lib/commonjs/headless/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +1 -9
- package/lib/typescript/lib/commonjs/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +0 -3
- package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +4 -21
- package/lib/typescript/lib/commonjs/sksg/HostConfig2.d.ts +44 -0
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +2 -9
- package/lib/typescript/lib/module/headless/index.d.ts +1 -1
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +1 -9
- package/lib/typescript/lib/module/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/JsiSkAnimatedImage.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkCanvas.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkColorFilter.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkContourMeasure.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkData.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkImage.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkImageFilter.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkMaskFilter.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkMatrix.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPathEffect.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPicture.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPictureRecorder.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPoint.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkRRect.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkRSXform.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkRect.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkSVG.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkShader.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkSurface.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkTextBlob.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkTypeface.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkVertices.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +2 -2
- package/lib/typescript/lib/module/sksg/Container.d.ts +12 -7
- package/lib/typescript/lib/module/sksg/HostConfig.d.ts +4 -20
- package/lib/typescript/lib/module/sksg/HostConfig2.d.ts +43 -0
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +17 -18
- package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +2 -5
- package/lib/typescript/lib/module/views/SkiaBaseWebView.d.ts +11 -12
- package/lib/typescript/lib/module/views/SkiaPictureView.d.ts +2 -2
- package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +1 -1
- package/lib/typescript/src/headless/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +2 -2
- package/lib/typescript/src/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -5
- package/lib/typescript/src/sksg/Container.d.ts +1 -3
- package/lib/typescript/src/sksg/HostConfig.d.ts +1 -1
- package/lib/typescript/src/sksg/HostConfig2.d.ts +19 -0
- package/lib/typescript/src/sksg/Reconciler.d.ts +2 -3
- package/package.json +9 -10
- package/src/external/reanimated/textures.tsx +4 -5
- package/src/headless/index.ts +2 -2
- package/src/renderer/Canvas.tsx +81 -57
- package/src/renderer/Offscreen.tsx +4 -4
- package/src/renderer/__tests__/Data.spec.tsx +10 -9
- package/src/renderer/__tests__/Drawings.spec.tsx +11 -11
- package/src/renderer/__tests__/FitBox.spec.tsx +10 -10
- package/src/renderer/__tests__/Glyphs.spec.tsx +2 -2
- package/src/renderer/__tests__/Image.spec.tsx +2 -2
- package/src/renderer/__tests__/Paths.spec.tsx +8 -8
- package/src/renderer/__tests__/Picture.spec.tsx +12 -10
- package/src/renderer/__tests__/Simple.spec.tsx +6 -6
- package/src/renderer/__tests__/Surfaces.spec.tsx +2 -2
- package/src/renderer/__tests__/Text.spec.tsx +12 -12
- package/src/renderer/__tests__/Transform.spec.tsx +8 -8
- package/src/renderer/__tests__/documentation/Group.spec.tsx +12 -12
- package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx +2 -2
- package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx +8 -8
- package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +4 -4
- package/src/renderer/__tests__/e2e/Atlas.spec.tsx +3 -3
- package/src/renderer/__tests__/e2e/Offscreen.spec.tsx +1 -1
- package/src/renderer/__tests__/examples/BlendModes.spec.tsx +4 -4
- package/src/renderer/__tests__/setup.tsx +13 -13
- package/src/sksg/Container.ts +1 -9
- package/src/sksg/HostConfig.ts +7 -37
- package/src/sksg/HostConfig2.ts +247 -0
- package/src/sksg/Reconciler.ts +6 -17
- package/src/sksg/__tests__/Simple.spec.tsx +8 -8
- package/cpp/skia/include/gpu/graphite/LogPriority.h +0 -36
- package/cpp/skia/include/gpu/graphite/PrecompileContext.h +0 -52
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +0 -48
@@ -75,55 +75,8 @@ struct SK_API GrContextOptions {
|
|
75
75
|
|
76
76
|
GrContextOptions() {}
|
77
77
|
|
78
|
-
|
79
|
-
|
80
|
-
* for the preferredLargeHeapBlockSize. If the value is not set, then Skia will use an
|
81
|
-
* inernally defined default size.
|
82
|
-
*
|
83
|
-
* However, it is highly discouraged to have Skia make a default allocator (and support for
|
84
|
-
* doing so will be removed soon, b/321962001). Instead clients should create their own
|
85
|
-
* allocator to pass into Skia where they can fine tune this value themeselves.
|
86
|
-
*/
|
87
|
-
std::optional<uint64_t> fVulkanVMALargeHeapBlockSize;
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Optional callback that can be passed into the GrDirectContext which will be called when the
|
91
|
-
* GrDirectContext is about to be destroyed. When this call is made, it will be safe for the
|
92
|
-
* client to delete the GPU backend context that is backing the GrDirectContext. The
|
93
|
-
* GrDirectContextDestroyedContext will be passed back to the client in the callback.
|
94
|
-
*/
|
95
|
-
GrDirectContextDestroyedContext fContextDeleteContext = nullptr;
|
96
|
-
GrDirectContextDestroyedProc fContextDeleteProc = nullptr;
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Executor to handle threaded work within Ganesh. If this is nullptr, then all work will be
|
100
|
-
* done serially on the main thread. To have worker threads assist with various tasks, set this
|
101
|
-
* to a valid SkExecutor instance. Currently, used for software path rendering, but may be used
|
102
|
-
* for other tasks.
|
103
|
-
*/
|
104
|
-
SkExecutor* fExecutor = nullptr;
|
105
|
-
|
106
|
-
/**
|
107
|
-
* Cache in which to store compiled shader binaries between runs.
|
108
|
-
*/
|
109
|
-
PersistentCache* fPersistentCache = nullptr;
|
110
|
-
|
111
|
-
/**
|
112
|
-
* If present, use this object to report shader compilation failures. If not, report failures
|
113
|
-
* via SkDebugf and assert.
|
114
|
-
*/
|
115
|
-
ShaderErrorHandler* fShaderErrorHandler = nullptr;
|
116
|
-
|
117
|
-
/** Default minimum size to use when allocating buffers for uploading data to textures. The
|
118
|
-
larger the value the more uploads can be packed into one buffer, but at the cost of
|
119
|
-
more gpu memory allocated that may not be used. Uploads larger than the minimum will still
|
120
|
-
work by allocating a dedicated buffer. */
|
121
|
-
size_t fMinimumStagingBufferSize = 64 * 1024;
|
122
|
-
|
123
|
-
/**
|
124
|
-
* The maximum size of cache textures used for Skia's Glyph cache.
|
125
|
-
*/
|
126
|
-
size_t fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4;
|
78
|
+
// Suppress prints for the GrContext.
|
79
|
+
bool fSuppressPrints = false;
|
127
80
|
|
128
81
|
/**
|
129
82
|
* Controls whether we check for GL errors after functions that allocate resources (e.g.
|
@@ -133,33 +86,6 @@ struct SK_API GrContextOptions {
|
|
133
86
|
*/
|
134
87
|
Enable fSkipGLErrorChecks = Enable::kDefault;
|
135
88
|
|
136
|
-
/**
|
137
|
-
* Can the glyph atlas use multiple textures. If allowed, the each texture's size is bound by
|
138
|
-
* fGlypheCacheTextureMaximumBytes.
|
139
|
-
*/
|
140
|
-
Enable fAllowMultipleGlyphCacheTextures = Enable::kDefault;
|
141
|
-
|
142
|
-
/**
|
143
|
-
* Enables driver workaround to use draws instead of HW clears, e.g. glClear on the GL backend.
|
144
|
-
*/
|
145
|
-
Enable fUseDrawInsteadOfClear = Enable::kDefault;
|
146
|
-
|
147
|
-
/**
|
148
|
-
* Allow Ganesh to more aggressively reorder operations to reduce the number of render passes.
|
149
|
-
* Offscreen draws will be done upfront instead of interrupting the main render pass when
|
150
|
-
* possible. May increase VRAM usage, but still observes the resource cache limit.
|
151
|
-
* Enabled by default.
|
152
|
-
*/
|
153
|
-
Enable fReduceOpsTaskSplitting = Enable::kDefault;
|
154
|
-
|
155
|
-
/**
|
156
|
-
* This affects the usage of the PersistentCache. We can cache SkSL, backend source (GLSL), or
|
157
|
-
* backend binaries (GL program binaries). By default we cache binaries, but if the driver's
|
158
|
-
* binary loading/storing is believed to have bugs, this can be limited to caching GLSL.
|
159
|
-
* Caching GLSL strings still saves CPU work when a GL program is created.
|
160
|
-
*/
|
161
|
-
ShaderCacheStrategy fShaderCacheStrategy = ShaderCacheStrategy::kBackendBinary;
|
162
|
-
|
163
89
|
/** Overrides: These options override feature detection using backend API queries. These
|
164
90
|
overrides can only reduce the feature set or limits, never increase them beyond the
|
165
91
|
detected values. */
|
@@ -171,48 +97,19 @@ struct SK_API GrContextOptions {
|
|
171
97
|
deduce the optimal value for this platform. */
|
172
98
|
int fBufferMapThreshold = -1;
|
173
99
|
|
174
|
-
/**
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Specifies the number of samples Ganesh should use when performing internal draws with MSAA
|
181
|
-
* (hardware capabilities permitting).
|
182
|
-
*
|
183
|
-
* If 0, Ganesh will disable internal code paths that use multisampling.
|
184
|
-
*/
|
185
|
-
int fInternalMultisampleCount = 4;
|
186
|
-
|
187
|
-
/**
|
188
|
-
* In Skia's vulkan backend a single GrContext submit equates to the submission of a single
|
189
|
-
* primary command buffer to the VkQueue. This value specifies how many vulkan secondary command
|
190
|
-
* buffers we will cache for reuse on a given primary command buffer. A single submit may use
|
191
|
-
* more than this many secondary command buffers, but after the primary command buffer is
|
192
|
-
* finished on the GPU it will only hold on to this many secondary command buffers for reuse.
|
193
|
-
*
|
194
|
-
* A value of -1 means we will pick a limit value internally.
|
195
|
-
*/
|
196
|
-
int fMaxCachedVulkanSecondaryCommandBuffers = -1;
|
197
|
-
|
198
|
-
/**
|
199
|
-
* Below this threshold size in device space distance field fonts won't be used. Distance field
|
200
|
-
* fonts don't support hinting which is more important at smaller sizes.
|
201
|
-
*/
|
202
|
-
float fMinDistanceFieldFontSize = 18;
|
100
|
+
/** Default minimum size to use when allocating buffers for uploading data to textures. The
|
101
|
+
larger the value the more uploads can be packed into one buffer, but at the cost of
|
102
|
+
more gpu memory allocated that may not be used. Uploads larger than the minimum will still
|
103
|
+
work by allocating a dedicated buffer. */
|
104
|
+
size_t fMinimumStagingBufferSize = 64 * 1024;
|
203
105
|
|
204
106
|
/**
|
205
|
-
*
|
107
|
+
* Executor to handle threaded work within Ganesh. If this is nullptr, then all work will be
|
108
|
+
* done serially on the main thread. To have worker threads assist with various tasks, set this
|
109
|
+
* to a valid SkExecutor instance. Currently, used for software path rendering, but may be used
|
110
|
+
* for other tasks.
|
206
111
|
*/
|
207
|
-
|
208
|
-
float fGlyphsAsPathsFontSize = 384;
|
209
|
-
#elif defined(SK_BUILD_FOR_MAC)
|
210
|
-
float fGlyphsAsPathsFontSize = 256;
|
211
|
-
#else
|
212
|
-
float fGlyphsAsPathsFontSize = 324;
|
213
|
-
#endif
|
214
|
-
|
215
|
-
GrDriverBugWorkarounds fDriverBugWorkarounds;
|
112
|
+
SkExecutor* fExecutor = nullptr;
|
216
113
|
|
217
114
|
/** Construct mipmaps manually, via repeated downsampling draw-calls. This is used when
|
218
115
|
the driver's implementation (glGenerateMipmap) contains bugs. This requires mipmap
|
@@ -245,6 +142,34 @@ struct SK_API GrContextOptions {
|
|
245
142
|
*/
|
246
143
|
bool fDisableGpuYUVConversion = false;
|
247
144
|
|
145
|
+
/**
|
146
|
+
* The maximum size of cache textures used for Skia's Glyph cache.
|
147
|
+
*/
|
148
|
+
size_t fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4;
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Below this threshold size in device space distance field fonts won't be used. Distance field
|
152
|
+
* fonts don't support hinting which is more important at smaller sizes.
|
153
|
+
*/
|
154
|
+
float fMinDistanceFieldFontSize = 18;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Above this threshold size in device space glyphs are drawn as individual paths.
|
158
|
+
*/
|
159
|
+
#if defined(SK_BUILD_FOR_ANDROID)
|
160
|
+
float fGlyphsAsPathsFontSize = 384;
|
161
|
+
#elif defined(SK_BUILD_FOR_MAC)
|
162
|
+
float fGlyphsAsPathsFontSize = 256;
|
163
|
+
#else
|
164
|
+
float fGlyphsAsPathsFontSize = 324;
|
165
|
+
#endif
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Can the glyph atlas use multiple textures. If allowed, the each texture's size is bound by
|
169
|
+
* fGlypheCacheTextureMaximumBytes.
|
170
|
+
*/
|
171
|
+
Enable fAllowMultipleGlyphCacheTextures = Enable::kDefault;
|
172
|
+
|
248
173
|
/**
|
249
174
|
* Bugs on certain drivers cause stencil buffers to leak. This flag causes Skia to avoid
|
250
175
|
* allocating stencil buffers and use alternate rasterization paths, avoiding the leak.
|
@@ -258,6 +183,19 @@ struct SK_API GrContextOptions {
|
|
258
183
|
*/
|
259
184
|
bool fSharpenMipmappedTextures = true;
|
260
185
|
|
186
|
+
/**
|
187
|
+
* Enables driver workaround to use draws instead of HW clears, e.g. glClear on the GL backend.
|
188
|
+
*/
|
189
|
+
Enable fUseDrawInsteadOfClear = Enable::kDefault;
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Allow Ganesh to more aggressively reorder operations to reduce the number of render passes.
|
193
|
+
* Offscreen draws will be done upfront instead of interrupting the main render pass when
|
194
|
+
* possible. May increase VRAM usage, but still observes the resource cache limit.
|
195
|
+
* Enabled by default.
|
196
|
+
*/
|
197
|
+
Enable fReduceOpsTaskSplitting = Enable::kDefault;
|
198
|
+
|
261
199
|
/**
|
262
200
|
* Some ES3 contexts report the ES2 external image extension, but not the ES3 version.
|
263
201
|
* If support for external images is critical, enabling this option will cause Ganesh to limit
|
@@ -272,6 +210,60 @@ struct SK_API GrContextOptions {
|
|
272
210
|
*/
|
273
211
|
bool fDisableDriverCorrectnessWorkarounds = false;
|
274
212
|
|
213
|
+
/**
|
214
|
+
* Maximum number of GPU programs or pipelines to keep active in the runtime cache.
|
215
|
+
*/
|
216
|
+
int fRuntimeProgramCacheSize = 256;
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Cache in which to store compiled shader binaries between runs.
|
220
|
+
*/
|
221
|
+
PersistentCache* fPersistentCache = nullptr;
|
222
|
+
|
223
|
+
/**
|
224
|
+
* This affects the usage of the PersistentCache. We can cache SkSL, backend source (GLSL), or
|
225
|
+
* backend binaries (GL program binaries). By default we cache binaries, but if the driver's
|
226
|
+
* binary loading/storing is believed to have bugs, this can be limited to caching GLSL.
|
227
|
+
* Caching GLSL strings still saves CPU work when a GL program is created.
|
228
|
+
*/
|
229
|
+
ShaderCacheStrategy fShaderCacheStrategy = ShaderCacheStrategy::kBackendBinary;
|
230
|
+
|
231
|
+
/**
|
232
|
+
* If present, use this object to report shader compilation failures. If not, report failures
|
233
|
+
* via SkDebugf and assert.
|
234
|
+
*/
|
235
|
+
ShaderErrorHandler* fShaderErrorHandler = nullptr;
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Specifies the number of samples Ganesh should use when performing internal draws with MSAA
|
239
|
+
* (hardware capabilities permitting).
|
240
|
+
*
|
241
|
+
* If 0, Ganesh will disable internal code paths that use multisampling.
|
242
|
+
*/
|
243
|
+
int fInternalMultisampleCount = 4;
|
244
|
+
|
245
|
+
/**
|
246
|
+
* In Skia's vulkan backend a single GrContext submit equates to the submission of a single
|
247
|
+
* primary command buffer to the VkQueue. This value specifies how many vulkan secondary command
|
248
|
+
* buffers we will cache for reuse on a given primary command buffer. A single submit may use
|
249
|
+
* more than this many secondary command buffers, but after the primary command buffer is
|
250
|
+
* finished on the GPU it will only hold on to this many secondary command buffers for reuse.
|
251
|
+
*
|
252
|
+
* A value of -1 means we will pick a limit value internally.
|
253
|
+
*/
|
254
|
+
int fMaxCachedVulkanSecondaryCommandBuffers = -1;
|
255
|
+
|
256
|
+
/**
|
257
|
+
* If Skia is creating a default VMA allocator for the Vulkan backend this value will be used
|
258
|
+
* for the preferredLargeHeapBlockSize. If the value is not set, then Skia will use an
|
259
|
+
* inernally defined default size.
|
260
|
+
*
|
261
|
+
* However, it is highly discouraged to have Skia make a default allocator (and support for
|
262
|
+
* doing so will be removed soon, b/321962001). Instead clients should create their own
|
263
|
+
* allocator to pass into Skia where they can fine tune this value themeselves.
|
264
|
+
*/
|
265
|
+
std::optional<uint64_t> fVulkanVMALargeHeapBlockSize;
|
266
|
+
|
275
267
|
/**
|
276
268
|
* If true, the caps will never support mipmaps.
|
277
269
|
*/
|
@@ -315,31 +307,19 @@ struct SK_API GrContextOptions {
|
|
315
307
|
*/
|
316
308
|
bool fAlwaysUseTexStorageWhenAvailable = false;
|
317
309
|
|
318
|
-
// Suppress prints for the GrContext.
|
319
|
-
bool fSuppressPrints = false;
|
320
|
-
|
321
|
-
#if defined(GPU_TEST_UTILS)
|
322
|
-
/**
|
323
|
-
* Private options that are only meant for testing within Skia's tools.
|
324
|
-
*/
|
325
|
-
|
326
|
-
/**
|
327
|
-
* Include or exclude specific GPU path renderers.
|
328
|
-
*/
|
329
|
-
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
|
330
|
-
|
331
310
|
/**
|
332
|
-
*
|
333
|
-
*
|
334
|
-
*
|
335
|
-
*
|
311
|
+
* Optional callback that can be passed into the GrDirectContext which will be called when the
|
312
|
+
* GrDirectContext is about to be destroyed. When this call is made, it will be safe for the
|
313
|
+
* client to delete the GPU backend context that is backing the GrDirectContext. The
|
314
|
+
* GrDirectContextDestroyedContext will be passed back to the client in the callback.
|
336
315
|
*/
|
337
|
-
|
316
|
+
GrDirectContextDestroyedContext fContextDeleteContext = nullptr;
|
317
|
+
GrDirectContextDestroyedProc fContextDeleteProc = nullptr;
|
338
318
|
|
319
|
+
#if defined(GPU_TEST_UTILS)
|
339
320
|
/**
|
340
|
-
*
|
321
|
+
* Private options that are only meant for testing within Skia's tools.
|
341
322
|
*/
|
342
|
-
int fMaxTextureAtlasSize = 2048;
|
343
323
|
|
344
324
|
/**
|
345
325
|
* Testing-only mode to exercise allocation failures in the flush-time callback objects.
|
@@ -388,8 +368,26 @@ struct SK_API GrContextOptions {
|
|
388
368
|
*/
|
389
369
|
bool fDisallowWriteAndTransferPixelRowBytes = false;
|
390
370
|
|
371
|
+
/**
|
372
|
+
* Include or exclude specific GPU path renderers.
|
373
|
+
*/
|
374
|
+
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
|
375
|
+
|
376
|
+
/**
|
377
|
+
* Specify the GPU resource cache limit. Equivalent to calling `setResourceCacheLimit` on the
|
378
|
+
* context at construction time.
|
379
|
+
*
|
380
|
+
* A value of -1 means use the default limit value.
|
381
|
+
*/
|
382
|
+
int fResourceCacheLimitOverride = -1;
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Maximum width and height of internal texture atlases.
|
386
|
+
*/
|
387
|
+
int fMaxTextureAtlasSize = 2048;
|
391
388
|
#endif
|
392
389
|
|
390
|
+
GrDriverBugWorkarounds fDriverBugWorkarounds;
|
393
391
|
};
|
394
392
|
|
395
393
|
#endif
|
@@ -271,11 +271,6 @@ public:
|
|
271
271
|
*/
|
272
272
|
void purgeUnlockedResources(GrPurgeResourceOptions opts);
|
273
273
|
|
274
|
-
/*
|
275
|
-
* Gets the types of GPU stats supported by this Context.
|
276
|
-
*/
|
277
|
-
skgpu::GpuStatsFlags supportedGpuStats() const;
|
278
|
-
|
279
274
|
/**
|
280
275
|
* Gets the maximum supported texture size.
|
281
276
|
*/
|
@@ -34,10 +34,8 @@ enum GrDriverBugWorkaroundType {
|
|
34
34
|
|
35
35
|
class SK_API GrDriverBugWorkarounds {
|
36
36
|
public:
|
37
|
-
GrDriverBugWorkarounds()
|
37
|
+
GrDriverBugWorkarounds();
|
38
38
|
GrDriverBugWorkarounds(const GrDriverBugWorkarounds&) = default;
|
39
|
-
~GrDriverBugWorkarounds() = default;
|
40
|
-
|
41
39
|
explicit GrDriverBugWorkarounds(const std::vector<int32_t>& workarounds);
|
42
40
|
|
43
41
|
GrDriverBugWorkarounds& operator=(const GrDriverBugWorkarounds&) = default;
|
@@ -45,6 +43,8 @@ class SK_API GrDriverBugWorkarounds {
|
|
45
43
|
// Turn on any workarounds listed in |workarounds| (but don't turn any off).
|
46
44
|
void applyOverrides(const GrDriverBugWorkarounds& workarounds);
|
47
45
|
|
46
|
+
~GrDriverBugWorkarounds();
|
47
|
+
|
48
48
|
#define GPU_OP(type, name) bool name = false;
|
49
49
|
GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
|
50
50
|
#undef GPU_OP
|
@@ -9,13 +9,17 @@
|
|
9
9
|
#define GrTypes_DEFINED
|
10
10
|
|
11
11
|
#include "include/core/SkTypes.h"
|
12
|
-
#include "include/gpu/GpuTypes.h"
|
13
12
|
#include "include/private/base/SkTo.h" // IWYU pragma: keep
|
14
13
|
|
15
14
|
#include <cstddef>
|
16
15
|
#include <cstdint>
|
17
16
|
class GrBackendSemaphore;
|
18
17
|
|
18
|
+
namespace skgpu {
|
19
|
+
enum class Protected : bool;
|
20
|
+
enum class Renderable : bool;
|
21
|
+
}
|
22
|
+
|
19
23
|
///////////////////////////////////////////////////////////////////////////////
|
20
24
|
|
21
25
|
/**
|
@@ -106,8 +110,6 @@ static const uint32_t kAll_GrBackendState = 0xffffffff;
|
|
106
110
|
|
107
111
|
typedef void* GrGpuFinishedContext;
|
108
112
|
typedef void (*GrGpuFinishedProc)(GrGpuFinishedContext finishedContext);
|
109
|
-
typedef void (*GrGpuFinishedWithStatsProc)(GrGpuFinishedContext finishedContext,
|
110
|
-
const skgpu::GpuStats&);
|
111
113
|
|
112
114
|
typedef void* GrGpuSubmittedContext;
|
113
115
|
typedef void (*GrGpuSubmittedProc)(GrGpuSubmittedContext submittedContext, bool success);
|
@@ -129,15 +131,10 @@ typedef void (*GrDirectContextDestroyedProc)(GrDirectContextDestroyedContext des
|
|
129
131
|
* and returned in initialized GrBackendSemaphore objects. The GrBackendSemaphore objects
|
130
132
|
* themselves can be deleted as soon as this function returns.
|
131
133
|
*
|
132
|
-
* If a finishedProc
|
133
|
-
*
|
134
|
-
*
|
135
|
-
*
|
136
|
-
* preferred.
|
137
|
-
*
|
138
|
-
* When finishedWithStatsProc is called the GpuStats passed will contain valid values for stats
|
139
|
-
* by requested by gpuStatsFlags, assuming the stats are supported by the underlying backend GPU
|
140
|
-
* context and the GPU work completed successfully.
|
134
|
+
* If a finishedProc is provided, the finishedProc will be called when all work submitted to the gpu
|
135
|
+
* from this flush call and all previous flush calls has finished on the GPU. If the flush call
|
136
|
+
* fails due to an error and nothing ends up getting sent to the GPU, the finished proc is called
|
137
|
+
* immediately.
|
141
138
|
*
|
142
139
|
* If a submittedProc is provided, the submittedProc will be called when all work from this flush
|
143
140
|
* call is submitted to the GPU. If the flush call fails due to an error and nothing will get sent
|
@@ -151,10 +148,8 @@ typedef void (*GrDirectContextDestroyedProc)(GrDirectContextDestroyedContext des
|
|
151
148
|
*/
|
152
149
|
struct GrFlushInfo {
|
153
150
|
size_t fNumSemaphores = 0;
|
154
|
-
skgpu::GpuStatsFlags fGpuStatsFlags = skgpu::GpuStatsFlags::kNone;
|
155
151
|
GrBackendSemaphore* fSignalSemaphores = nullptr;
|
156
152
|
GrGpuFinishedProc fFinishedProc = nullptr;
|
157
|
-
GrGpuFinishedWithStatsProc fFinishedWithStatsProc = nullptr;
|
158
153
|
GrGpuFinishedContext fFinishedContext = nullptr;
|
159
154
|
GrGpuSubmittedProc fSubmittedProc = nullptr;
|
160
155
|
GrGpuSubmittedContext fSubmittedContext = nullptr;
|
@@ -16,10 +16,6 @@
|
|
16
16
|
#include "include/gpu/graphite/Recorder.h"
|
17
17
|
#include "include/private/base/SingleOwner.h"
|
18
18
|
|
19
|
-
#if defined(GPU_TEST_UTILS)
|
20
|
-
#include "include/private/base/SkMutex.h"
|
21
|
-
#endif
|
22
|
-
|
23
19
|
#include <chrono>
|
24
20
|
#include <functional>
|
25
21
|
#include <memory>
|
@@ -37,7 +33,7 @@ class Context;
|
|
37
33
|
class ContextPriv;
|
38
34
|
class GlobalCache;
|
39
35
|
class PaintOptions;
|
40
|
-
class
|
36
|
+
class PlotUploadTracker;
|
41
37
|
class QueueManager;
|
42
38
|
class Recording;
|
43
39
|
class ResourceProvider;
|
@@ -57,11 +53,6 @@ public:
|
|
57
53
|
|
58
54
|
std::unique_ptr<Recorder> makeRecorder(const RecorderOptions& = {});
|
59
55
|
|
60
|
-
/** Creates a helper object that can be moved to a different thread and used
|
61
|
-
* for precompilation.
|
62
|
-
*/
|
63
|
-
std::unique_ptr<PrecompileContext> makePrecompileContext();
|
64
|
-
|
65
56
|
bool insertRecording(const InsertRecordingInfo&);
|
66
57
|
bool submit(SyncToCpu = SyncToCpu::kNo);
|
67
58
|
|
@@ -227,12 +218,6 @@ public:
|
|
227
218
|
*/
|
228
219
|
size_t maxBudgetedBytes() const;
|
229
220
|
|
230
|
-
/**
|
231
|
-
* Sets the size of Context's gpu memory cache budget in bytes. If the new budget is lower than
|
232
|
-
* the current budget, the cache will try to free resources to get under the new budget.
|
233
|
-
*/
|
234
|
-
void setMaxBudgetedBytes(size_t bytes);
|
235
|
-
|
236
221
|
/**
|
237
222
|
* Enumerates all cached GPU resources owned by the Context and dumps their memory to
|
238
223
|
* traceMemoryDump.
|
@@ -255,11 +240,6 @@ public:
|
|
255
240
|
*/
|
256
241
|
bool supportsProtectedContent() const;
|
257
242
|
|
258
|
-
/*
|
259
|
-
* Gets the types of GPU stats supported by this Context.
|
260
|
-
*/
|
261
|
-
GpuStatsFlags supportedGpuStats() const;
|
262
|
-
|
263
243
|
// Provides access to functions that aren't part of the public API.
|
264
244
|
ContextPriv priv();
|
265
245
|
const ContextPriv priv() const; // NOLINT(readability-const-return-type)
|
@@ -363,14 +343,11 @@ private:
|
|
363
343
|
mutable SingleOwner fSingleOwner;
|
364
344
|
|
365
345
|
#if defined(GPU_TEST_UTILS)
|
366
|
-
void deregisterRecorder(const Recorder*) SK_EXCLUDES(fTestingLock);
|
367
|
-
|
368
346
|
// In test builds a Recorder may track the Context that was used to create it.
|
369
347
|
bool fStoreContextRefInRecorder = false;
|
370
348
|
// If this tracking is on, to allow the client to safely delete this Context or its Recorders
|
371
349
|
// in any order we must also track the Recorders created here.
|
372
|
-
|
373
|
-
std::vector<Recorder*> fTrackedRecorders SK_GUARDED_BY(fTestingLock);
|
350
|
+
std::vector<Recorder*> fTrackedRecorders;
|
374
351
|
#endif
|
375
352
|
|
376
353
|
// Needed for MessageBox handling
|
@@ -8,13 +8,11 @@
|
|
8
8
|
#ifndef skgpu_graphite_ContextOptions_DEFINED
|
9
9
|
#define skgpu_graphite_ContextOptions_DEFINED
|
10
10
|
|
11
|
-
#include "include/core/SkRefCnt.h"
|
12
11
|
#include "include/private/base/SkAPI.h"
|
13
12
|
#include "include/private/base/SkMath.h"
|
14
13
|
|
15
14
|
#include <optional>
|
16
15
|
|
17
|
-
class SkData;
|
18
16
|
namespace skgpu { class ShaderErrorHandler; }
|
19
17
|
|
20
18
|
namespace skgpu::graphite {
|
@@ -87,12 +85,12 @@ struct SK_API ContextOptions {
|
|
87
85
|
bool fSupportBilerpFromGlyphAtlas = false;
|
88
86
|
|
89
87
|
/**
|
90
|
-
*
|
91
|
-
*
|
92
|
-
*
|
93
|
-
*
|
88
|
+
* Disable caching of glyph uploads at the start of each Recording. These can add additional
|
89
|
+
* overhead and are only necessary if Recordings are replayed or played out of order.
|
90
|
+
*
|
91
|
+
* Deprecated, now only used to set requireOrderedRecordings Caps.
|
94
92
|
*/
|
95
|
-
bool
|
93
|
+
bool fDisableCachedGlyphUploads = false;
|
96
94
|
|
97
95
|
static constexpr size_t kDefaultContextBudget = 256 * (1 << 20);
|
98
96
|
/**
|
@@ -120,22 +118,6 @@ struct SK_API ContextOptions {
|
|
120
118
|
*/
|
121
119
|
std::optional<uint64_t> fVulkanVMALargeHeapBlockSize;
|
122
120
|
|
123
|
-
/** Client-provided context that is passed to client-provided PipelineCallback. */
|
124
|
-
using PipelineCallbackContext = void*;
|
125
|
-
/** Client-provided callback that is called whenever Graphite encounters a new Pipeline. */
|
126
|
-
using PipelineCallback = void (*)(PipelineCallbackContext context, sk_sp<SkData> pipelineData);
|
127
|
-
|
128
|
-
/**
|
129
|
-
* These two members allow a client to register a callback that will be invoked
|
130
|
-
* whenever Graphite encounters a new Pipeline. The callback will be passed an
|
131
|
-
* sk_sp<SkData> that a client can take ownership of and serialize. The SkData
|
132
|
-
* contains all the information Graphite requires to recreate the Pipeline at
|
133
|
-
* a later date. The SkData is versioned however, so must be regenerated and
|
134
|
-
* re-serialized when it becomes out of date.
|
135
|
-
*/
|
136
|
-
PipelineCallbackContext fPipelineCallbackContext = nullptr;
|
137
|
-
PipelineCallback fPipelineCallback = nullptr;
|
138
|
-
|
139
121
|
/**
|
140
122
|
* Private options that are only meant for testing within Skia's tools.
|
141
123
|
*/
|
@@ -30,23 +30,13 @@ class Task;
|
|
30
30
|
using GpuFinishedContext = void*;
|
31
31
|
using GpuFinishedProc = void (*)(GpuFinishedContext finishedContext, CallbackResult);
|
32
32
|
|
33
|
-
using GpuFinishedWithStatsProc = void (*)(GpuFinishedContext finishedContext,
|
34
|
-
CallbackResult,
|
35
|
-
const GpuStats&);
|
36
|
-
|
37
33
|
/**
|
38
34
|
* The fFinishedProc is called when the Recording has been submitted and finished on the GPU, or
|
39
35
|
* when there is a failure that caused it not to be submitted. The callback will always be called
|
40
36
|
* and the caller can use the callback to know it is safe to free any resources associated with
|
41
37
|
* the Recording that they may be holding onto. If the Recording is successfully submitted to the
|
42
38
|
* GPU the callback will be called with CallbackResult::kSuccess once the GPU has finished. All
|
43
|
-
* other cases where some failure
|
44
|
-
*
|
45
|
-
* Alternatively, the client can provide fFinishedProcWithStats. This provides additional
|
46
|
-
* information about execution of the recording on the GPU. Only the stats requested using
|
47
|
-
* fStatsFlags will be valid and only if CallbackResult is kSuccess. If both fFinishedProc
|
48
|
-
* and fFinishedProcWithStats are provided the latter is preferred and the former won't be
|
49
|
-
* called.
|
39
|
+
* other cases where some failure occured it will be called with CallbackResult::kFailed.
|
50
40
|
*
|
51
41
|
* The fTargetSurface, if provided, is used as a target for any draws recorded onto a deferred
|
52
42
|
* canvas returned from Recorder::makeDeferredCanvas. This target surface must be provided iff
|
@@ -84,10 +74,8 @@ struct InsertRecordingInfo {
|
|
84
74
|
size_t fNumSignalSemaphores = 0;
|
85
75
|
BackendSemaphore* fSignalSemaphores = nullptr;
|
86
76
|
|
87
|
-
GpuStatsFlags fGpuStatsFlags = GpuStatsFlags::kNone;
|
88
77
|
GpuFinishedContext fFinishedContext = nullptr;
|
89
78
|
GpuFinishedProc fFinishedProc = nullptr;
|
90
|
-
GpuFinishedWithStatsProc fFinishedWithStatsProc = nullptr;
|
91
79
|
};
|
92
80
|
|
93
81
|
/**
|
@@ -99,15 +87,8 @@ struct InsertRecordingInfo {
|
|
99
87
|
* other cases where some failure occured it will be called with CallbackResult::kFailed.
|
100
88
|
*/
|
101
89
|
struct InsertFinishInfo {
|
102
|
-
InsertFinishInfo() = default;
|
103
|
-
InsertFinishInfo(GpuFinishedContext context, GpuFinishedProc proc)
|
104
|
-
: fFinishedContext{context}, fFinishedProc{proc} {}
|
105
|
-
InsertFinishInfo(GpuFinishedContext context, GpuFinishedWithStatsProc proc)
|
106
|
-
: fFinishedContext{context}, fFinishedWithStatsProc{proc} {}
|
107
90
|
GpuFinishedContext fFinishedContext = nullptr;
|
108
91
|
GpuFinishedProc fFinishedProc = nullptr;
|
109
|
-
GpuFinishedWithStatsProc fFinishedWithStatsProc = nullptr;
|
110
|
-
GpuStatsFlags fGpuStatsFlags = GpuStatsFlags::kNone;
|
111
92
|
};
|
112
93
|
|
113
94
|
/**
|
@@ -209,12 +209,6 @@ public:
|
|
209
209
|
*/
|
210
210
|
size_t maxBudgetedBytes() const;
|
211
211
|
|
212
|
-
/**
|
213
|
-
* Sets the size of Recorders's gpu memory cache budget in bytes. If the new budget is lower
|
214
|
-
* than the current budget, the cache will try to free resources to get under the new budget.
|
215
|
-
*/
|
216
|
-
void setMaxBudgetedBytes(size_t bytes);
|
217
|
-
|
218
212
|
/**
|
219
213
|
* Enumerates all cached GPU resources owned by the Recorder and dumps their memory to
|
220
214
|
* traceMemoryDump.
|
@@ -9,7 +9,6 @@
|
|
9
9
|
#define skgpu_graphite_Recording_DEFINED
|
10
10
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
12
|
-
#include "include/core/SkSize.h"
|
13
12
|
#include "include/private/base/SkTArray.h"
|
14
13
|
|
15
14
|
#include <memory>
|
@@ -22,7 +21,6 @@ class RefCntedCallback;
|
|
22
21
|
|
23
22
|
namespace skgpu::graphite {
|
24
23
|
|
25
|
-
class Caps;
|
26
24
|
class CommandBuffer;
|
27
25
|
class RecordingPriv;
|
28
26
|
class Resource;
|
@@ -46,7 +44,7 @@ private:
|
|
46
44
|
// replay, and it handles the target proxy's instantiation with the provided target.
|
47
45
|
class LazyProxyData {
|
48
46
|
public:
|
49
|
-
LazyProxyData(const
|
47
|
+
LazyProxyData(const TextureInfo&);
|
50
48
|
|
51
49
|
TextureProxy* lazyProxy();
|
52
50
|
sk_sp<TextureProxy> refLazyProxy();
|