@shopify/react-native-skia 0.1.234 → 0.1.237
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/cpp/api/JsiSkApi.h +2 -0
- package/cpp/api/JsiSkCanvas.h +36 -0
- package/cpp/api/JsiSkRSXform.h +35 -7
- package/cpp/api/JsiSkTypefaceFactory.h +2 -1
- package/cpp/rnskia/dom/JsiDomApi.h +2 -0
- package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
- package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
- package/cpp/rnskia/dom/props/RectProp.h +31 -0
- package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
- package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
- package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
- package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +21 -3
- package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
- package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
- package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
- package/cpp/skia/include/config/SkUserConfig.h +3 -1
- package/cpp/skia/include/core/SkCanvas.h +66 -37
- package/cpp/skia/include/core/SkColorFilter.h +5 -2
- package/cpp/skia/include/core/SkContourMeasure.h +1 -0
- package/cpp/skia/include/core/SkDocument.h +1 -0
- package/cpp/skia/include/core/SkFont.h +14 -24
- package/cpp/skia/include/core/SkFontArguments.h +1 -1
- package/cpp/skia/include/core/SkFontMetrics.h +1 -1
- package/cpp/skia/include/core/SkFontMgr.h +0 -7
- package/cpp/skia/include/core/SkGraphics.h +13 -0
- package/cpp/skia/include/core/SkMesh.h +9 -13
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPathMeasure.h +2 -0
- package/cpp/skia/include/core/SkSerialProcs.h +29 -11
- package/cpp/skia/include/core/SkSize.h +3 -3
- package/cpp/skia/include/core/SkStream.h +3 -13
- package/cpp/skia/include/core/SkSurface.h +6 -3
- package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
- package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
- package/cpp/skia/include/core/SkTypeface.h +8 -56
- package/cpp/skia/include/core/SkTypes.h +8 -0
- package/cpp/skia/include/core/SkVertices.h +1 -1
- package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
- package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
- package/cpp/skia/include/effects/SkGradientShader.h +9 -0
- package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
- package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
- package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
- package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
- package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
- package/cpp/skia/include/gpu/GrTypes.h +1 -16
- package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
- package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
- package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
- package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
- package/cpp/skia/include/gpu/graphite/Context.h +39 -13
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
- package/cpp/skia/include/gpu/graphite/Image.h +106 -87
- package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
- package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
- package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
- package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
- package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
- package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
- package/cpp/skia/include/private/SkExif.h +102 -0
- package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
- package/cpp/skia/include/private/base/SkAssert.h +16 -0
- package/cpp/skia/include/private/base/SkDeque.h +2 -7
- package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
- package/cpp/skia/include/private/base/SkTArray.h +69 -28
- package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
- package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
- package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
- package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
- package/cpp/skia/modules/skcms/skcms.h +2 -410
- package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
- package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
- package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
- package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
- package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
- package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
- package/cpp/skia/src/base/SkUTF.h +7 -0
- package/cpp/skia/src/core/SkTHash.h +20 -8
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
- package/lib/commonjs/dom/types/NodeType.js +1 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
- package/lib/commonjs/external/reanimated/buffers.js +48 -0
- package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
- package/lib/commonjs/external/reanimated/index.d.ts +2 -0
- package/lib/commonjs/external/reanimated/index.js +26 -0
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.js +13 -1
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
- package/lib/commonjs/external/reanimated/textures.js +38 -0
- package/lib/commonjs/external/reanimated/textures.js.map +1 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/commonjs/headless/index.js +1 -1
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +8 -0
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -1
- package/lib/commonjs/renderer/Container.js +2 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
- package/lib/commonjs/renderer/HostComponents.js +3 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
- package/lib/commonjs/renderer/Offscreen.js +28 -10
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/commonjs/renderer/Reconciler.js +7 -4
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/shapes/index.js +13 -0
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
- package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +1 -1
- package/lib/commonjs/skia/core/Data.js +11 -4
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.d.ts +2 -2
- package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +4 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +3 -2
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +5 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/module/dom/nodes/drawings/index.js +1 -0
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +7 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +1 -0
- package/lib/module/dom/types/NodeType.js +1 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +2 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/external/reanimated/buffers.d.ts +5 -0
- package/lib/module/external/reanimated/buffers.js +27 -0
- package/lib/module/external/reanimated/buffers.js.map +1 -0
- package/lib/module/external/reanimated/index.d.ts +2 -0
- package/lib/module/external/reanimated/index.js +2 -0
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.js +13 -1
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/module/external/reanimated/moduleWrapper.js +3 -2
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/external/reanimated/textures.d.ts +5 -0
- package/lib/module/external/reanimated/textures.js +24 -0
- package/lib/module/external/reanimated/textures.js.map +1 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/headless/index.js +1 -1
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/mock/index.js +8 -0
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -1
- package/lib/module/renderer/Container.js +2 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +3 -1
- package/lib/module/renderer/HostComponents.js +3 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +4 -1
- package/lib/module/renderer/Offscreen.js +19 -9
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -1
- package/lib/module/renderer/Reconciler.js +7 -4
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Atlas.js +5 -0
- package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/module/renderer/components/shapes/index.d.ts +1 -0
- package/lib/module/renderer/components/shapes/index.js +1 -0
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/module/skia/core/AnimatedImage.js +4 -1
- package/lib/module/skia/core/AnimatedImage.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +1 -1
- package/lib/module/skia/core/Data.js +11 -4
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Rect.d.ts +2 -2
- package/lib/module/skia/types/Canvas.d.ts +16 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +8 -0
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +2 -2
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/RSXform.d.ts +7 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +4 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +3 -2
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/module/skia/web/JsiSkCanvas.js +18 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/module/skia/web/JsiSkRSXform.js +34 -3
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/module/skia/web/JsiSkRect.js +7 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +5 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
- package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
- package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
- package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
- package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
- package/lib/typescript/src/renderer/Container.d.ts +1 -1
- package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
- package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
- package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +1 -1
- package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
- package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
- package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
- package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
- package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libskparagraph.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libskunicode.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/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libskparagraph.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libskunicode.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/libskottie.a +0 -0
- package/libs/android/x86_64/libskparagraph.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libskunicode.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- 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/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.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/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- 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 +1 -1
- package/src/dom/nodes/JsiSkDOM.ts +63 -56
- package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
- package/src/dom/nodes/drawings/index.ts +1 -0
- package/src/dom/types/Drawings.ts +9 -0
- package/src/dom/types/NodeType.ts +1 -0
- package/src/dom/types/SkDOM.ts +2 -0
- package/src/external/reanimated/buffers.ts +53 -0
- package/src/external/reanimated/index.ts +2 -0
- package/src/external/reanimated/interpolators.ts +15 -2
- package/src/external/reanimated/moduleWrapper.ts +1 -0
- package/src/external/reanimated/textures.tsx +38 -0
- package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
- package/src/headless/index.ts +1 -1
- package/src/mock/index.ts +8 -0
- package/src/renderer/Canvas.tsx +1 -1
- package/src/renderer/Container.tsx +3 -2
- package/src/renderer/HostComponents.ts +6 -1
- package/src/renderer/Offscreen.tsx +24 -11
- package/src/renderer/Reconciler.tsx +5 -2
- package/src/renderer/components/shapes/Atlas.tsx +8 -0
- package/src/renderer/components/shapes/index.ts +1 -0
- package/src/skia/core/AnimatedImage.ts +3 -2
- package/src/skia/core/Data.ts +8 -4
- package/src/skia/types/Canvas.ts +32 -1
- package/src/skia/types/Image/Image.ts +10 -0
- package/src/skia/types/Matrix4.ts +2 -2
- package/src/skia/types/RSXform.ts +7 -1
- package/src/skia/types/Rect.ts +6 -0
- package/src/skia/types/Shader/Shader.ts +6 -1
- package/src/skia/types/Skia.ts +10 -2
- package/src/skia/web/JsiSkCanvas.ts +60 -23
- package/src/skia/web/JsiSkRSXform.ts +28 -4
- package/src/skia/web/JsiSkRect.ts +12 -2
- package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
- package/src/skia/web/JsiSkia.ts +15 -0
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
- package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
- package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
- package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
- package/cpp/skia/include/utils/SkBase64.h +0 -53
- package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#ifndef skgpu_graphite_Image_DEFINED
|
|
9
9
|
#define skgpu_graphite_Image_DEFINED
|
|
10
10
|
|
|
11
|
+
#include "include/core/SkColorSpace.h"
|
|
11
12
|
#include "include/core/SkImage.h"
|
|
12
13
|
#include "include/core/SkRefCnt.h"
|
|
13
14
|
#include "include/core/SkSpan.h"
|
|
@@ -45,7 +46,8 @@ using GraphitePromiseImageYUVAFulfillProc =
|
|
|
45
46
|
using GraphitePromiseImageReleaseProc = void (*)(GraphitePromiseImageContext);
|
|
46
47
|
using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureReleaseContext);
|
|
47
48
|
|
|
48
|
-
/** Creates an SkImage from a GPU texture associated with the recorder.
|
|
49
|
+
/** Creates an SkImage from a GPU texture associated with the recorder. The client is still
|
|
50
|
+
responsible for managing the backend texture's lifetime.
|
|
49
51
|
|
|
50
52
|
SkImage is returned if the format of backendTexture is recognized and supported.
|
|
51
53
|
Recognized formats vary by GPU back-end.
|
|
@@ -63,57 +65,77 @@ using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureRelease
|
|
|
63
65
|
BottomLeft
|
|
64
66
|
@return created SkImage, or nullptr
|
|
65
67
|
*/
|
|
66
|
-
SK_API sk_sp<SkImage>
|
|
67
|
-
|
|
68
|
+
SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
|
|
69
|
+
const skgpu::graphite::BackendTexture&,
|
|
70
|
+
SkColorType colorType,
|
|
71
|
+
SkAlphaType alphaType,
|
|
72
|
+
sk_sp<SkColorSpace> colorSpace,
|
|
73
|
+
skgpu::Origin origin,
|
|
74
|
+
TextureReleaseProc = nullptr,
|
|
75
|
+
ReleaseContext = nullptr);
|
|
76
|
+
|
|
77
|
+
SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
|
|
78
|
+
const skgpu::graphite::BackendTexture&,
|
|
79
|
+
SkColorType colorType,
|
|
80
|
+
SkAlphaType alphaType,
|
|
81
|
+
sk_sp<SkColorSpace> colorSpace,
|
|
82
|
+
TextureReleaseProc = nullptr,
|
|
83
|
+
ReleaseContext = nullptr);
|
|
84
|
+
|
|
85
|
+
#if !defined(SK_DISABLE_LEGACY_GRAPHITE_IMAGES)
|
|
86
|
+
inline sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder* recorder,
|
|
87
|
+
const skgpu::graphite::BackendTexture& tex,
|
|
68
88
|
SkColorType colorType,
|
|
69
89
|
SkAlphaType alphaType,
|
|
70
90
|
sk_sp<SkColorSpace> colorSpace,
|
|
71
91
|
skgpu::Origin origin,
|
|
72
|
-
TextureReleaseProc = nullptr,
|
|
73
|
-
ReleaseContext = nullptr)
|
|
92
|
+
TextureReleaseProc trProc = nullptr,
|
|
93
|
+
ReleaseContext ctx = nullptr) {
|
|
94
|
+
return WrapTexture(recorder, tex, colorType, alphaType, colorSpace, origin, trProc, ctx);
|
|
95
|
+
}
|
|
74
96
|
|
|
75
|
-
|
|
76
|
-
const skgpu::graphite::BackendTexture
|
|
97
|
+
inline sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder* recorder,
|
|
98
|
+
const skgpu::graphite::BackendTexture& tex,
|
|
77
99
|
SkColorType colorType,
|
|
78
100
|
SkAlphaType alphaType,
|
|
79
101
|
sk_sp<SkColorSpace> colorSpace,
|
|
80
|
-
TextureReleaseProc = nullptr,
|
|
81
|
-
ReleaseContext = nullptr)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
The
|
|
93
|
-
be
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
'
|
|
103
|
-
'textureRelease' will be called only once when the GPU
|
|
104
|
-
promise image. This will usually occur during a Context::submit
|
|
105
|
-
earlier due to error conditions. 'fulfill' can be called multiple times
|
|
106
|
-
image is used in multiple recordings. If 'fulfill' fails, the insertRecording
|
|
107
|
-
fail. Subsequent insertRecording calls (with Recordings that use the promise image)
|
|
108
|
-
keep calling 'fulfill' until it succeeds.
|
|
109
|
-
|
|
110
|
-
For volatile promise images, 'fulfill' will be called each time the Recording is inserted
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
TextureReleaseProc trProc = nullptr,
|
|
103
|
+
ReleaseContext ctx = nullptr) {
|
|
104
|
+
return WrapTexture(recorder, tex, colorType, alphaType, colorSpace, trProc, ctx);
|
|
105
|
+
}
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
/** Create a new SkImage that is very similar to an SkImage created by WrapTexture. The difference
|
|
109
|
+
is that the caller need not have created the backend texture nor populated it with data when
|
|
110
|
+
creating the image. Instead of passing a BackendTexture to the factory the client supplies a
|
|
111
|
+
description of the texture consisting of dimensions, TextureInfo, SkColorInfo and Volatility.
|
|
112
|
+
|
|
113
|
+
In general, 'fulfill' must return a BackendTexture that matches the properties provided at
|
|
114
|
+
SkImage creation time. The BackendTexture must refer to a valid existing texture in the backend
|
|
115
|
+
API context/device, and already be populated with data. The texture cannot be deleted until
|
|
116
|
+
'textureRelease' is called. 'textureRelease' will be called with the textureReleaseContext
|
|
117
|
+
returned by 'fulfill'.
|
|
118
|
+
|
|
119
|
+
Wrt when and how often the fulfill, imageRelease, and textureRelease callbacks will be called:
|
|
120
|
+
|
|
121
|
+
For non-volatile promise images, 'fulfill' will be called at Context::insertRecording time.
|
|
122
|
+
Regardless of whether 'fulfill' succeeded or failed, 'imageRelease' will always be called only
|
|
123
|
+
once - when Skia will no longer try calling 'fulfill' to get a backend texture. If 'fulfill'
|
|
124
|
+
failed (i.e., it didn't return a valid backend texture) then 'textureRelease' will never be
|
|
125
|
+
called. If 'fulfill' was successful then 'textureRelease' will be called only once when the GPU
|
|
126
|
+
is done with the contents of the promise image. This will usually occur during a Context::submit
|
|
127
|
+
call but it could occur earlier due to error conditions. 'fulfill' can be called multiple times
|
|
128
|
+
if the promise image is used in multiple recordings. If 'fulfill' fails, the insertRecording
|
|
129
|
+
itself will fail. Subsequent insertRecording calls (with Recordings that use the promise image)
|
|
130
|
+
will keep calling 'fulfill' until it succeeds.
|
|
131
|
+
|
|
132
|
+
For volatile promise images, 'fulfill' will be called each time the Recording is inserted into a
|
|
133
|
+
Context. Regardless of whether 'fulfill' succeeded or failed, 'imageRelease' will always be
|
|
134
|
+
called only once just like the non-volatile case. If 'fulfill' fails at insertRecording-time,
|
|
135
|
+
'textureRelease' will never be called. If 'fulfill' was successful then a 'textureRelease'
|
|
136
|
+
matching that 'fulfill' will be called when the GPU is done with the contents of the promise
|
|
137
|
+
image. This will usually occur during a Context::submit call but it could occur earlier due to
|
|
138
|
+
error conditions.
|
|
117
139
|
|
|
118
140
|
@param recorder the recorder that will capture the commands creating the image
|
|
119
141
|
@param dimensions width & height of promised gpu texture
|
|
@@ -150,16 +172,16 @@ SK_API sk_sp<SkImage> PromiseTextureFrom(skgpu::graphite::Recorder*,
|
|
|
150
172
|
GraphitePromiseImageContext);
|
|
151
173
|
|
|
152
174
|
/** This is similar to 'PromiseTextureFrom' but it creates a GPU-backed SkImage from YUV[A] data.
|
|
153
|
-
The source data may be planar (i.e. spread across multiple textures). In
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
The source data may be planar (i.e. spread across multiple textures). In the extreme Y, U, V,
|
|
176
|
+
and A are all in different planes and thus the image is specified by four textures.
|
|
177
|
+
'backendTextureInfo' describes the planar arrangement, texture formats, and conversion to RGB.
|
|
178
|
+
Separate 'fulfill' and 'textureRelease' calls are made for each texture. Each texture has its
|
|
179
|
+
own GraphitePromiseTextureContext. The GraphitePromiseImageReleaseProc will be made even on
|
|
180
|
+
failure. 'textureContexts' has one entry for each of the up to four textures, as indicated by
|
|
181
|
+
'backendTextureInfo'. Currently the mipmapped property of 'backendTextureInfo' is ignored.
|
|
182
|
+
However, in the near future it will be required that if it is kYes then the fulfillProc must
|
|
183
|
+
return a mip mapped texture for each plane in order to successfully draw the image.
|
|
184
|
+
|
|
163
185
|
@param recorder the recorder that will capture the commands creating the image
|
|
164
186
|
@param backendTextureInfo info about the promised yuva gpu texture(s)
|
|
165
187
|
@param imageColorSpace range of colors; may be nullptr
|
|
@@ -184,19 +206,19 @@ SK_API sk_sp<SkImage> PromiseTextureFromYUVA(skgpu::graphite::Recorder*,
|
|
|
184
206
|
GraphitePromiseTextureContext textureContexts[]);
|
|
185
207
|
|
|
186
208
|
|
|
187
|
-
/** Returns an SkImage backed by a Graphite texture, using the provided Recorder for creation
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
209
|
+
/** Returns an SkImage backed by a Graphite texture, using the provided Recorder for creation and
|
|
210
|
+
uploads if necessary. The returned SkImage respects the required image properties' mipmap
|
|
211
|
+
setting for non-Graphite SkImages; i.e., if mipmapping is required, the backing Graphite texture
|
|
212
|
+
will have allocated mip map levels.
|
|
191
213
|
|
|
192
214
|
It is assumed that MIP maps are always supported by the GPU.
|
|
193
215
|
|
|
194
|
-
Returns original SkImage if the image is already Graphite-backed and the required mipmapping
|
|
195
|
-
|
|
196
|
-
|
|
216
|
+
Returns original SkImage if the image is already Graphite-backed and the required mipmapping is
|
|
217
|
+
compatible with the backing Graphite texture. If the required mipmapping is not compatible,
|
|
218
|
+
nullptr will be returned.
|
|
197
219
|
|
|
198
|
-
Returns nullptr if no Recorder is provided, or if SkImage was created with another
|
|
199
|
-
|
|
220
|
+
Returns nullptr if no Recorder is provided, or if SkImage was created with another Recorder and
|
|
221
|
+
work on that Recorder has not been submitted.
|
|
200
222
|
|
|
201
223
|
@param Recorder the Recorder to use for storing commands
|
|
202
224
|
@param RequiredProperties properties the returned SkImage must possess (e.g. mipmaps)
|
|
@@ -207,20 +229,19 @@ SK_API sk_sp<SkImage> TextureFromImage(skgpu::graphite::Recorder*,
|
|
|
207
229
|
SkImage::RequiredProperties = {});
|
|
208
230
|
|
|
209
231
|
inline sk_sp<SkImage> TextureFromImage(skgpu::graphite::Recorder* r,
|
|
210
|
-
sk_sp<const SkImage
|
|
232
|
+
const sk_sp<const SkImage>& img,
|
|
211
233
|
SkImage::RequiredProperties props = {}) {
|
|
212
234
|
return TextureFromImage(r, img.get(), props);
|
|
213
235
|
}
|
|
214
236
|
|
|
215
237
|
/** Creates SkImage from SkYUVAPixmaps.
|
|
216
238
|
|
|
217
|
-
The image will remain planar with each plane converted to a texture using the passed
|
|
218
|
-
Recorder.
|
|
239
|
+
The image will remain planar with each plane converted to a texture using the passed Recorder.
|
|
219
240
|
|
|
220
|
-
SkYUVAPixmaps has a SkYUVAInfo which specifies the transformation from YUV to RGB.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
241
|
+
SkYUVAPixmaps has a SkYUVAInfo which specifies the transformation from YUV to RGB. The
|
|
242
|
+
SkColorSpace of the resulting RGB values is specified by imgColorSpace. This will be the
|
|
243
|
+
SkColorSpace reported by the image and when drawn the RGB values will be converted from this
|
|
244
|
+
space into the destination space (if the destination is tagged).
|
|
224
245
|
|
|
225
246
|
This is only supported using the GPU backend and will fail if recorder is nullptr.
|
|
226
247
|
|
|
@@ -259,10 +280,10 @@ SK_API sk_sp<SkImage> TextureFromYUVATextures(
|
|
|
259
280
|
|
|
260
281
|
/** Creates an SkImage from YUV[A] planar SkImages associated with the recorder.
|
|
261
282
|
|
|
262
|
-
The images should have kGraphite type, and the result will be nullptr if any are not.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
283
|
+
The images should have kGraphite type, and the result will be nullptr if any are not. The
|
|
284
|
+
resulting SkImage will not take a ref on the given SkImages but will take a ref on the
|
|
285
|
+
underlying TextureProxies. The releaseProcs, if any, for those Textures will be the ones set
|
|
286
|
+
when the given SkImages were created.
|
|
266
287
|
|
|
267
288
|
@param recorder The recorder.
|
|
268
289
|
@param yuvaInfo Structure describing the YUVA format
|
|
@@ -297,19 +318,17 @@ SK_API sk_sp<SkImage> SubsetTextureFrom(skgpu::graphite::Recorder* recorder,
|
|
|
297
318
|
SkImage::RequiredProperties props = {});
|
|
298
319
|
|
|
299
320
|
/** Creates a filtered SkImage on the GPU. filter processes the src image, potentially changing
|
|
300
|
-
color, position, and size. subset is the bounds of src that are processed
|
|
301
|
-
|
|
302
|
-
is required storage for
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
of GPU texture returned. offset translates the returned SkImage to keep subsequent
|
|
312
|
-
animation frames aligned with respect to each other.
|
|
321
|
+
color, position, and size. subset is the bounds of src that are processed by filter. clipBounds
|
|
322
|
+
is the expected bounds of the filtered SkImage. outSubset is required storage for the actual
|
|
323
|
+
bounds of the filtered SkImage. offset is required storage for translation of returned SkImage.
|
|
324
|
+
|
|
325
|
+
Returns nullptr if SkImage could not be created. If nullptr is returned, outSubset and offset
|
|
326
|
+
are undefined.
|
|
327
|
+
|
|
328
|
+
Useful for animation of SkImageFilter that varies size from frame to frame. Returned SkImage is
|
|
329
|
+
created larger than required by filter so that GPU texture can be reused with different sized
|
|
330
|
+
effects. outSubset describes the valid bounds of GPU texture returned. offset translates the
|
|
331
|
+
returned SkImage to keep subsequent animation frames aligned with respect to each other.
|
|
313
332
|
|
|
314
333
|
@param recorder the recorder in which the filtering operation is to be performed
|
|
315
334
|
@param filter how SkImage is sampled when transformed
|
|
@@ -18,9 +18,11 @@
|
|
|
18
18
|
#include <chrono>
|
|
19
19
|
#include <vector>
|
|
20
20
|
|
|
21
|
+
struct AHardwareBuffer;
|
|
21
22
|
class SkCanvas;
|
|
22
23
|
struct SkImageInfo;
|
|
23
24
|
class SkPixmap;
|
|
25
|
+
class SkTraceMemoryDump;
|
|
24
26
|
|
|
25
27
|
namespace skgpu {
|
|
26
28
|
class RefCntedCallback;
|
|
@@ -65,7 +67,7 @@ struct SK_API RecorderOptions final {
|
|
|
65
67
|
|
|
66
68
|
sk_sp<ImageProvider> fImageProvider;
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
static constexpr size_t kDefaultRecorderBudget = 256 * (1 << 20);
|
|
69
71
|
// What is the budget for GPU resources allocated and held by this Recorder.
|
|
70
72
|
size_t fGpuBudgetInBytes = kDefaultRecorderBudget;
|
|
71
73
|
};
|
|
@@ -79,6 +81,8 @@ public:
|
|
|
79
81
|
|
|
80
82
|
~Recorder();
|
|
81
83
|
|
|
84
|
+
BackendApi backend() const;
|
|
85
|
+
|
|
82
86
|
std::unique_ptr<Recording> snap();
|
|
83
87
|
|
|
84
88
|
ImageProvider* clientImageProvider() { return fClientImageProvider.get(); }
|
|
@@ -97,6 +101,14 @@ public:
|
|
|
97
101
|
*/
|
|
98
102
|
BackendTexture createBackendTexture(SkISize dimensions, const TextureInfo&);
|
|
99
103
|
|
|
104
|
+
#ifdef SK_BUILD_FOR_ANDROID
|
|
105
|
+
BackendTexture createBackendTexture(AHardwareBuffer*,
|
|
106
|
+
bool isRenderable,
|
|
107
|
+
bool isProtectedContent,
|
|
108
|
+
SkISize dimensions,
|
|
109
|
+
bool fromAndroidWindow = false) const;
|
|
110
|
+
#endif
|
|
111
|
+
|
|
100
112
|
/**
|
|
101
113
|
* If possible, updates a backend texture with the provided pixmap data. The client
|
|
102
114
|
* should check the return value to see if the update was successful. The client is required
|
|
@@ -154,6 +166,17 @@ public:
|
|
|
154
166
|
*/
|
|
155
167
|
void performDeferredCleanup(std::chrono::milliseconds msNotUsed);
|
|
156
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Returns the number of bytes of gpu memory currently budgeted in the Recorder's cache.
|
|
171
|
+
*/
|
|
172
|
+
size_t currentBudgetedBytes() const;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Enumerates all cached GPU resources owned by the Recorder and dumps their memory to
|
|
176
|
+
* traceMemoryDump.
|
|
177
|
+
*/
|
|
178
|
+
void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const;
|
|
179
|
+
|
|
157
180
|
// Provides access to functions that aren't part of the public API.
|
|
158
181
|
RecorderPriv priv();
|
|
159
182
|
const RecorderPriv priv() const; // NOLINT(readability-const-return-type)
|
|
@@ -167,8 +190,6 @@ private:
|
|
|
167
190
|
|
|
168
191
|
SingleOwner* singleOwner() const { return &fSingleOwner; }
|
|
169
192
|
|
|
170
|
-
BackendApi backend() const;
|
|
171
|
-
|
|
172
193
|
// We keep track of all Devices that are connected to a Recorder. This allows the client to
|
|
173
194
|
// safely delete an SkSurface or a Recorder in any order. If the client deletes the Recorder
|
|
174
195
|
// we need to notify all Devices that the Recorder is no longer valid. If we delete the
|
|
@@ -21,8 +21,11 @@ class Recorder;
|
|
|
21
21
|
} // namespace skgpu::graphite
|
|
22
22
|
|
|
23
23
|
namespace SkSurfaces {
|
|
24
|
+
using ReleaseContext = void*;
|
|
25
|
+
using TextureReleaseProc = void (*)(ReleaseContext);
|
|
26
|
+
|
|
24
27
|
/**
|
|
25
|
-
* The '
|
|
28
|
+
* The 'AsImage' and 'AsImageCopy' API/entry points are currently only available for
|
|
26
29
|
* Graphite.
|
|
27
30
|
*
|
|
28
31
|
* In this API, SkSurface no longer supports copy-on-write behavior. Instead, when creating
|
|
@@ -75,7 +78,9 @@ SK_API sk_sp<SkSurface> WrapBackendTexture(skgpu::graphite::Recorder*,
|
|
|
75
78
|
const skgpu::graphite::BackendTexture&,
|
|
76
79
|
SkColorType colorType,
|
|
77
80
|
sk_sp<SkColorSpace> colorSpace,
|
|
78
|
-
const SkSurfaceProps* props
|
|
81
|
+
const SkSurfaceProps* props,
|
|
82
|
+
TextureReleaseProc = nullptr,
|
|
83
|
+
ReleaseContext = nullptr);
|
|
79
84
|
} // namespace SkSurfaces
|
|
80
85
|
|
|
81
86
|
#endif // skgpu_graphite_Surface_DEFINED
|
|
@@ -8,16 +8,55 @@
|
|
|
8
8
|
#ifndef skgpu_graphite_DawnBackendContext_DEFINED
|
|
9
9
|
#define skgpu_graphite_DawnBackendContext_DEFINED
|
|
10
10
|
|
|
11
|
-
#include "
|
|
11
|
+
#include "include/core/SkTypes.h"
|
|
12
|
+
#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
|
|
12
13
|
|
|
13
14
|
namespace skgpu::graphite {
|
|
14
15
|
|
|
16
|
+
/**
|
|
17
|
+
* WebGPU needs to allow the main thread loop to run to detect GPU progress. Dawn native has a
|
|
18
|
+
* function wgpu::Dawn::Tick(), not present in WebGPU, that can be used to detect GPU progress.
|
|
19
|
+
*
|
|
20
|
+
* When compiling using Emscripten/WASM the -s ASYNCIFY option can be used to yield. E.g.:
|
|
21
|
+
*
|
|
22
|
+
* EM_ASYNC_JS(void, asyncSleep, (), {
|
|
23
|
+
* await new Promise((resolve, _) = > {
|
|
24
|
+
* setTimeout(resolve, 0);
|
|
25
|
+
* })
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* WebGPUTickFunction(wgpu::Device&) { asyncSleep(); }
|
|
29
|
+
*
|
|
30
|
+
* If no DawnTickFunction is provided then the graphite::Context will be "non-yielding". This
|
|
31
|
+
* implies the following restrictions on the Context:
|
|
32
|
+
*
|
|
33
|
+
* 1) SyncToCpu::kYes is disallowed as a parameter to Context::submit.
|
|
34
|
+
* 2) The client must guarantee that GPU work has completed before destroying Context as Context
|
|
35
|
+
* cannot await the work completion in its destructor. Context reports whether it is awaiting
|
|
36
|
+
* GPU work completion via Context::hasUnfinishedGpuWork().
|
|
37
|
+
*
|
|
38
|
+
* Using a non-yielding Context makes it possible to build and run Graphite/Dawn on WebGPU without
|
|
39
|
+
* -s ASYNCIFY.
|
|
40
|
+
*/
|
|
41
|
+
using DawnTickFunction = void(const wgpu::Device& device);
|
|
42
|
+
|
|
43
|
+
#if !defined(__EMSCRIPTEN__)
|
|
44
|
+
SK_API inline void DawnNativeTickFunction(const wgpu::Device& device) { device.Tick(); }
|
|
45
|
+
#endif
|
|
46
|
+
|
|
15
47
|
// The DawnBackendContext contains all of the base Dawn objects needed by the graphite Dawn
|
|
16
48
|
// backend. The client will create this object and pass it into the Context::MakeDawn factory call
|
|
17
49
|
// when setting up Skia.
|
|
18
50
|
struct SK_API DawnBackendContext {
|
|
19
51
|
wgpu::Device fDevice;
|
|
20
|
-
wgpu::Queue
|
|
52
|
+
wgpu::Queue fQueue;
|
|
53
|
+
// See comment on DawnTickFunction.
|
|
54
|
+
DawnTickFunction* fTick =
|
|
55
|
+
#if defined(__EMSCRIPTEN__)
|
|
56
|
+
nullptr;
|
|
57
|
+
#else
|
|
58
|
+
DawnNativeTickFunction;
|
|
59
|
+
#endif
|
|
21
60
|
};
|
|
22
61
|
|
|
23
62
|
} // namespace skgpu::graphite
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#define skgpu_graphite_DawnTypes_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/gpu/graphite/GraphiteTypes.h"
|
|
12
|
-
#include "webgpu/webgpu_cpp.h"
|
|
12
|
+
#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
|
|
13
13
|
|
|
14
14
|
namespace skgpu::graphite {
|
|
15
15
|
|
|
@@ -18,19 +18,24 @@ struct DawnTextureInfo {
|
|
|
18
18
|
Mipmapped fMipmapped = Mipmapped::kNo;
|
|
19
19
|
|
|
20
20
|
// wgpu::TextureDescriptor properties
|
|
21
|
+
// `fFormat` for multiplanar formats corresponds to the plane TextureView's format.
|
|
21
22
|
wgpu::TextureFormat fFormat = wgpu::TextureFormat::Undefined;
|
|
22
|
-
wgpu::TextureUsage
|
|
23
|
+
wgpu::TextureUsage fUsage = wgpu::TextureUsage::None;
|
|
24
|
+
// TODO(b/308944094): Migrate aspect information to BackendTextureViews.
|
|
25
|
+
wgpu::TextureAspect fAspect = wgpu::TextureAspect::All;
|
|
23
26
|
|
|
24
27
|
DawnTextureInfo() = default;
|
|
25
28
|
DawnTextureInfo(const wgpu::Texture& texture);
|
|
26
29
|
DawnTextureInfo(uint32_t sampleCount,
|
|
27
30
|
Mipmapped mipmapped,
|
|
28
|
-
wgpu::TextureFormat
|
|
29
|
-
wgpu::TextureUsage usage
|
|
31
|
+
wgpu::TextureFormat viewFormat,
|
|
32
|
+
wgpu::TextureUsage usage,
|
|
33
|
+
wgpu::TextureAspect aspect)
|
|
30
34
|
: fSampleCount(sampleCount)
|
|
31
35
|
, fMipmapped(mipmapped)
|
|
32
|
-
, fFormat(
|
|
33
|
-
, fUsage(usage)
|
|
36
|
+
, fFormat(viewFormat)
|
|
37
|
+
, fUsage(usage)
|
|
38
|
+
, fAspect(aspect) {}
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
} // namespace skgpu::graphite
|
|
@@ -35,7 +35,6 @@ namespace skgpu::graphite {
|
|
|
35
35
|
using MtlPixelFormat = unsigned int;
|
|
36
36
|
using MtlTextureUsage = unsigned int;
|
|
37
37
|
using MtlStorageMode = unsigned int;
|
|
38
|
-
using MtlHandle = const void*;
|
|
39
38
|
|
|
40
39
|
struct MtlTextureInfo {
|
|
41
40
|
uint32_t fSampleCount = 1;
|
|
@@ -49,7 +48,7 @@ struct MtlTextureInfo {
|
|
|
49
48
|
bool fFramebufferOnly = false;
|
|
50
49
|
|
|
51
50
|
MtlTextureInfo() = default;
|
|
52
|
-
MtlTextureInfo(
|
|
51
|
+
MtlTextureInfo(CFTypeRef mtlTexture);
|
|
53
52
|
MtlTextureInfo(uint32_t sampleCount,
|
|
54
53
|
skgpu::Mipmapped mipmapped,
|
|
55
54
|
MtlPixelFormat format,
|
|
@@ -33,10 +33,8 @@ struct VulkanTextureInfo {
|
|
|
33
33
|
// However, if the VkImage is a Ycbcr format, the client can pass a specific plan here to have
|
|
34
34
|
// Skia directly sample a plane. In that case the client should also pass in a VkFormat that is
|
|
35
35
|
// compatible with the plane as described by the Vulkan spec.
|
|
36
|
-
VkImageAspectFlags
|
|
37
|
-
|
|
38
|
-
// Graphite.
|
|
39
|
-
// GrVkYcbcrConversionInfo fYcbcrConversionInfo;
|
|
36
|
+
VkImageAspectFlags fAspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
|
37
|
+
VulkanYcbcrConversionInfo fYcbcrConversionInfo;
|
|
40
38
|
|
|
41
39
|
VulkanTextureInfo() = default;
|
|
42
40
|
VulkanTextureInfo(uint32_t sampleCount,
|
|
@@ -46,7 +44,8 @@ struct VulkanTextureInfo {
|
|
|
46
44
|
VkImageTiling imageTiling,
|
|
47
45
|
VkImageUsageFlags imageUsageFlags,
|
|
48
46
|
VkSharingMode sharingMode,
|
|
49
|
-
VkImageAspectFlags aspectMask
|
|
47
|
+
VkImageAspectFlags aspectMask,
|
|
48
|
+
VulkanYcbcrConversionInfo ycbcrConversionInfo)
|
|
50
49
|
: fSampleCount(sampleCount)
|
|
51
50
|
, fMipmapped(mipmapped)
|
|
52
51
|
, fFlags(flags)
|
|
@@ -54,7 +53,8 @@ struct VulkanTextureInfo {
|
|
|
54
53
|
, fImageTiling(imageTiling)
|
|
55
54
|
, fImageUsageFlags(imageUsageFlags)
|
|
56
55
|
, fSharingMode(sharingMode)
|
|
57
|
-
, fAspectMask(aspectMask)
|
|
56
|
+
, fAspectMask(aspectMask)
|
|
57
|
+
, fYcbcrConversionInfo(ycbcrConversionInfo) {}
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
} // namespace skgpu::graphite
|
|
@@ -121,6 +121,7 @@ struct GrMockOptions {
|
|
|
121
121
|
fConfigOptions[(int)GrColorType::kRGBA_8888].fTexturable = true;
|
|
122
122
|
fConfigOptions[(int)GrColorType::kAlpha_8].fTexturable = true;
|
|
123
123
|
fConfigOptions[(int)GrColorType::kBGR_565].fTexturable = true;
|
|
124
|
+
fConfigOptions[(int)GrColorType::kRGB_565].fTexturable = true;
|
|
124
125
|
|
|
125
126
|
fConfigOptions[(int)GrColorType::kBGRA_8888] = fConfigOptions[(int)GrColorType::kRGBA_8888];
|
|
126
127
|
|
|
@@ -30,7 +30,7 @@ enum GrVkFeatureFlags {
|
|
|
30
30
|
kSampleRateShading_GrVkFeatureFlag = 0x0004,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
// It is not
|
|
33
|
+
// It is not guaranteed VkPhysicalDeviceProperties2 will be in the client's header so we forward
|
|
34
34
|
// declare it here to be safe.
|
|
35
35
|
struct VkPhysicalDeviceFeatures2;
|
|
36
36
|
|
|
@@ -14,50 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
using GrVkBackendMemory = skgpu::VulkanBackendMemory;
|
|
16
16
|
using GrVkAlloc = skgpu::VulkanAlloc;
|
|
17
|
-
|
|
18
|
-
// This struct is used to pass in the necessary information to create a VkSamplerYcbcrConversion
|
|
19
|
-
// object for an VkExternalFormatANDROID.
|
|
20
|
-
struct GrVkYcbcrConversionInfo {
|
|
21
|
-
bool operator==(const GrVkYcbcrConversionInfo& that) const {
|
|
22
|
-
// Invalid objects are not required to have all other fields initialized or matching.
|
|
23
|
-
if (!this->isValid() && !that.isValid()) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return this->fFormat == that.fFormat &&
|
|
27
|
-
this->fExternalFormat == that.fExternalFormat &&
|
|
28
|
-
this->fYcbcrModel == that.fYcbcrModel &&
|
|
29
|
-
this->fYcbcrRange == that.fYcbcrRange &&
|
|
30
|
-
this->fXChromaOffset == that.fXChromaOffset &&
|
|
31
|
-
this->fYChromaOffset == that.fYChromaOffset &&
|
|
32
|
-
this->fChromaFilter == that.fChromaFilter &&
|
|
33
|
-
this->fForceExplicitReconstruction == that.fForceExplicitReconstruction;
|
|
34
|
-
}
|
|
35
|
-
bool operator!=(const GrVkYcbcrConversionInfo& that) const { return !(*this == that); }
|
|
36
|
-
|
|
37
|
-
bool isValid() const {
|
|
38
|
-
return fYcbcrModel != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY ||
|
|
39
|
-
fExternalFormat != 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Format of the source image. Must be set to VK_FORMAT_UNDEFINED for external images or
|
|
43
|
-
// a valid image format otherwise.
|
|
44
|
-
VkFormat fFormat = VK_FORMAT_UNDEFINED;
|
|
45
|
-
|
|
46
|
-
// The external format. Must be non-zero for external images, zero otherwise.
|
|
47
|
-
// Should be compatible to be used in a VkExternalFormatANDROID struct.
|
|
48
|
-
uint64_t fExternalFormat = 0;
|
|
49
|
-
|
|
50
|
-
VkSamplerYcbcrModelConversion fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
|
|
51
|
-
VkSamplerYcbcrRange fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
|
|
52
|
-
VkChromaLocation fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
|
53
|
-
VkChromaLocation fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
|
54
|
-
VkFilter fChromaFilter = VK_FILTER_NEAREST;
|
|
55
|
-
VkBool32 fForceExplicitReconstruction = false;
|
|
56
|
-
|
|
57
|
-
// For external images format features here should be those returned by a call to
|
|
58
|
-
// vkAndroidHardwareBufferFormatPropertiesANDROID
|
|
59
|
-
VkFormatFeatureFlags fFormatFeatures = 0;
|
|
60
|
-
};
|
|
17
|
+
using GrVkYcbcrConversionInfo = skgpu::VulkanYcbcrConversionInfo;
|
|
61
18
|
|
|
62
19
|
/*
|
|
63
20
|
* When wrapping a GrBackendTexture or GrBackendRendenderTarget, the fCurrentQueueFamily should
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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_VulkanMutableTextureState_DEFINED
|
|
9
|
+
#define skgpu_VulkanMutableTextureState_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/gpu/MutableTextureState.h"
|
|
12
|
+
#include "include/private/gpu/vk/SkiaVulkan.h"
|
|
13
|
+
|
|
14
|
+
#include <cstdint>
|
|
15
|
+
|
|
16
|
+
namespace skgpu::MutableTextureStates {
|
|
17
|
+
MutableTextureState MakeVulkan(VkImageLayout layout, uint32_t queueFamilyIndex);
|
|
18
|
+
|
|
19
|
+
VkImageLayout GetVkImageLayout(const MutableTextureState& state);
|
|
20
|
+
VkImageLayout GetVkImageLayout(const MutableTextureState* state);
|
|
21
|
+
uint32_t GetVkQueueFamilyIndex(const MutableTextureState& state);
|
|
22
|
+
uint32_t GetVkQueueFamilyIndex(const MutableTextureState* state);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#endif
|