@shopify/react-native-skia 0.1.234 → 0.1.236
Sign up to get free protection for your applications and to get access to all the features.
- 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 +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 +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 +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/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/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 +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 +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 +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/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/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/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 +15 -2
- 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 +1 -1
- 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/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
@@ -18,9 +18,11 @@
|
|
18
18
|
#include <chrono>
|
19
19
|
#include <vector>
|
20
20
|
|
21
|
+
struct AHardwareBuffer;
|
21
22
|
class SkCanvas;
|
22
23
|
struct SkImageInfo;
|
23
24
|
class SkPixmap;
|
25
|
+
class SkTraceMemoryDump;
|
24
26
|
|
25
27
|
namespace skgpu {
|
26
28
|
class RefCntedCallback;
|
@@ -65,7 +67,7 @@ struct SK_API RecorderOptions final {
|
|
65
67
|
|
66
68
|
sk_sp<ImageProvider> fImageProvider;
|
67
69
|
|
68
|
-
|
70
|
+
static constexpr size_t kDefaultRecorderBudget = 256 * (1 << 20);
|
69
71
|
// What is the budget for GPU resources allocated and held by this Recorder.
|
70
72
|
size_t fGpuBudgetInBytes = kDefaultRecorderBudget;
|
71
73
|
};
|
@@ -79,6 +81,8 @@ public:
|
|
79
81
|
|
80
82
|
~Recorder();
|
81
83
|
|
84
|
+
BackendApi backend() const;
|
85
|
+
|
82
86
|
std::unique_ptr<Recording> snap();
|
83
87
|
|
84
88
|
ImageProvider* clientImageProvider() { return fClientImageProvider.get(); }
|
@@ -97,6 +101,14 @@ public:
|
|
97
101
|
*/
|
98
102
|
BackendTexture createBackendTexture(SkISize dimensions, const TextureInfo&);
|
99
103
|
|
104
|
+
#ifdef SK_BUILD_FOR_ANDROID
|
105
|
+
BackendTexture createBackendTexture(AHardwareBuffer*,
|
106
|
+
bool isRenderable,
|
107
|
+
bool isProtectedContent,
|
108
|
+
SkISize dimensions,
|
109
|
+
bool fromAndroidWindow = false) const;
|
110
|
+
#endif
|
111
|
+
|
100
112
|
/**
|
101
113
|
* If possible, updates a backend texture with the provided pixmap data. The client
|
102
114
|
* should check the return value to see if the update was successful. The client is required
|
@@ -154,6 +166,17 @@ public:
|
|
154
166
|
*/
|
155
167
|
void performDeferredCleanup(std::chrono::milliseconds msNotUsed);
|
156
168
|
|
169
|
+
/**
|
170
|
+
* Returns the number of bytes of gpu memory currently budgeted in the Recorder's cache.
|
171
|
+
*/
|
172
|
+
size_t currentBudgetedBytes() const;
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Enumerates all cached GPU resources owned by the Recorder and dumps their memory to
|
176
|
+
* traceMemoryDump.
|
177
|
+
*/
|
178
|
+
void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const;
|
179
|
+
|
157
180
|
// Provides access to functions that aren't part of the public API.
|
158
181
|
RecorderPriv priv();
|
159
182
|
const RecorderPriv priv() const; // NOLINT(readability-const-return-type)
|
@@ -167,8 +190,6 @@ private:
|
|
167
190
|
|
168
191
|
SingleOwner* singleOwner() const { return &fSingleOwner; }
|
169
192
|
|
170
|
-
BackendApi backend() const;
|
171
|
-
|
172
193
|
// We keep track of all Devices that are connected to a Recorder. This allows the client to
|
173
194
|
// safely delete an SkSurface or a Recorder in any order. If the client deletes the Recorder
|
174
195
|
// we need to notify all Devices that the Recorder is no longer valid. If we delete the
|
@@ -21,8 +21,11 @@ class Recorder;
|
|
21
21
|
} // namespace skgpu::graphite
|
22
22
|
|
23
23
|
namespace SkSurfaces {
|
24
|
+
using ReleaseContext = void*;
|
25
|
+
using TextureReleaseProc = void (*)(ReleaseContext);
|
26
|
+
|
24
27
|
/**
|
25
|
-
* The '
|
28
|
+
* The 'AsImage' and 'AsImageCopy' API/entry points are currently only available for
|
26
29
|
* Graphite.
|
27
30
|
*
|
28
31
|
* In this API, SkSurface no longer supports copy-on-write behavior. Instead, when creating
|
@@ -75,7 +78,9 @@ SK_API sk_sp<SkSurface> WrapBackendTexture(skgpu::graphite::Recorder*,
|
|
75
78
|
const skgpu::graphite::BackendTexture&,
|
76
79
|
SkColorType colorType,
|
77
80
|
sk_sp<SkColorSpace> colorSpace,
|
78
|
-
const SkSurfaceProps* props
|
81
|
+
const SkSurfaceProps* props,
|
82
|
+
TextureReleaseProc = nullptr,
|
83
|
+
ReleaseContext = nullptr);
|
79
84
|
} // namespace SkSurfaces
|
80
85
|
|
81
86
|
#endif // skgpu_graphite_Surface_DEFINED
|
@@ -8,16 +8,55 @@
|
|
8
8
|
#ifndef skgpu_graphite_DawnBackendContext_DEFINED
|
9
9
|
#define skgpu_graphite_DawnBackendContext_DEFINED
|
10
10
|
|
11
|
-
#include "
|
11
|
+
#include "include/core/SkTypes.h"
|
12
|
+
#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
|
12
13
|
|
13
14
|
namespace skgpu::graphite {
|
14
15
|
|
16
|
+
/**
|
17
|
+
* WebGPU needs to allow the main thread loop to run to detect GPU progress. Dawn native has a
|
18
|
+
* function wgpu::Dawn::Tick(), not present in WebGPU, that can be used to detect GPU progress.
|
19
|
+
*
|
20
|
+
* When compiling using Emscripten/WASM the -s ASYNCIFY option can be used to yield. E.g.:
|
21
|
+
*
|
22
|
+
* EM_ASYNC_JS(void, asyncSleep, (), {
|
23
|
+
* await new Promise((resolve, _) = > {
|
24
|
+
* setTimeout(resolve, 0);
|
25
|
+
* })
|
26
|
+
* });
|
27
|
+
*
|
28
|
+
* WebGPUTickFunction(wgpu::Device&) { asyncSleep(); }
|
29
|
+
*
|
30
|
+
* If no DawnTickFunction is provided then the graphite::Context will be "non-yielding". This
|
31
|
+
* implies the following restrictions on the Context:
|
32
|
+
*
|
33
|
+
* 1) SyncToCpu::kYes is disallowed as a parameter to Context::submit.
|
34
|
+
* 2) The client must guarantee that GPU work has completed before destroying Context as Context
|
35
|
+
* cannot await the work completion in its destructor. Context reports whether it is awaiting
|
36
|
+
* GPU work completion via Context::hasUnfinishedGpuWork().
|
37
|
+
*
|
38
|
+
* Using a non-yielding Context makes it possible to build and run Graphite/Dawn on WebGPU without
|
39
|
+
* -s ASYNCIFY.
|
40
|
+
*/
|
41
|
+
using DawnTickFunction = void(const wgpu::Device& device);
|
42
|
+
|
43
|
+
#if !defined(__EMSCRIPTEN__)
|
44
|
+
SK_API inline void DawnNativeTickFunction(const wgpu::Device& device) { device.Tick(); }
|
45
|
+
#endif
|
46
|
+
|
15
47
|
// The DawnBackendContext contains all of the base Dawn objects needed by the graphite Dawn
|
16
48
|
// backend. The client will create this object and pass it into the Context::MakeDawn factory call
|
17
49
|
// when setting up Skia.
|
18
50
|
struct SK_API DawnBackendContext {
|
19
51
|
wgpu::Device fDevice;
|
20
|
-
wgpu::Queue
|
52
|
+
wgpu::Queue fQueue;
|
53
|
+
// See comment on DawnTickFunction.
|
54
|
+
DawnTickFunction* fTick =
|
55
|
+
#if defined(__EMSCRIPTEN__)
|
56
|
+
nullptr;
|
57
|
+
#else
|
58
|
+
DawnNativeTickFunction;
|
59
|
+
#endif
|
21
60
|
};
|
22
61
|
|
23
62
|
} // namespace skgpu::graphite
|
@@ -9,7 +9,7 @@
|
|
9
9
|
#define skgpu_graphite_DawnTypes_DEFINED
|
10
10
|
|
11
11
|
#include "include/gpu/graphite/GraphiteTypes.h"
|
12
|
-
#include "webgpu/webgpu_cpp.h"
|
12
|
+
#include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
|
13
13
|
|
14
14
|
namespace skgpu::graphite {
|
15
15
|
|
@@ -18,19 +18,24 @@ struct DawnTextureInfo {
|
|
18
18
|
Mipmapped fMipmapped = Mipmapped::kNo;
|
19
19
|
|
20
20
|
// wgpu::TextureDescriptor properties
|
21
|
+
// `fFormat` for multiplanar formats corresponds to the plane TextureView's format.
|
21
22
|
wgpu::TextureFormat fFormat = wgpu::TextureFormat::Undefined;
|
22
|
-
wgpu::TextureUsage
|
23
|
+
wgpu::TextureUsage fUsage = wgpu::TextureUsage::None;
|
24
|
+
// TODO(b/308944094): Migrate aspect information to BackendTextureViews.
|
25
|
+
wgpu::TextureAspect fAspect = wgpu::TextureAspect::All;
|
23
26
|
|
24
27
|
DawnTextureInfo() = default;
|
25
28
|
DawnTextureInfo(const wgpu::Texture& texture);
|
26
29
|
DawnTextureInfo(uint32_t sampleCount,
|
27
30
|
Mipmapped mipmapped,
|
28
|
-
wgpu::TextureFormat
|
29
|
-
wgpu::TextureUsage usage
|
31
|
+
wgpu::TextureFormat viewFormat,
|
32
|
+
wgpu::TextureUsage usage,
|
33
|
+
wgpu::TextureAspect aspect)
|
30
34
|
: fSampleCount(sampleCount)
|
31
35
|
, fMipmapped(mipmapped)
|
32
|
-
, fFormat(
|
33
|
-
, fUsage(usage)
|
36
|
+
, fFormat(viewFormat)
|
37
|
+
, fUsage(usage)
|
38
|
+
, fAspect(aspect) {}
|
34
39
|
};
|
35
40
|
|
36
41
|
} // namespace skgpu::graphite
|
@@ -35,7 +35,6 @@ namespace skgpu::graphite {
|
|
35
35
|
using MtlPixelFormat = unsigned int;
|
36
36
|
using MtlTextureUsage = unsigned int;
|
37
37
|
using MtlStorageMode = unsigned int;
|
38
|
-
using MtlHandle = const void*;
|
39
38
|
|
40
39
|
struct MtlTextureInfo {
|
41
40
|
uint32_t fSampleCount = 1;
|
@@ -49,7 +48,7 @@ struct MtlTextureInfo {
|
|
49
48
|
bool fFramebufferOnly = false;
|
50
49
|
|
51
50
|
MtlTextureInfo() = default;
|
52
|
-
MtlTextureInfo(
|
51
|
+
MtlTextureInfo(CFTypeRef mtlTexture);
|
53
52
|
MtlTextureInfo(uint32_t sampleCount,
|
54
53
|
skgpu::Mipmapped mipmapped,
|
55
54
|
MtlPixelFormat format,
|
@@ -33,10 +33,8 @@ struct VulkanTextureInfo {
|
|
33
33
|
// However, if the VkImage is a Ycbcr format, the client can pass a specific plan here to have
|
34
34
|
// Skia directly sample a plane. In that case the client should also pass in a VkFormat that is
|
35
35
|
// compatible with the plane as described by the Vulkan spec.
|
36
|
-
VkImageAspectFlags
|
37
|
-
|
38
|
-
// Graphite.
|
39
|
-
// GrVkYcbcrConversionInfo fYcbcrConversionInfo;
|
36
|
+
VkImageAspectFlags fAspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
37
|
+
VulkanYcbcrConversionInfo fYcbcrConversionInfo;
|
40
38
|
|
41
39
|
VulkanTextureInfo() = default;
|
42
40
|
VulkanTextureInfo(uint32_t sampleCount,
|
@@ -46,7 +44,8 @@ struct VulkanTextureInfo {
|
|
46
44
|
VkImageTiling imageTiling,
|
47
45
|
VkImageUsageFlags imageUsageFlags,
|
48
46
|
VkSharingMode sharingMode,
|
49
|
-
VkImageAspectFlags aspectMask
|
47
|
+
VkImageAspectFlags aspectMask,
|
48
|
+
VulkanYcbcrConversionInfo ycbcrConversionInfo)
|
50
49
|
: fSampleCount(sampleCount)
|
51
50
|
, fMipmapped(mipmapped)
|
52
51
|
, fFlags(flags)
|
@@ -54,7 +53,8 @@ struct VulkanTextureInfo {
|
|
54
53
|
, fImageTiling(imageTiling)
|
55
54
|
, fImageUsageFlags(imageUsageFlags)
|
56
55
|
, fSharingMode(sharingMode)
|
57
|
-
, fAspectMask(aspectMask)
|
56
|
+
, fAspectMask(aspectMask)
|
57
|
+
, fYcbcrConversionInfo(ycbcrConversionInfo) {}
|
58
58
|
};
|
59
59
|
|
60
60
|
} // namespace skgpu::graphite
|
@@ -121,6 +121,7 @@ struct GrMockOptions {
|
|
121
121
|
fConfigOptions[(int)GrColorType::kRGBA_8888].fTexturable = true;
|
122
122
|
fConfigOptions[(int)GrColorType::kAlpha_8].fTexturable = true;
|
123
123
|
fConfigOptions[(int)GrColorType::kBGR_565].fTexturable = true;
|
124
|
+
fConfigOptions[(int)GrColorType::kRGB_565].fTexturable = true;
|
124
125
|
|
125
126
|
fConfigOptions[(int)GrColorType::kBGRA_8888] = fConfigOptions[(int)GrColorType::kRGBA_8888];
|
126
127
|
|
@@ -30,7 +30,7 @@ enum GrVkFeatureFlags {
|
|
30
30
|
kSampleRateShading_GrVkFeatureFlag = 0x0004,
|
31
31
|
};
|
32
32
|
|
33
|
-
// It is not
|
33
|
+
// It is not guaranteed VkPhysicalDeviceProperties2 will be in the client's header so we forward
|
34
34
|
// declare it here to be safe.
|
35
35
|
struct VkPhysicalDeviceFeatures2;
|
36
36
|
|
@@ -14,50 +14,7 @@
|
|
14
14
|
|
15
15
|
using GrVkBackendMemory = skgpu::VulkanBackendMemory;
|
16
16
|
using GrVkAlloc = skgpu::VulkanAlloc;
|
17
|
-
|
18
|
-
// This struct is used to pass in the necessary information to create a VkSamplerYcbcrConversion
|
19
|
-
// object for an VkExternalFormatANDROID.
|
20
|
-
struct GrVkYcbcrConversionInfo {
|
21
|
-
bool operator==(const GrVkYcbcrConversionInfo& that) const {
|
22
|
-
// Invalid objects are not required to have all other fields initialized or matching.
|
23
|
-
if (!this->isValid() && !that.isValid()) {
|
24
|
-
return true;
|
25
|
-
}
|
26
|
-
return this->fFormat == that.fFormat &&
|
27
|
-
this->fExternalFormat == that.fExternalFormat &&
|
28
|
-
this->fYcbcrModel == that.fYcbcrModel &&
|
29
|
-
this->fYcbcrRange == that.fYcbcrRange &&
|
30
|
-
this->fXChromaOffset == that.fXChromaOffset &&
|
31
|
-
this->fYChromaOffset == that.fYChromaOffset &&
|
32
|
-
this->fChromaFilter == that.fChromaFilter &&
|
33
|
-
this->fForceExplicitReconstruction == that.fForceExplicitReconstruction;
|
34
|
-
}
|
35
|
-
bool operator!=(const GrVkYcbcrConversionInfo& that) const { return !(*this == that); }
|
36
|
-
|
37
|
-
bool isValid() const {
|
38
|
-
return fYcbcrModel != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY ||
|
39
|
-
fExternalFormat != 0;
|
40
|
-
}
|
41
|
-
|
42
|
-
// Format of the source image. Must be set to VK_FORMAT_UNDEFINED for external images or
|
43
|
-
// a valid image format otherwise.
|
44
|
-
VkFormat fFormat = VK_FORMAT_UNDEFINED;
|
45
|
-
|
46
|
-
// The external format. Must be non-zero for external images, zero otherwise.
|
47
|
-
// Should be compatible to be used in a VkExternalFormatANDROID struct.
|
48
|
-
uint64_t fExternalFormat = 0;
|
49
|
-
|
50
|
-
VkSamplerYcbcrModelConversion fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
|
51
|
-
VkSamplerYcbcrRange fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
|
52
|
-
VkChromaLocation fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
53
|
-
VkChromaLocation fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
|
54
|
-
VkFilter fChromaFilter = VK_FILTER_NEAREST;
|
55
|
-
VkBool32 fForceExplicitReconstruction = false;
|
56
|
-
|
57
|
-
// For external images format features here should be those returned by a call to
|
58
|
-
// vkAndroidHardwareBufferFormatPropertiesANDROID
|
59
|
-
VkFormatFeatureFlags fFormatFeatures = 0;
|
60
|
-
};
|
17
|
+
using GrVkYcbcrConversionInfo = skgpu::VulkanYcbcrConversionInfo;
|
61
18
|
|
62
19
|
/*
|
63
20
|
* When wrapping a GrBackendTexture or GrBackendRendenderTarget, the fCurrentQueueFamily should
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2023 Google LLC
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef skgpu_VulkanMutableTextureState_DEFINED
|
9
|
+
#define skgpu_VulkanMutableTextureState_DEFINED
|
10
|
+
|
11
|
+
#include "include/gpu/MutableTextureState.h"
|
12
|
+
#include "include/private/gpu/vk/SkiaVulkan.h"
|
13
|
+
|
14
|
+
#include <cstdint>
|
15
|
+
|
16
|
+
namespace skgpu::MutableTextureStates {
|
17
|
+
MutableTextureState MakeVulkan(VkImageLayout layout, uint32_t queueFamilyIndex);
|
18
|
+
|
19
|
+
VkImageLayout GetVkImageLayout(const MutableTextureState& state);
|
20
|
+
VkImageLayout GetVkImageLayout(const MutableTextureState* state);
|
21
|
+
uint32_t GetVkQueueFamilyIndex(const MutableTextureState& state);
|
22
|
+
uint32_t GetVkQueueFamilyIndex(const MutableTextureState* state);
|
23
|
+
}
|
24
|
+
|
25
|
+
#endif
|
@@ -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
|