@shopify/react-native-skia 0.1.233 → 0.1.236
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +0 -1
- package/android/cpp/jni/JniSkiaManager.cpp +0 -1
- package/android/cpp/rnskia-android/RNSkAndroidView.h +0 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +1 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +1 -2
- package/cpp/api/JsiSkTypefaceFactory.h +2 -1
- 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 +3 -2
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +56 -57
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.d.ts +1 -0
- package/lib/commonjs/external/reanimated/index.js +13 -0
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.js +16 -2
- 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 +52 -0
- package/lib/commonjs/external/reanimated/textures.js.map +1 -0
- package/lib/commonjs/headless/index.js +1 -1
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +3 -0
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +6 -5
- 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/Offscreen.d.ts +1 -0
- package/lib/commonjs/renderer/Offscreen.js +18 -5
- 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/skia/types/Matrix4.d.ts +2 -2
- package/lib/commonjs/skia/types/Matrix4.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/web/JsiSkPath.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPath.js +10 -2
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/views/SkiaJSDomView.d.ts +31 -0
- package/lib/commonjs/views/SkiaJSDomView.js +161 -0
- package/lib/commonjs/views/SkiaJSDomView.js.map +1 -0
- package/lib/commonjs/views/SkiaJSDomView.web.d.ts +1 -0
- package/lib/commonjs/views/SkiaJSDomView.web.js +14 -0
- package/lib/commonjs/views/SkiaJSDomView.web.js.map +1 -0
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -2
- package/lib/module/dom/nodes/JsiSkDOM.js +56 -56
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/external/reanimated/index.d.ts +1 -0
- package/lib/module/external/reanimated/index.js +1 -0
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.js +15 -2
- 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 +35 -0
- package/lib/module/external/reanimated/textures.js.map +1 -0
- package/lib/module/headless/index.js +1 -1
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/mock/index.js +3 -0
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +5 -4
- 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/Offscreen.d.ts +1 -0
- package/lib/module/renderer/Offscreen.js +11 -3
- 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/skia/types/Matrix4.d.ts +2 -2
- package/lib/module/skia/types/Matrix4.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/web/JsiSkPath.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPath.js +10 -2
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/views/SkiaJSDomView.d.ts +31 -0
- package/lib/module/views/SkiaJSDomView.js +136 -0
- package/lib/module/views/SkiaJSDomView.js.map +1 -0
- package/lib/module/views/SkiaJSDomView.web.d.ts +1 -0
- package/lib/module/views/SkiaJSDomView.web.js +2 -0
- package/lib/module/views/SkiaJSDomView.web.js.map +1 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -2
- package/lib/typescript/src/external/reanimated/index.d.ts +1 -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/Offscreen.d.ts +1 -0
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/typescript/src/views/SkiaJSDomView.d.ts +31 -0
- package/lib/typescript/src/views/SkiaJSDomView.web.d.ts +1 -0
- 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 +55 -56
- package/src/external/reanimated/index.ts +1 -0
- package/src/external/reanimated/interpolators.ts +17 -3
- package/src/external/reanimated/moduleWrapper.ts +1 -0
- package/src/external/reanimated/textures.tsx +50 -0
- package/src/headless/index.ts +1 -1
- package/src/mock/index.ts +3 -0
- package/src/renderer/Canvas.tsx +4 -3
- package/src/renderer/Container.tsx +3 -2
- package/src/renderer/Offscreen.tsx +12 -3
- package/src/renderer/Reconciler.tsx +5 -2
- package/src/skia/types/Matrix4.ts +2 -2
- package/src/skia/types/Shader/Shader.ts +6 -1
- package/src/skia/web/JsiSkPath.ts +23 -3
- package/src/views/SkiaJSDomView.tsx +126 -0
- package/src/views/SkiaJSDomView.web.tsx +1 -0
- package/android/cpp/jni/include/JniSkiaDrawView.h +0 -90
- package/cpp/rnskia/RNSkJsView.cpp +0 -236
- package/cpp/rnskia/RNSkJsView.h +0 -121
- 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
@@ -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
|
|
@@ -500,11 +500,6 @@ enum class GrBackendObjectOwnership : bool {
|
|
500
500
|
kOwned = true
|
501
501
|
};
|
502
502
|
|
503
|
-
/*
|
504
|
-
* Object for CPU-GPU synchronization
|
505
|
-
*/
|
506
|
-
typedef uint64_t GrFence;
|
507
|
-
|
508
503
|
/**
|
509
504
|
* Used to include or exclude specific GPU path renderers for testing purposes.
|
510
505
|
*/
|
@@ -546,6 +541,7 @@ enum class GrColorType {
|
|
546
541
|
kUnknown,
|
547
542
|
kAlpha_8,
|
548
543
|
kBGR_565,
|
544
|
+
kRGB_565,
|
549
545
|
kABGR_4444, // This name differs from SkColorType. kARGB_4444_SkColorType is misnamed.
|
550
546
|
kRGBA_8888,
|
551
547
|
kRGBA_8888_SRGB,
|
@@ -595,6 +591,7 @@ static constexpr SkColorType GrColorTypeToSkColorType(GrColorType ct) {
|
|
595
591
|
case GrColorType::kUnknown: return kUnknown_SkColorType;
|
596
592
|
case GrColorType::kAlpha_8: return kAlpha_8_SkColorType;
|
597
593
|
case GrColorType::kBGR_565: return kRGB_565_SkColorType;
|
594
|
+
case GrColorType::kRGB_565: return kUnknown_SkColorType;
|
598
595
|
case GrColorType::kABGR_4444: return kARGB_4444_SkColorType;
|
599
596
|
case GrColorType::kRGBA_8888: return kRGBA_8888_SkColorType;
|
600
597
|
case GrColorType::kRGBA_8888_SRGB: return kSRGBA_8888_SkColorType;
|
@@ -665,6 +662,7 @@ static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct) {
|
|
665
662
|
case GrColorType::kUnknown: return 0;
|
666
663
|
case GrColorType::kAlpha_8: return kAlpha_SkColorChannelFlag;
|
667
664
|
case GrColorType::kBGR_565: return kRGB_SkColorChannelFlags;
|
665
|
+
case GrColorType::kRGB_565: return kRGB_SkColorChannelFlags;
|
668
666
|
case GrColorType::kABGR_4444: return kRGBA_SkColorChannelFlags;
|
669
667
|
case GrColorType::kRGBA_8888: return kRGBA_SkColorChannelFlags;
|
670
668
|
case GrColorType::kRGBA_8888_SRGB: return kRGBA_SkColorChannelFlags;
|
@@ -800,6 +798,8 @@ static constexpr GrColorFormatDesc GrGetColorTypeDesc(GrColorType ct) {
|
|
800
798
|
return GrColorFormatDesc::MakeAlpha(8, GrColorTypeEncoding::kUnorm);
|
801
799
|
case GrColorType::kBGR_565:
|
802
800
|
return GrColorFormatDesc::MakeRGB(5, 6, 5, GrColorTypeEncoding::kUnorm);
|
801
|
+
case GrColorType::kRGB_565:
|
802
|
+
return GrColorFormatDesc::MakeRGB(5, 6, 5, GrColorTypeEncoding::kUnorm);
|
803
803
|
case GrColorType::kABGR_4444:
|
804
804
|
return GrColorFormatDesc::MakeRGBA(4, GrColorTypeEncoding::kUnorm);
|
805
805
|
case GrColorType::kRGBA_8888:
|
@@ -897,6 +897,7 @@ static constexpr size_t GrColorTypeBytesPerPixel(GrColorType ct) {
|
|
897
897
|
case GrColorType::kUnknown: return 0;
|
898
898
|
case GrColorType::kAlpha_8: return 1;
|
899
899
|
case GrColorType::kBGR_565: return 2;
|
900
|
+
case GrColorType::kRGB_565: return 2;
|
900
901
|
case GrColorType::kABGR_4444: return 2;
|
901
902
|
case GrColorType::kRGBA_8888: return 4;
|
902
903
|
case GrColorType::kRGBA_8888_SRGB: return 4;
|
@@ -970,7 +971,8 @@ static constexpr const char* GrColorTypeToStr(GrColorType ct) {
|
|
970
971
|
switch (ct) {
|
971
972
|
case GrColorType::kUnknown: return "kUnknown";
|
972
973
|
case GrColorType::kAlpha_8: return "kAlpha_8";
|
973
|
-
case GrColorType::kBGR_565: return "
|
974
|
+
case GrColorType::kBGR_565: return "kBGR_565";
|
975
|
+
case GrColorType::kRGB_565: return "kRGB_565";
|
974
976
|
case GrColorType::kABGR_4444: return "kABGR_4444";
|
975
977
|
case GrColorType::kRGBA_8888: return "kRGBA_8888";
|
976
978
|
case GrColorType::kRGBA_8888_SRGB: return "kRGBA_8888_SRGB";
|
@@ -10,6 +10,33 @@
|
|
10
10
|
|
11
11
|
namespace skgpu::graphite {
|
12
12
|
|
13
|
+
/**
|
14
|
+
* Used to include or exclude a specific path rendering technique for testing purposes.
|
15
|
+
*/
|
16
|
+
enum class PathRendererStrategy {
|
17
|
+
/**
|
18
|
+
* Graphite selects the best path rendering technique for each shape. This is the default
|
19
|
+
* behavior.
|
20
|
+
*/
|
21
|
+
kDefault,
|
22
|
+
|
23
|
+
/**
|
24
|
+
* All paths are rasterized into coverage masks using a GPU compute approach. This method
|
25
|
+
* always uses analytic anti-aliasing.
|
26
|
+
*/
|
27
|
+
kComputeAnalyticAA,
|
28
|
+
|
29
|
+
/**
|
30
|
+
* All paths are rasterized into coverage masks using the CPU raster backend.
|
31
|
+
*/
|
32
|
+
kRasterAA,
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Render paths using tessellation and stencil-and-cover.
|
36
|
+
*/
|
37
|
+
kTessellation,
|
38
|
+
};
|
39
|
+
|
13
40
|
/**
|
14
41
|
* Private options that are only meant for testing within Skia's tools.
|
15
42
|
*/
|
@@ -27,6 +54,8 @@ struct ContextOptionsPriv {
|
|
27
54
|
* that created it. Used by readPixels() and other methods that normally require a Context.
|
28
55
|
*/
|
29
56
|
bool fStoreContextRefInRecorder = false;
|
57
|
+
|
58
|
+
PathRendererStrategy fPathRendererStrategy = PathRendererStrategy::kDefault;
|
30
59
|
};
|
31
60
|
|
32
61
|
} // namespace skgpu::graphite
|
@@ -16,30 +16,33 @@ namespace skgpu::graphite {
|
|
16
16
|
struct DawnTextureSpec {
|
17
17
|
DawnTextureSpec()
|
18
18
|
: fFormat(wgpu::TextureFormat::Undefined)
|
19
|
-
, fUsage(wgpu::TextureUsage::None)
|
19
|
+
, fUsage(wgpu::TextureUsage::None)
|
20
|
+
, fAspect(wgpu::TextureAspect::All) {}
|
20
21
|
DawnTextureSpec(const DawnTextureInfo& info)
|
21
|
-
: fFormat(info.fFormat)
|
22
|
-
, fUsage(info.fUsage) {}
|
22
|
+
: fFormat(info.fFormat), fUsage(info.fUsage), fAspect(info.fAspect) {}
|
23
23
|
|
24
24
|
bool operator==(const DawnTextureSpec& that) const {
|
25
|
-
return fUsage == that.fUsage &&
|
26
|
-
fFormat == that.fFormat;
|
25
|
+
return fUsage == that.fUsage && fFormat == that.fFormat && fAspect == that.fAspect;
|
27
26
|
}
|
28
27
|
|
29
28
|
bool isCompatible(const DawnTextureSpec& that) const {
|
30
29
|
// The usages may match or the usage passed in may be a superset of the usage stored within.
|
31
|
-
|
32
|
-
|
30
|
+
// The aspect should either match the plane aspect or should be All.
|
31
|
+
return fFormat == that.fFormat && (fUsage & that.fUsage) == fUsage &&
|
32
|
+
(fAspect == that.fAspect || fAspect == wgpu::TextureAspect::All);
|
33
33
|
}
|
34
34
|
|
35
35
|
SkString toString() const {
|
36
|
-
return SkStringPrintf("format=0x%08X,usage=0x%08X",
|
36
|
+
return SkStringPrintf("format=0x%08X,usage=0x%08X,aspect=0x%08X",
|
37
37
|
static_cast<unsigned int>(fFormat),
|
38
|
-
static_cast<unsigned int>(fUsage)
|
38
|
+
static_cast<unsigned int>(fUsage),
|
39
|
+
static_cast<unsigned int>(fAspect));
|
39
40
|
}
|
40
41
|
|
42
|
+
// `fFormat` is always single plane format or plane view format for a multiplanar wgpu::Texture.
|
41
43
|
wgpu::TextureFormat fFormat;
|
42
44
|
wgpu::TextureUsage fUsage;
|
45
|
+
wgpu::TextureAspect fAspect;
|
43
46
|
};
|
44
47
|
|
45
48
|
DawnTextureInfo DawnTextureSpecToTextureInfo(const DawnTextureSpec& dawnSpec,
|
@@ -10,6 +10,7 @@
|
|
10
10
|
|
11
11
|
#include "include/core/SkString.h"
|
12
12
|
#include "include/gpu/graphite/vk/VulkanGraphiteTypes.h"
|
13
|
+
#include "include/private/gpu/vk/SkiaVulkan.h"
|
13
14
|
|
14
15
|
namespace skgpu::graphite {
|
15
16
|
|
@@ -20,14 +21,16 @@ struct VulkanTextureSpec {
|
|
20
21
|
, fImageTiling(VK_IMAGE_TILING_OPTIMAL)
|
21
22
|
, fImageUsageFlags(0)
|
22
23
|
, fSharingMode(VK_SHARING_MODE_EXCLUSIVE)
|
23
|
-
, fAspectMask(VK_IMAGE_ASPECT_COLOR_BIT)
|
24
|
+
, fAspectMask(VK_IMAGE_ASPECT_COLOR_BIT)
|
25
|
+
, fYcbcrConversionInfo({}) {}
|
24
26
|
VulkanTextureSpec(const VulkanTextureInfo& info)
|
25
27
|
: fFlags(info.fFlags)
|
26
28
|
, fFormat(info.fFormat)
|
27
29
|
, fImageTiling(info.fImageTiling)
|
28
30
|
, fImageUsageFlags(info.fImageUsageFlags)
|
29
31
|
, fSharingMode(info.fSharingMode)
|
30
|
-
, fAspectMask(info.fAspectMask)
|
32
|
+
, fAspectMask(info.fAspectMask)
|
33
|
+
, fYcbcrConversionInfo(info.fYcbcrConversionInfo) {}
|
31
34
|
|
32
35
|
bool operator==(const VulkanTextureSpec& that) const {
|
33
36
|
return fFlags == that.fFlags &&
|
@@ -35,7 +38,8 @@ struct VulkanTextureSpec {
|
|
35
38
|
fImageTiling == that.fImageTiling &&
|
36
39
|
fImageUsageFlags == that.fImageUsageFlags &&
|
37
40
|
fSharingMode == that.fSharingMode &&
|
38
|
-
fAspectMask == that.fAspectMask
|
41
|
+
fAspectMask == that.fAspectMask &&
|
42
|
+
fYcbcrConversionInfo == that.fYcbcrConversionInfo;
|
39
43
|
}
|
40
44
|
|
41
45
|
bool isCompatible(const VulkanTextureSpec& that) const {
|
@@ -45,7 +49,8 @@ struct VulkanTextureSpec {
|
|
45
49
|
fImageTiling == that.fImageTiling &&
|
46
50
|
fSharingMode == that.fSharingMode &&
|
47
51
|
fAspectMask == that.fAspectMask &&
|
48
|
-
(fImageUsageFlags & that.fImageUsageFlags) == fImageUsageFlags
|
52
|
+
(fImageUsageFlags & that.fImageUsageFlags) == fImageUsageFlags &&
|
53
|
+
fYcbcrConversionInfo == that.fYcbcrConversionInfo;
|
49
54
|
}
|
50
55
|
|
51
56
|
SkString toString() const {
|
@@ -60,13 +65,13 @@ struct VulkanTextureSpec {
|
|
60
65
|
fAspectMask);
|
61
66
|
}
|
62
67
|
|
63
|
-
VkImageCreateFlags
|
64
|
-
VkFormat
|
65
|
-
VkImageTiling
|
66
|
-
VkImageUsageFlags
|
67
|
-
VkSharingMode
|
68
|
-
VkImageAspectFlags
|
69
|
-
|
68
|
+
VkImageCreateFlags fFlags;
|
69
|
+
VkFormat fFormat;
|
70
|
+
VkImageTiling fImageTiling;
|
71
|
+
VkImageUsageFlags fImageUsageFlags;
|
72
|
+
VkSharingMode fSharingMode;
|
73
|
+
VkImageAspectFlags fAspectMask;
|
74
|
+
VulkanYcbcrConversionInfo fYcbcrConversionInfo;
|
70
75
|
};
|
71
76
|
|
72
77
|
VulkanTextureInfo VulkanTextureSpecToTextureInfo(const VulkanTextureSpec& vkSpec,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// File: vk_platform.h
|
3
3
|
//
|
4
4
|
/*
|
5
|
-
** Copyright 2014-
|
5
|
+
** Copyright 2014-2023 The Khronos Group Inc.
|
6
6
|
**
|
7
7
|
** SPDX-License-Identifier: Apache-2.0
|
8
8
|
*/
|
@@ -42,7 +42,7 @@ extern "C"
|
|
42
42
|
#define VKAPI_CALL __stdcall
|
43
43
|
#define VKAPI_PTR VKAPI_CALL
|
44
44
|
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
45
|
-
#error "Vulkan
|
45
|
+
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
|
46
46
|
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
47
47
|
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
48
48
|
// calling convention, i.e. float parameters are passed in registers. This
|