@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
|
@@ -54,6 +54,50 @@ private:
|
|
|
54
54
|
bool fUsesSystemHeap = false;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
// Used to pass in the necessary information to create a VkSamplerYcbcrConversion object for an
|
|
58
|
+
// VkExternalFormatANDROID.
|
|
59
|
+
struct VulkanYcbcrConversionInfo {
|
|
60
|
+
bool operator==(const VulkanYcbcrConversionInfo& that) const {
|
|
61
|
+
// Invalid objects are not required to have all other fields initialized or matching.
|
|
62
|
+
if (!this->isValid() && !that.isValid()) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return this->fFormat == that.fFormat &&
|
|
66
|
+
this->fExternalFormat == that.fExternalFormat &&
|
|
67
|
+
this->fYcbcrModel == that.fYcbcrModel &&
|
|
68
|
+
this->fYcbcrRange == that.fYcbcrRange &&
|
|
69
|
+
this->fXChromaOffset == that.fXChromaOffset &&
|
|
70
|
+
this->fYChromaOffset == that.fYChromaOffset &&
|
|
71
|
+
this->fChromaFilter == that.fChromaFilter &&
|
|
72
|
+
this->fForceExplicitReconstruction == that.fForceExplicitReconstruction;
|
|
73
|
+
}
|
|
74
|
+
bool operator!=(const VulkanYcbcrConversionInfo& that) const { return !(*this == that); }
|
|
75
|
+
|
|
76
|
+
bool isValid() const {
|
|
77
|
+
return fYcbcrModel != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY ||
|
|
78
|
+
fExternalFormat != 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Format of the source image. Must be set to VK_FORMAT_UNDEFINED for external images or
|
|
82
|
+
// a valid image format otherwise.
|
|
83
|
+
VkFormat fFormat = VK_FORMAT_UNDEFINED;
|
|
84
|
+
|
|
85
|
+
// The external format. Must be non-zero for external images, zero otherwise.
|
|
86
|
+
// Should be compatible to be used in a VkExternalFormatANDROID struct.
|
|
87
|
+
uint64_t fExternalFormat = 0;
|
|
88
|
+
|
|
89
|
+
VkSamplerYcbcrModelConversion fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
|
|
90
|
+
VkSamplerYcbcrRange fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
|
|
91
|
+
VkChromaLocation fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
|
92
|
+
VkChromaLocation fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
|
93
|
+
VkFilter fChromaFilter = VK_FILTER_NEAREST;
|
|
94
|
+
VkBool32 fForceExplicitReconstruction = false;
|
|
95
|
+
|
|
96
|
+
// For external images format features here should be those returned by a call to
|
|
97
|
+
// vkAndroidHardwareBufferFormatPropertiesANDROID
|
|
98
|
+
VkFormatFeatureFlags fFormatFeatures = 0;
|
|
99
|
+
};
|
|
100
|
+
|
|
57
101
|
} // namespace skgpu
|
|
58
102
|
|
|
59
103
|
#endif // skgpu_VulkanTypes_DEFINED
|
|
@@ -95,13 +95,10 @@ public:
|
|
|
95
95
|
* Return an SkTypeface for the given FontIdentity.
|
|
96
96
|
*
|
|
97
97
|
* The default implementation simply returns a new typeface built using data obtained from
|
|
98
|
-
* openStream(), but derived classes may implement more
|
|
98
|
+
* openStream() using the provided SkFontMgr, but derived classes may implement more
|
|
99
|
+
* complex caching schemes.
|
|
99
100
|
*/
|
|
100
|
-
virtual sk_sp<SkTypeface> makeTypeface(const FontIdentity& identity)
|
|
101
|
-
return SkTypeface::MakeFromStream(std::unique_ptr<SkStreamAsset>(this->openStream(identity)),
|
|
102
|
-
identity.fTTCIndex);
|
|
103
|
-
|
|
104
|
-
}
|
|
101
|
+
virtual sk_sp<SkTypeface> makeTypeface(const FontIdentity& identity, sk_sp<SkFontMgr> mgr);
|
|
105
102
|
|
|
106
103
|
/**
|
|
107
104
|
* Return a singleton instance of a direct subclass that calls into
|
|
@@ -29,6 +29,7 @@ public:
|
|
|
29
29
|
static std::unique_ptr<ICCProfile> Make(const skcms_ICCProfile&);
|
|
30
30
|
|
|
31
31
|
const skcms_ICCProfile* profile() const { return &fProfile; }
|
|
32
|
+
sk_sp<SkData> data() const { return fData; }
|
|
32
33
|
private:
|
|
33
34
|
ICCProfile(const skcms_ICCProfile&, sk_sp<SkData> = nullptr);
|
|
34
35
|
|
|
@@ -197,6 +198,10 @@ public:
|
|
|
197
198
|
if (!fProfile) return nullptr;
|
|
198
199
|
return fProfile->profile();
|
|
199
200
|
}
|
|
201
|
+
sk_sp<SkData> profileData() const {
|
|
202
|
+
if (!fProfile) return nullptr;
|
|
203
|
+
return fProfile->data();
|
|
204
|
+
}
|
|
200
205
|
|
|
201
206
|
uint8_t bitsPerComponent() const { return fBitsPerComponent; }
|
|
202
207
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Google Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
5
|
+
* found in the LICENSE file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifndef SkExif_DEFINED
|
|
9
|
+
#define SkExif_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/codec/SkEncodedOrigin.h"
|
|
12
|
+
#include "include/core/SkData.h"
|
|
13
|
+
#include "include/core/SkRefCnt.h"
|
|
14
|
+
#include "include/private/base/SkAPI.h"
|
|
15
|
+
|
|
16
|
+
#include <cstdint>
|
|
17
|
+
|
|
18
|
+
class SK_API SkExifMetadata {
|
|
19
|
+
public:
|
|
20
|
+
/*
|
|
21
|
+
* Parse the metadata specified in |data|.
|
|
22
|
+
*/
|
|
23
|
+
SkExifMetadata(const sk_sp<SkData> data);
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* If the image encoded origin is specified, populate |out| and return true. Otherwise return
|
|
27
|
+
* false.
|
|
28
|
+
*/
|
|
29
|
+
bool getOrigin(SkEncodedOrigin* out) const {
|
|
30
|
+
if (fOriginPresent && out) *out = fOriginValue;
|
|
31
|
+
return fOriginPresent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* If the HDR headroom is specified, populate |out| and return true. Otherwise return false.
|
|
36
|
+
*/
|
|
37
|
+
bool getHdrHeadroom(float* out) const {
|
|
38
|
+
if (fHdrHeadroomPresent && out) *out = fHdrHeadroomValue;
|
|
39
|
+
return fHdrHeadroomPresent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* If resolution unit, x, or y is specified, populate |out| and return true. Otherwise return
|
|
44
|
+
* false.
|
|
45
|
+
*/
|
|
46
|
+
bool getResolutionUnit(uint16_t* out) const {
|
|
47
|
+
if (fResolutionUnitPresent && out) *out = fResolutionUnitValue;
|
|
48
|
+
return fResolutionUnitPresent;
|
|
49
|
+
}
|
|
50
|
+
bool getXResolution(float* out) const {
|
|
51
|
+
if (fXResolutionPresent && out) *out = fXResolutionValue;
|
|
52
|
+
return fXResolutionPresent;
|
|
53
|
+
}
|
|
54
|
+
bool getYResolution(float* out) const {
|
|
55
|
+
if (fYResolutionPresent && out) *out = fYResolutionValue;
|
|
56
|
+
return fYResolutionPresent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* If pixel dimension x or y is specified, populate |out| and return true. Otherwise return
|
|
61
|
+
* false.
|
|
62
|
+
*/
|
|
63
|
+
bool getPixelXDimension(uint32_t* out) const {
|
|
64
|
+
if (fPixelXDimensionPresent && out) *out = fPixelXDimensionValue;
|
|
65
|
+
return fPixelXDimensionPresent;
|
|
66
|
+
}
|
|
67
|
+
bool getPixelYDimension(uint32_t* out) const {
|
|
68
|
+
if (fPixelYDimensionPresent && out) *out = fPixelYDimensionValue;
|
|
69
|
+
return fPixelYDimensionPresent;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
// Helper functions and constants for parsing the data.
|
|
74
|
+
void parseIfd(uint32_t ifdOffset, bool littleEndian, bool isRoot);
|
|
75
|
+
|
|
76
|
+
// The input data.
|
|
77
|
+
const sk_sp<SkData> fData;
|
|
78
|
+
|
|
79
|
+
// The origin property.
|
|
80
|
+
bool fOriginPresent = false;
|
|
81
|
+
SkEncodedOrigin fOriginValue = kTopLeft_SkEncodedOrigin;
|
|
82
|
+
|
|
83
|
+
// The HDR headroom property.
|
|
84
|
+
bool fHdrHeadroomPresent = false;
|
|
85
|
+
float fHdrHeadroomValue = 1.f;
|
|
86
|
+
|
|
87
|
+
// Resolution.
|
|
88
|
+
bool fResolutionUnitPresent = false;
|
|
89
|
+
uint16_t fResolutionUnitValue = 0;
|
|
90
|
+
bool fXResolutionPresent = false;
|
|
91
|
+
float fXResolutionValue = 0;
|
|
92
|
+
bool fYResolutionPresent = false;
|
|
93
|
+
float fYResolutionValue = 0;
|
|
94
|
+
|
|
95
|
+
// Size in pixels.
|
|
96
|
+
bool fPixelXDimensionPresent = false;
|
|
97
|
+
uint32_t fPixelXDimensionValue = 0;
|
|
98
|
+
bool fPixelYDimensionPresent = false;
|
|
99
|
+
uint32_t fPixelYDimensionValue = 0;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
#endif
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#define SkGainmapInfo_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkColor.h"
|
|
12
|
+
#include "include/core/SkColorSpace.h"
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Gainmap rendering parameters. Suppose our display has HDR to SDR ratio of H and we wish to
|
|
@@ -71,12 +72,21 @@ struct SkGainmapInfo {
|
|
|
71
72
|
};
|
|
72
73
|
BaseImageType fBaseImageType = BaseImageType::kSDR;
|
|
73
74
|
|
|
75
|
+
/**
|
|
76
|
+
* If specified, color space to apply the gainmap in, otherwise the base image's color space
|
|
77
|
+
* is used. Only the color primaries are used, the transfer function is irrelevant.
|
|
78
|
+
*/
|
|
79
|
+
sk_sp<SkColorSpace> fGainmapMathColorSpace = nullptr;
|
|
80
|
+
|
|
74
81
|
inline bool operator==(const SkGainmapInfo& other) const {
|
|
75
82
|
return fGainmapRatioMin == other.fGainmapRatioMin &&
|
|
76
83
|
fGainmapRatioMax == other.fGainmapRatioMax && fGainmapGamma == other.fGainmapGamma &&
|
|
77
84
|
fEpsilonSdr == other.fEpsilonSdr && fEpsilonHdr == other.fEpsilonHdr &&
|
|
78
85
|
fDisplayRatioSdr == other.fDisplayRatioSdr &&
|
|
79
|
-
fDisplayRatioHdr == other.fDisplayRatioHdr &&
|
|
86
|
+
fDisplayRatioHdr == other.fDisplayRatioHdr &&
|
|
87
|
+
fBaseImageType == other.fBaseImageType &&
|
|
88
|
+
SkColorSpace::Equals(fGainmapMathColorSpace.get(),
|
|
89
|
+
other.fGainmapMathColorSpace.get());
|
|
80
90
|
}
|
|
81
91
|
inline bool operator!=(const SkGainmapInfo& other) const { return !(*this == other); }
|
|
82
92
|
|
|
@@ -28,6 +28,22 @@
|
|
|
28
28
|
#define SK_UNLIKELY
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
+
// c++23 will give us [[assume]] -- until then we're stuck with various other options:
|
|
32
|
+
#if defined(__clang__)
|
|
33
|
+
#define SK_ASSUME(cond) __builtin_assume(cond)
|
|
34
|
+
#elif defined(__GNUC__)
|
|
35
|
+
#if __GNUC__ >= 13
|
|
36
|
+
#define SK_ASSUME(cond) __attribute__((assume(cond)))
|
|
37
|
+
#else
|
|
38
|
+
// NOTE: This implementation could actually evaluate `cond`, which is not desirable.
|
|
39
|
+
#define SK_ASSUME(cond) ((cond) ? (void)0 : __builtin_unreachable())
|
|
40
|
+
#endif
|
|
41
|
+
#elif defined(_MSC_VER)
|
|
42
|
+
#define SK_ASSUME(cond) __assume(cond)
|
|
43
|
+
#else
|
|
44
|
+
#define SK_ASSUME(cond) ((void)0)
|
|
45
|
+
#endif
|
|
46
|
+
|
|
31
47
|
/** Called internally if we hit an unrecoverable error.
|
|
32
48
|
The platform implementation must not return, but should either throw
|
|
33
49
|
an exception or otherwise exit.
|
|
@@ -42,13 +42,8 @@ public:
|
|
|
42
42
|
const void* front() const { return fFront; }
|
|
43
43
|
const void* back() const { return fBack; }
|
|
44
44
|
|
|
45
|
-
void* front() {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
void* back() {
|
|
50
|
-
return (void*)((const SkDeque*)this)->back();
|
|
51
|
-
}
|
|
45
|
+
void* front() { return fFront; }
|
|
46
|
+
void* back() { return fBack; }
|
|
52
47
|
|
|
53
48
|
/**
|
|
54
49
|
* push_front and push_back return a pointer to the memory space
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// This is achieved in Skia by having a nested WORKSPACE in include/config and a cc_library
|
|
27
27
|
// defined in that folder. As a result, we do not try to include SkUserConfig.h from the
|
|
28
28
|
// top of Skia because Bazel sandboxing will move it to a different location.
|
|
29
|
-
#include "SkUserConfig.h"
|
|
29
|
+
#include "SkUserConfig.h" // NO_G3_REWRITE
|
|
30
30
|
#else
|
|
31
31
|
#include "include/config/SkUserConfig.h"
|
|
32
32
|
#endif
|
|
@@ -185,9 +185,8 @@ public:
|
|
|
185
185
|
bool empty() const { return fSize == 0; }
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
* Adds
|
|
189
|
-
*
|
|
190
|
-
* elements.
|
|
188
|
+
* Adds one new default-initialized T value and returns it by reference. Note that the reference
|
|
189
|
+
* only remains valid until the next call that adds or removes elements.
|
|
191
190
|
*/
|
|
192
191
|
T& push_back() {
|
|
193
192
|
void* newT = this->push_back_raw(1);
|
|
@@ -195,27 +194,52 @@ public:
|
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
/**
|
|
198
|
-
*
|
|
197
|
+
* Adds one new T value which is copy-constructed, returning it by reference. As always,
|
|
198
|
+
* the reference only remains valid until the next call that adds or removes elements.
|
|
199
199
|
*/
|
|
200
200
|
T& push_back(const T& t) {
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
T* newT;
|
|
202
|
+
if (this->capacity() > fSize) SK_LIKELY {
|
|
203
|
+
// Copy over the element directly.
|
|
204
|
+
newT = new (fData + fSize) T(t);
|
|
205
|
+
} else {
|
|
206
|
+
newT = this->growAndConstructAtEnd(t);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
fSize += 1;
|
|
210
|
+
return *newT;
|
|
203
211
|
}
|
|
204
212
|
|
|
205
213
|
/**
|
|
206
|
-
*
|
|
214
|
+
* Adds one new T value which is copy-constructed, returning it by reference.
|
|
207
215
|
*/
|
|
208
216
|
T& push_back(T&& t) {
|
|
209
|
-
|
|
210
|
-
|
|
217
|
+
T* newT;
|
|
218
|
+
if (this->capacity() > fSize) SK_LIKELY {
|
|
219
|
+
// Move over the element directly.
|
|
220
|
+
newT = new (fData + fSize) T(std::move(t));
|
|
221
|
+
} else {
|
|
222
|
+
newT = this->growAndConstructAtEnd(std::move(t));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
fSize += 1;
|
|
226
|
+
return *newT;
|
|
211
227
|
}
|
|
212
228
|
|
|
213
229
|
/**
|
|
214
|
-
*
|
|
230
|
+
* Constructs a new T at the back of this array, returning it by reference.
|
|
215
231
|
*/
|
|
216
|
-
template<
|
|
217
|
-
|
|
218
|
-
|
|
232
|
+
template <typename... Args> T& emplace_back(Args&&... args) {
|
|
233
|
+
T* newT;
|
|
234
|
+
if (this->capacity() > fSize) SK_LIKELY {
|
|
235
|
+
// Emplace the new element in directly.
|
|
236
|
+
newT = new (fData + fSize) T(std::forward<Args>(args)...);
|
|
237
|
+
} else {
|
|
238
|
+
newT = this->growAndConstructAtEnd(std::forward<Args>(args)...);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
fSize += 1;
|
|
242
|
+
return *newT;
|
|
219
243
|
}
|
|
220
244
|
|
|
221
245
|
/**
|
|
@@ -297,13 +321,15 @@ public:
|
|
|
297
321
|
}
|
|
298
322
|
|
|
299
323
|
/**
|
|
300
|
-
* Pushes or pops from the back to resize. Pushes will be default
|
|
301
|
-
* initialized.
|
|
324
|
+
* Pushes or pops from the back to resize. Pushes will be default initialized.
|
|
302
325
|
*/
|
|
303
326
|
void resize_back(int newCount) {
|
|
304
327
|
SkASSERT(newCount >= 0);
|
|
305
|
-
|
|
306
328
|
if (newCount > this->size()) {
|
|
329
|
+
if (this->empty()) {
|
|
330
|
+
// When the container is completely empty, grow to exactly the requested size.
|
|
331
|
+
this->checkRealloc(newCount, kExactFit);
|
|
332
|
+
}
|
|
307
333
|
this->push_back_n(newCount - fSize);
|
|
308
334
|
} else if (newCount < this->size()) {
|
|
309
335
|
this->pop_back_n(fSize - newCount);
|
|
@@ -357,7 +383,7 @@ public:
|
|
|
357
383
|
T* data() { return fData; }
|
|
358
384
|
const T* data() const { return fData; }
|
|
359
385
|
int size() const { return fSize; }
|
|
360
|
-
size_t size_bytes() const { return
|
|
386
|
+
size_t size_bytes() const { return Bytes(fSize); }
|
|
361
387
|
void resize(size_t count) { this->resize_back((int)count); }
|
|
362
388
|
|
|
363
389
|
void clear() {
|
|
@@ -503,7 +529,7 @@ private:
|
|
|
503
529
|
// to a full divide instruction. If done here the size is known at compile, and usually
|
|
504
530
|
// can be implemented by a right shift. The full divide takes ~50X longer than the shift.
|
|
505
531
|
size_t size = std::min(allocation.size() / sizeof(T), SkToSizeT(kMaxCapacity));
|
|
506
|
-
setData(SkSpan<T>(data, size));
|
|
532
|
+
this->setData(SkSpan<T>(data, size));
|
|
507
533
|
}
|
|
508
534
|
|
|
509
535
|
void setData(SkSpan<T> array) {
|
|
@@ -524,7 +550,7 @@ private:
|
|
|
524
550
|
return (T*)buffer;
|
|
525
551
|
}
|
|
526
552
|
|
|
527
|
-
size_t
|
|
553
|
+
static size_t Bytes(int n) {
|
|
528
554
|
SkASSERT(n <= kMaxCapacity);
|
|
529
555
|
return SkToSizeT(n) * sizeof(T);
|
|
530
556
|
}
|
|
@@ -577,10 +603,10 @@ private:
|
|
|
577
603
|
|
|
578
604
|
void move(void* dst) {
|
|
579
605
|
if constexpr (MEM_MOVE) {
|
|
580
|
-
sk_careful_memcpy(dst, fData,
|
|
606
|
+
sk_careful_memcpy(dst, fData, Bytes(fSize));
|
|
581
607
|
} else {
|
|
582
608
|
for (int i = 0; i < this->size(); ++i) {
|
|
583
|
-
new (static_cast<char*>(dst) +
|
|
609
|
+
new (static_cast<char*>(dst) + Bytes(i)) T(std::move(fData[i]));
|
|
584
610
|
fData[i].~T();
|
|
585
611
|
}
|
|
586
612
|
}
|
|
@@ -595,17 +621,31 @@ private:
|
|
|
595
621
|
return ptr;
|
|
596
622
|
}
|
|
597
623
|
|
|
624
|
+
template <typename... Args>
|
|
625
|
+
SK_ALWAYS_INLINE T* growAndConstructAtEnd(Args&&... args) {
|
|
626
|
+
SkSpan<std::byte> buffer = this->preallocateNewData(/*delta=*/1, kGrowing);
|
|
627
|
+
T* newT = new (TCast(buffer.data()) + fSize) T(std::forward<Args>(args)...);
|
|
628
|
+
this->installDataAndUpdateCapacity(buffer);
|
|
629
|
+
|
|
630
|
+
return newT;
|
|
631
|
+
}
|
|
632
|
+
|
|
598
633
|
void checkRealloc(int delta, double growthFactor) {
|
|
599
|
-
// This constant needs to be declared in the function where it is used to work around
|
|
600
|
-
// MSVC's persnickety nature about template definitions.
|
|
601
634
|
SkASSERT(delta >= 0);
|
|
602
635
|
SkASSERT(fSize >= 0);
|
|
603
636
|
SkASSERT(fCapacity >= 0);
|
|
604
637
|
|
|
605
|
-
//
|
|
606
|
-
if (this->capacity() - fSize
|
|
607
|
-
|
|
638
|
+
// Check if there are enough remaining allocated elements to satisfy the request.
|
|
639
|
+
if (this->capacity() - fSize < delta) {
|
|
640
|
+
// Looks like we need to reallocate.
|
|
641
|
+
this->installDataAndUpdateCapacity(this->preallocateNewData(delta, growthFactor));
|
|
608
642
|
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
SkSpan<std::byte> preallocateNewData(int delta, double growthFactor) {
|
|
646
|
+
SkASSERT(delta >= 0);
|
|
647
|
+
SkASSERT(fSize >= 0);
|
|
648
|
+
SkASSERT(fCapacity >= 0);
|
|
609
649
|
|
|
610
650
|
// Don't overflow fSize or size_t later in the memory allocation. Overflowing memory
|
|
611
651
|
// allocation really only applies to fSizes on 32-bit machines; on 64-bit machines this
|
|
@@ -616,14 +656,15 @@ private:
|
|
|
616
656
|
}
|
|
617
657
|
const int newCount = fSize + delta;
|
|
618
658
|
|
|
619
|
-
|
|
659
|
+
return Allocate(newCount, growthFactor);
|
|
660
|
+
}
|
|
620
661
|
|
|
662
|
+
void installDataAndUpdateCapacity(SkSpan<std::byte> allocation) {
|
|
621
663
|
this->move(TCast(allocation.data()));
|
|
622
664
|
if (fOwnMemory) {
|
|
623
665
|
sk_free(fData);
|
|
624
666
|
}
|
|
625
667
|
this->setDataFromBytes(allocation);
|
|
626
|
-
SkASSERT(this->capacity() >= newCount);
|
|
627
668
|
SkASSERT(fData != nullptr);
|
|
628
669
|
}
|
|
629
670
|
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#ifndef SkThreadAnnotations_DEFINED
|
|
9
9
|
#define SkThreadAnnotations_DEFINED
|
|
10
10
|
|
|
11
|
+
#include "include/private/base/SkFeatures.h" // IWYU pragma: keep
|
|
12
|
+
|
|
11
13
|
// The bulk of this code is cribbed from:
|
|
12
14
|
// http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
|
|
13
15
|
|
|
@@ -76,13 +78,24 @@
|
|
|
76
78
|
#define SK_NO_THREAD_SAFETY_ANALYSIS \
|
|
77
79
|
SK_THREAD_ANNOTATION_ATTRIBUTE(no_thread_safety_analysis)
|
|
78
80
|
|
|
79
|
-
#if defined(SK_BUILD_FOR_GOOGLE3) && !defined(SK_BUILD_FOR_WASM_IN_GOOGLE3)
|
|
81
|
+
#if defined(SK_BUILD_FOR_GOOGLE3) && !defined(SK_BUILD_FOR_WASM_IN_GOOGLE3) \
|
|
82
|
+
&& !defined(SK_BUILD_FOR_WIN)
|
|
80
83
|
extern "C" {
|
|
81
|
-
void __google_cxa_guard_acquire_begin(void);
|
|
82
|
-
void __google_cxa_guard_acquire_end (void);
|
|
84
|
+
void __google_cxa_guard_acquire_begin(void) __attribute__((weak));
|
|
85
|
+
void __google_cxa_guard_acquire_end (void) __attribute__((weak));
|
|
86
|
+
}
|
|
87
|
+
static inline void sk_potentially_blocking_region_begin() {
|
|
88
|
+
if (&__google_cxa_guard_acquire_begin) {
|
|
89
|
+
__google_cxa_guard_acquire_begin();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static inline void sk_potentially_blocking_region_end() {
|
|
93
|
+
if (&__google_cxa_guard_acquire_end) {
|
|
94
|
+
__google_cxa_guard_acquire_end();
|
|
95
|
+
}
|
|
83
96
|
}
|
|
84
|
-
#define SK_POTENTIALLY_BLOCKING_REGION_BEGIN
|
|
85
|
-
#define SK_POTENTIALLY_BLOCKING_REGION_END
|
|
97
|
+
#define SK_POTENTIALLY_BLOCKING_REGION_BEGIN sk_potentially_blocking_region_begin()
|
|
98
|
+
#define SK_POTENTIALLY_BLOCKING_REGION_END sk_potentially_blocking_region_end()
|
|
86
99
|
#else
|
|
87
100
|
#define SK_POTENTIALLY_BLOCKING_REGION_BEGIN
|
|
88
101
|
#define SK_POTENTIALLY_BLOCKING_REGION_END
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
class SK_API GrSurfaceCharacterization {
|
|
35
35
|
public:
|
|
36
36
|
enum class Textureable : bool { kNo = false, kYes = true };
|
|
37
|
-
enum class MipMapped : bool { kNo = false, kYes = true };
|
|
38
37
|
enum class UsesGLFBO0 : bool { kNo = false, kYes = true };
|
|
39
38
|
// This flag indicates that the backing VkImage for this Vulkan surface will have the
|
|
40
39
|
// VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set. This bit allows skia to handle advanced blends
|
|
@@ -48,12 +47,11 @@ public:
|
|
|
48
47
|
, fOrigin(kBottomLeft_GrSurfaceOrigin)
|
|
49
48
|
, fSampleCnt(0)
|
|
50
49
|
, fIsTextureable(Textureable::kYes)
|
|
51
|
-
,
|
|
50
|
+
, fIsMipmapped(skgpu::Mipmapped::kYes)
|
|
52
51
|
, fUsesGLFBO0(UsesGLFBO0::kNo)
|
|
53
52
|
, fVulkanSecondaryCBCompatible(VulkanSecondaryCBCompatible::kNo)
|
|
54
|
-
, fIsProtected(
|
|
55
|
-
, fSurfaceProps(
|
|
56
|
-
}
|
|
53
|
+
, fIsProtected(skgpu::Protected::kNo)
|
|
54
|
+
, fSurfaceProps() {}
|
|
57
55
|
|
|
58
56
|
GrSurfaceCharacterization(GrSurfaceCharacterization&&) = default;
|
|
59
57
|
GrSurfaceCharacterization& operator=(GrSurfaceCharacterization&&) = default;
|
|
@@ -103,7 +101,7 @@ public:
|
|
|
103
101
|
SkColorType colorType() const { return fImageInfo.colorType(); }
|
|
104
102
|
int sampleCount() const { return fSampleCnt; }
|
|
105
103
|
bool isTextureable() const { return Textureable::kYes == fIsTextureable; }
|
|
106
|
-
bool isMipMapped() const { return
|
|
104
|
+
bool isMipMapped() const { return skgpu::Mipmapped::kYes == fIsMipmapped; }
|
|
107
105
|
bool usesGLFBO0() const { return UsesGLFBO0::kYes == fUsesGLFBO0; }
|
|
108
106
|
bool vkRTSupportsInputAttachment() const {
|
|
109
107
|
return VkRTSupportsInputAttachment::kYes == fVkRTSupportsInputAttachment;
|
|
@@ -111,36 +109,34 @@ public:
|
|
|
111
109
|
bool vulkanSecondaryCBCompatible() const {
|
|
112
110
|
return VulkanSecondaryCBCompatible::kYes == fVulkanSecondaryCBCompatible;
|
|
113
111
|
}
|
|
114
|
-
|
|
112
|
+
skgpu::Protected isProtected() const { return fIsProtected; }
|
|
115
113
|
SkColorSpace* colorSpace() const { return fImageInfo.colorSpace(); }
|
|
116
114
|
sk_sp<SkColorSpace> refColorSpace() const { return fImageInfo.refColorSpace(); }
|
|
117
115
|
const SkSurfaceProps& surfaceProps()const { return fSurfaceProps; }
|
|
118
116
|
|
|
119
|
-
// Is the provided backend texture compatible with this surface characterization?
|
|
120
|
-
bool isCompatible(const GrBackendTexture&) const;
|
|
121
|
-
|
|
122
117
|
private:
|
|
123
118
|
friend class SkSurface_Ganesh; // for 'set' & 'config'
|
|
124
119
|
friend class GrVkSecondaryCBDrawContext; // for 'set' & 'config'
|
|
125
120
|
friend class GrContextThreadSafeProxy; // for private ctor
|
|
121
|
+
friend class GrVkContextThreadSafeProxy; // for private ctor
|
|
126
122
|
friend class GrDeferredDisplayListRecorder; // for 'config'
|
|
127
123
|
friend class SkSurface; // for 'config'
|
|
128
124
|
|
|
129
125
|
SkDEBUGCODE(void validate() const;)
|
|
130
126
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
GrSurfaceCharacterization(sk_sp<GrContextThreadSafeProxy> contextInfo,
|
|
128
|
+
size_t cacheMaxResourceBytes,
|
|
129
|
+
const SkImageInfo& ii,
|
|
130
|
+
const GrBackendFormat& backendFormat,
|
|
131
|
+
GrSurfaceOrigin origin,
|
|
132
|
+
int sampleCnt,
|
|
133
|
+
Textureable isTextureable,
|
|
134
|
+
skgpu::Mipmapped isMipmapped,
|
|
135
|
+
UsesGLFBO0 usesGLFBO0,
|
|
136
|
+
VkRTSupportsInputAttachment vkRTSupportsInputAttachment,
|
|
137
|
+
VulkanSecondaryCBCompatible vulkanSecondaryCBCompatible,
|
|
138
|
+
skgpu::Protected isProtected,
|
|
139
|
+
const SkSurfaceProps& surfaceProps)
|
|
144
140
|
: fContextInfo(std::move(contextInfo))
|
|
145
141
|
, fCacheMaxResourceBytes(cacheMaxResourceBytes)
|
|
146
142
|
, fImageInfo(ii)
|
|
@@ -148,7 +144,7 @@ private:
|
|
|
148
144
|
, fOrigin(origin)
|
|
149
145
|
, fSampleCnt(sampleCnt)
|
|
150
146
|
, fIsTextureable(isTextureable)
|
|
151
|
-
,
|
|
147
|
+
, fIsMipmapped(isMipmapped)
|
|
152
148
|
, fUsesGLFBO0(usesGLFBO0)
|
|
153
149
|
, fVkRTSupportsInputAttachment(vkRTSupportsInputAttachment)
|
|
154
150
|
, fVulkanSecondaryCBCompatible(vulkanSecondaryCBCompatible)
|
|
@@ -168,17 +164,17 @@ private:
|
|
|
168
164
|
GrSurfaceOrigin origin,
|
|
169
165
|
int sampleCnt,
|
|
170
166
|
Textureable isTextureable,
|
|
171
|
-
|
|
167
|
+
skgpu::Mipmapped isMipmapped,
|
|
172
168
|
UsesGLFBO0 usesGLFBO0,
|
|
173
169
|
VkRTSupportsInputAttachment vkRTSupportsInputAttachment,
|
|
174
170
|
VulkanSecondaryCBCompatible vulkanSecondaryCBCompatible,
|
|
175
|
-
|
|
171
|
+
skgpu::Protected isProtected,
|
|
176
172
|
const SkSurfaceProps& surfaceProps) {
|
|
177
173
|
if (surfaceProps.flags() & SkSurfaceProps::kDynamicMSAA_Flag) {
|
|
178
174
|
// Dynamic MSAA is not currently supported with DDL.
|
|
179
175
|
*this = {};
|
|
180
176
|
} else {
|
|
181
|
-
fContextInfo = contextInfo;
|
|
177
|
+
fContextInfo = std::move(contextInfo);
|
|
182
178
|
fCacheMaxResourceBytes = cacheMaxResourceBytes;
|
|
183
179
|
|
|
184
180
|
fImageInfo = ii;
|
|
@@ -186,7 +182,7 @@ private:
|
|
|
186
182
|
fOrigin = origin;
|
|
187
183
|
fSampleCnt = sampleCnt;
|
|
188
184
|
fIsTextureable = isTextureable;
|
|
189
|
-
|
|
185
|
+
fIsMipmapped = isMipmapped;
|
|
190
186
|
fUsesGLFBO0 = usesGLFBO0;
|
|
191
187
|
fVkRTSupportsInputAttachment = vkRTSupportsInputAttachment;
|
|
192
188
|
fVulkanSecondaryCBCompatible = vulkanSecondaryCBCompatible;
|
|
@@ -204,11 +200,11 @@ private:
|
|
|
204
200
|
GrSurfaceOrigin fOrigin;
|
|
205
201
|
int fSampleCnt;
|
|
206
202
|
Textureable fIsTextureable;
|
|
207
|
-
|
|
203
|
+
skgpu::Mipmapped fIsMipmapped;
|
|
208
204
|
UsesGLFBO0 fUsesGLFBO0;
|
|
209
205
|
VkRTSupportsInputAttachment fVkRTSupportsInputAttachment;
|
|
210
206
|
VulkanSecondaryCBCompatible fVulkanSecondaryCBCompatible;
|
|
211
|
-
|
|
207
|
+
skgpu::Protected fIsProtected;
|
|
212
208
|
SkSurfaceProps fSurfaceProps;
|
|
213
209
|
};
|
|
214
210
|
|
|
@@ -78,9 +78,10 @@ public:
|
|
|
78
78
|
commands for this secondary CB. The wait semaphores will get added to the VkCommandBuffer
|
|
79
79
|
owned by this GrContext when flush() is called, and not the command buffer which the
|
|
80
80
|
Secondary CB is from. This will guarantee that the driver waits on the semaphores before
|
|
81
|
-
the secondary command buffer gets executed.
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
the secondary command buffer gets executed. We will submit the semphore to wait at
|
|
82
|
+
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT and VK_PIPELINE_STAGE_TRANSFER_BIT. If this
|
|
83
|
+
call returns false, then the GPU back end will not wait on any passed in semaphores, and the
|
|
84
|
+
client will still own the semaphores, regardless of the value of deleteSemaphoresAfterWait.
|
|
84
85
|
|
|
85
86
|
If deleteSemaphoresAfterWait is false then Skia will not delete the semaphores. In this case
|
|
86
87
|
it is the client's responsibility to not destroy or attempt to reuse the semaphores until it
|
|
@@ -108,7 +108,7 @@ SK_API sk_sp<SkImage> PromiseTextureFromYUVA(sk_sp<GrContextThreadSafeProxy> gpu
|
|
|
108
108
|
around forever.
|
|
109
109
|
*/
|
|
110
110
|
SK_API GrDirectContext* GetContext(const SkImage* src);
|
|
111
|
-
inline GrDirectContext* GetContext(sk_sp<const SkImage
|
|
111
|
+
inline GrDirectContext* GetContext(const sk_sp<const SkImage>& src) {
|
|
112
112
|
return GetContext(src.get());
|
|
113
113
|
}
|
|
114
114
|
|