@shopify/react-native-skia 2.0.5 → 2.0.7

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.
Files changed (180) hide show
  1. package/android/CMakeLists.txt +10 -0
  2. package/android/build.gradle +2 -1
  3. package/apple/SkiaCVPixelBufferUtils.mm +8 -4
  4. package/cpp/api/JsiSkCanvas.h +10 -8
  5. package/cpp/api/JsiSkFont.h +14 -18
  6. package/cpp/api/JsiSkPath.h +6 -3
  7. package/cpp/api/JsiSkPathEffectFactory.h +2 -2
  8. package/cpp/api/JsiSkPathFactory.h +1 -1
  9. package/cpp/api/JsiSkTextBlobFactory.h +5 -3
  10. package/cpp/api/JsiSkTypeface.h +5 -4
  11. package/cpp/api/recorder/Drawings.h +26 -20
  12. package/cpp/api/recorder/PathEffects.h +3 -2
  13. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +1 -1
  14. package/cpp/skia/include/android/SkImageAndroid.h +1 -8
  15. package/cpp/skia/include/config/SkUserConfig.h +9 -0
  16. package/cpp/skia/include/core/SkCPUContext.h +31 -0
  17. package/cpp/skia/include/core/SkCPURecorder.h +69 -0
  18. package/cpp/skia/include/core/SkCanvas.h +57 -13
  19. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  20. package/cpp/skia/include/core/SkData.h +63 -37
  21. package/cpp/skia/include/core/SkFont.h +94 -65
  22. package/cpp/skia/include/core/SkImage.h +10 -9
  23. package/cpp/skia/include/core/SkImageGenerator.h +3 -0
  24. package/cpp/skia/include/core/SkMatrix.h +102 -116
  25. package/cpp/skia/include/core/SkMilestone.h +1 -1
  26. package/cpp/skia/include/core/SkPath.h +163 -60
  27. package/cpp/skia/include/core/SkPathBuilder.h +713 -30
  28. package/cpp/skia/include/core/SkPathTypes.h +5 -1
  29. package/cpp/skia/include/core/SkPictureRecorder.h +6 -6
  30. package/cpp/skia/include/core/SkRecorder.h +35 -0
  31. package/cpp/skia/include/core/SkRect.h +57 -27
  32. package/cpp/skia/include/core/SkRegion.h +1 -1
  33. package/cpp/skia/include/core/SkSurface.h +8 -1
  34. package/cpp/skia/include/core/SkTextBlob.h +50 -6
  35. package/cpp/skia/include/core/SkTraceMemoryDump.h +7 -0
  36. package/cpp/skia/include/core/SkTypeface.h +53 -26
  37. package/cpp/skia/include/core/SkTypes.h +6 -0
  38. package/cpp/skia/include/effects/SkDashPathEffect.h +9 -3
  39. package/cpp/skia/include/effects/SkRuntimeEffect.h +1 -1
  40. package/cpp/skia/include/encode/SkEncoder.h +1 -1
  41. package/cpp/skia/include/encode/SkICC.h +1 -1
  42. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +23 -0
  43. package/cpp/skia/include/gpu/ganesh/GrRecordingContext.h +12 -0
  44. package/cpp/skia/include/gpu/graphite/Context.h +32 -8
  45. package/cpp/skia/include/gpu/graphite/ContextOptions.h +22 -4
  46. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +21 -4
  47. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +16 -2
  48. package/cpp/skia/include/gpu/graphite/Recorder.h +30 -10
  49. package/cpp/skia/include/gpu/graphite/Recording.h +7 -3
  50. package/cpp/skia/include/gpu/graphite/TextureInfo.h +3 -3
  51. package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +15 -0
  52. package/cpp/skia/include/gpu/graphite/precompile/PrecompileShader.h +89 -13
  53. package/cpp/skia/include/gpu/graphite/vk/precompile/VulkanPrecompileShader.h +39 -0
  54. package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +1 -1
  55. package/cpp/skia/include/gpu/vk/VulkanPreferredFeatures.h +214 -0
  56. package/cpp/skia/include/ports/SkFontMgr_fontconfig.h +3 -0
  57. package/cpp/skia/include/private/SkGainmapShader.h +10 -4
  58. package/cpp/skia/include/private/SkPathRef.h +6 -2
  59. package/cpp/skia/include/private/base/SkAlign.h +11 -0
  60. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
  61. package/cpp/skia/include/third_party/vulkan/vulkan/vk_icd.h +255 -0
  62. package/cpp/skia/include/third_party/vulkan/vulkan/vk_layer.h +203 -0
  63. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +1 -2
  64. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std.h +390 -0
  65. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_decode.h +106 -0
  66. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_encode.h +140 -0
  67. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +1 -1
  68. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +1 -1
  69. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_encode.h +144 -0
  70. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +1 -1
  71. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +1 -1
  72. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_encode.h +158 -0
  73. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +1 -1
  74. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +1 -1
  75. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +1 -1
  76. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_beta.h +242 -0
  77. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10094 -5707
  78. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_directfb.h +55 -0
  79. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_fuchsia.h +288 -0
  80. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ggp.h +59 -0
  81. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +1 -1
  82. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +1 -1
  83. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_metal.h +238 -0
  84. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_screen.h +110 -0
  85. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_vi.h +47 -0
  86. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_wayland.h +55 -0
  87. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +1 -1
  88. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +1 -1
  89. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xlib.h +60 -0
  90. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xlib_xrandr.h +46 -0
  91. package/cpp/skia/modules/skcms/src/skcms_internals.h +10 -2
  92. package/cpp/skia/modules/skcms/src/skcms_public.h +39 -10
  93. package/libs/android/arm64-v8a/libpathops.a +0 -0
  94. package/libs/android/arm64-v8a/libskia.a +0 -0
  95. package/libs/android/arm64-v8a/libskottie.a +0 -0
  96. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  97. package/libs/android/arm64-v8a/libsksg.a +0 -0
  98. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  99. package/libs/android/arm64-v8a/libskunicode_icu.a +0 -0
  100. package/libs/android/arm64-v8a/libsvg.a +0 -0
  101. package/libs/android/armeabi-v7a/libpathops.a +0 -0
  102. package/libs/android/armeabi-v7a/libskia.a +0 -0
  103. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  104. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  105. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  106. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  107. package/libs/android/armeabi-v7a/libskunicode_icu.a +0 -0
  108. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  109. package/libs/android/x86/libpathops.a +0 -0
  110. package/libs/android/x86/libskia.a +0 -0
  111. package/libs/android/x86/libskottie.a +0 -0
  112. package/libs/android/x86/libskparagraph.a +0 -0
  113. package/libs/android/x86/libsksg.a +0 -0
  114. package/libs/android/x86/libskshaper.a +0 -0
  115. package/libs/android/x86/libskunicode_icu.a +0 -0
  116. package/libs/android/x86/libsvg.a +0 -0
  117. package/libs/android/x86_64/libpathops.a +0 -0
  118. package/libs/android/x86_64/libskia.a +0 -0
  119. package/libs/android/x86_64/libskottie.a +0 -0
  120. package/libs/android/x86_64/libskparagraph.a +0 -0
  121. package/libs/android/x86_64/libsksg.a +0 -0
  122. package/libs/android/x86_64/libskshaper.a +0 -0
  123. package/libs/android/x86_64/libskunicode_icu.a +0 -0
  124. package/libs/android/x86_64/libsvg.a +0 -0
  125. package/libs/apple/libpathops.xcframework/Info.plist +94 -0
  126. package/libs/apple/libpathops.xcframework/ios-arm64_arm64e/libpathops.a +0 -0
  127. package/libs/apple/libpathops.xcframework/ios-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
  128. package/libs/apple/libpathops.xcframework/macos-arm64_x86_64/libpathops.a +0 -0
  129. package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e/libpathops.a +0 -0
  130. package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
  131. package/libs/apple/libskia.xcframework/Info.plist +14 -14
  132. package/libs/apple/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  133. package/libs/apple/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  134. package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
  135. package/libs/apple/libskia.xcframework/tvos-arm64_arm64e/libskia.a +0 -0
  136. package/libs/apple/libskia.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  137. package/libs/apple/libskottie.xcframework/Info.plist +8 -8
  138. package/libs/apple/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  139. package/libs/apple/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  140. package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
  141. package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e/libskottie.a +0 -0
  142. package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  143. package/libs/apple/libskparagraph.xcframework/Info.plist +14 -14
  144. package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  145. package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  146. package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
  147. package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e/libskparagraph.a +0 -0
  148. package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  149. package/libs/apple/libsksg.xcframework/Info.plist +8 -8
  150. package/libs/apple/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  151. package/libs/apple/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  152. package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
  153. package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e/libsksg.a +0 -0
  154. package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  155. package/libs/apple/libskshaper.xcframework/Info.plist +14 -14
  156. package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  157. package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  158. package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
  159. package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e/libskshaper.a +0 -0
  160. package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  161. package/libs/apple/libskunicode_core.xcframework/Info.plist +12 -12
  162. package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  163. package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
  164. package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  165. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +13 -13
  166. package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  167. package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  168. package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
  169. package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  170. package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  171. package/libs/apple/libsvg.xcframework/Info.plist +12 -12
  172. package/libs/apple/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  173. package/libs/apple/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  174. package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
  175. package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e/libsvg.a +0 -0
  176. package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  177. package/package.json +1 -1
  178. package/react-native-skia.podspec +2 -1
  179. package/src/renderer/__tests__/e2e/BackdropFilters.spec.tsx +23 -0
  180. /package/cpp/skia/{include/pathops → modules/pathops/include}/SkPathOps.h +0 -0
@@ -0,0 +1,214 @@
1
+ /*
2
+ * Copyright 2025 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_VulkanPreferredFeatures_DEFINED
9
+ #define skgpu_VulkanPreferredFeatures_DEFINED
10
+
11
+ #include "include/private/base/SkAPI.h"
12
+ #include "include/private/gpu/vk/SkiaVulkan.h"
13
+
14
+ #include <cstddef>
15
+ #include <cstdint>
16
+ #include <vector>
17
+
18
+ namespace skgpu {
19
+
20
+ class SK_API VulkanPreferredFeatures {
21
+ public:
22
+ ~VulkanPreferredFeatures();
23
+
24
+ /*
25
+ * VulkanPreferredFeatures is used by Skia to add extensions and features on top of what the app
26
+ * wants to enable. The flow of Vulkan initialization for an app that wants to use Skia would
27
+ * be:
28
+ *
29
+ * ```
30
+ * // Query the loader for instance information, decide on API version to use
31
+ *
32
+ * // Prepare for Skia-enabled extensions and features
33
+ * skgpu::VulkanPreferredFeatures skiaFeatures;
34
+ * skiaFeatures.init(apiVersion);
35
+ *
36
+ * // Decide on instance extensions to use in the app.
37
+ *
38
+ * // Allow Skia to add to the instance extension list.
39
+ * skiaFeatures.addToInstanceExtensions(...);
40
+ *
41
+ * // Create the instance, choose physical device, query available extensions, decide on
42
+ * // device features to query
43
+ *
44
+ * // Allow Skia to add to the feature query list.
45
+ * skiaFeatures.addFeaturesToQuery(...);
46
+ *
47
+ * // Query features, decide on extensions and features to enable.
48
+ *
49
+ * // Allow Skia to add to the device extension and feature list.
50
+ * skiaFeatures.addFeaturesToEnable(...);
51
+ *
52
+ * // Create the Vulkan device.
53
+ * ```
54
+ *
55
+ * Parameters:
56
+ *
57
+ * * appAPIVersion: The API version the app has specified in VkApplicationInfo::apiVersion (and
58
+ * will later provide in VulkanBackendContext::fMaxAPIVersion). The minimum supported version
59
+ * is VK_API_VERSION_1_1, maximum is VK_API_VERSION_1_4.
60
+ */
61
+ void init(uint32_t appAPIVersion);
62
+
63
+ /*
64
+ * Before creating a Vulkan instance, call addToInstanceExtensions to give Skia a chance to add
65
+ * instance extensions it may take advantage of. Extensions are only added to appExtensions if
66
+ * caller hasn't already included them to be enabled.
67
+ *
68
+ * Parameters:
69
+ *
70
+ * * instanceExtensions, instanceExtensionCount: The list of available instance extensions as
71
+ * queried from the loader.
72
+ * * appExtensions: The list of extensions to be enabled on the instance; more extensions may be
73
+ * added to this list by this call.
74
+ */
75
+ void addToInstanceExtensions(const VkExtensionProperties* instanceExtensions,
76
+ size_t instanceExtensionCount,
77
+ std::vector<const char*>& appExtensions);
78
+
79
+ /*
80
+ * Before querying Vulkan device features, call addFeaturesToQuery to give Skia a chance to add
81
+ * device extension features it may take advantage of to the query. Features are only added to
82
+ * appFeatures if caller hasn't already included them in the query.
83
+ *
84
+ * Beware that the structs that get chained to appFeatures are member variables of this class,
85
+ * so this object must not leave scope until feature query and device creation is complete.
86
+ *
87
+ * Parameters:
88
+ *
89
+ * * deviceExtensions, deviceExtensionCount: The list of available device extensions as queried
90
+ * from the physical device.
91
+ * * appFeatures: The features to be queried from the physical device; more features may be
92
+ * added to the pNext chain by this call.
93
+ */
94
+ void addFeaturesToQuery(const VkExtensionProperties* deviceExtensions,
95
+ size_t deviceExtensionCount,
96
+ VkPhysicalDeviceFeatures2& appFeatures);
97
+
98
+ /*
99
+ * Before creating the Vulkan device, call addFeaturesToEnable to give Skia a chance to add
100
+ * device extensions and features it may take advantage of. Extensions and features are only
101
+ * added to appExtensions and appFeatures respectively if caller hasn't already included them to
102
+ * be enabled. This function may replace chained features with VkPhysicalDeviceVulkanNNFeatures
103
+ * structs instead in order to add features. Features that are already enabled by the
104
+ * application are retained in that case in the new struct.
105
+ *
106
+ * Parameters:
107
+ *
108
+ * * appExtensions: The list of extensions to be enabled on the device; more extensions may be
109
+ * added to this list by this call.
110
+ * * appFeatures: The features to be enabled on the device; more features may be
111
+ * added to the pNext chain by this call.
112
+ */
113
+ void addFeaturesToEnable(std::vector<const char*>& appExtensions,
114
+ VkPhysicalDeviceFeatures2& appFeatures);
115
+
116
+ private:
117
+ uint32_t fAPIVersion = 0;
118
+ // Track what the application did, so warnings can be generated if the class is not
119
+ // fully/correctly used.
120
+ bool fHasAddedToInstanceExtensions = false;
121
+ bool fHasAddedFeaturesToQuery = false;
122
+ bool fHasAddedFeaturesToEnable = false;
123
+
124
+ // The list of device features Skia is interested in. If any are included in
125
+ // VkPhysicalDeviceFeatures2::pNext by the app, it is not included again by Skia. However, to
126
+ // take best advantage of the Vulkan API, the app should not intentionally include these feature
127
+ // structs only to forcefully disable the feature - this blocks Skia from leveraging it.
128
+ //
129
+ // When ambiguous, the extension name is included to determine which extension a feature struct
130
+ // has come from. This is usually needed when addFeaturesToQuery has included a feature struct
131
+ // that is present in multiple extensions (e.g. due to extension promotion). It is later used by
132
+ // addFeaturesToEnable to know which extension to enable.
133
+
134
+ // Available since Vulkan 1.2
135
+ VkPhysicalDeviceVulkan11Features fVulkan11 = {};
136
+
137
+ // Available since Vulkan 1.2
138
+ VkPhysicalDeviceVulkan12Features fVulkan12 = {};
139
+
140
+ // Available since Vulkan 1.3
141
+ VkPhysicalDeviceVulkan13Features fVulkan13 = {};
142
+
143
+ // Available since Vulkan 1.4
144
+ VkPhysicalDeviceVulkan14Features fVulkan14 = {};
145
+
146
+ // Feature of VK_EXT_rasterization_order_attachment_access or
147
+ // VK_ARM_rasterization_order_attachment_access.
148
+ VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT
149
+ fRasterizationOrderAttachmentAccess = {};
150
+ const char* fRasterizationOrderAttachmentAccessExtension = nullptr;
151
+
152
+ // Feature of VK_EXT_blend_operation_advanced
153
+ VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT fBlendOperationAdvanced = {};
154
+
155
+ // Feature of VK_EXT_extended_dynamic_state
156
+ VkPhysicalDeviceExtendedDynamicStateFeaturesEXT fExtendedDynamicState = {};
157
+
158
+ // Feature of VK_EXT_extended_dynamic_state2
159
+ VkPhysicalDeviceExtendedDynamicState2FeaturesEXT fExtendedDynamicState2 = {};
160
+
161
+ // Feature of VK_EXT_vertex_input_dynamic_state
162
+ VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT fVertexInputDynamicState = {};
163
+
164
+ // Feature of VK_EXT_graphics_pipeline_library
165
+ VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT fGraphicsPipelineLibrary = {};
166
+
167
+ // Feature of VK_KHR_sampler_ycbcr_conversion or Vulkan 1.1
168
+ VkPhysicalDeviceSamplerYcbcrConversionFeatures fSamplerYcbcrConversion = {};
169
+
170
+ // Feature of VK_EXT_rgba10x6_formats
171
+ VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT fRGBA10x6Formats = {};
172
+
173
+ // Feature of VK_KHR_synchronization2 or Vulkan 1.3
174
+ VkPhysicalDeviceDynamicRenderingFeatures fSynchronization2 = {};
175
+
176
+ // Feature of VK_KHR_dynamic_rendering or Vulkan 1.3
177
+ VkPhysicalDeviceDynamicRenderingFeatures fDynamicRendering = {};
178
+
179
+ // Feature of VK_KHR_dynamic_rendering_local_read or Vulkan 1.4
180
+ VkPhysicalDeviceDynamicRenderingLocalReadFeatures fDynamicRenderingLocalRead = {};
181
+
182
+ // Feature of VK_EXT_multisampled_render_to_single_sampled
183
+ VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT
184
+ fMultisampledRenderToSingleSampled = {};
185
+
186
+ // Feature of VK_EXT_host_image_copy or Vulkan 1.4
187
+ VkPhysicalDeviceHostImageCopyFeatures fHostImageCopy = {};
188
+
189
+ // Feature of VK_EXT_pipeline_creation_cache_control or Vulkan 1.3
190
+ VkPhysicalDevicePipelineCreationCacheControlFeatures fPipelineCreationCacheControl = {};
191
+
192
+ // Extensions that don't have a feature:
193
+ // VK_KHR_driver_properties or Vulkan 1.2
194
+ const char* fDriverPropertiesExtension = nullptr;
195
+ // VK_KHR_create_renderpass2 or Vulkan 1.2
196
+ const char* fCreateRenderpass2Extension = nullptr;
197
+ // VK_EXT_load_store_op_none, VK_KHR_load_store_op_none or Vulkan 1.4
198
+ const char* fLoadStoreOpNoneExtension = nullptr;
199
+ // VK_EXT_conservative_rasterization
200
+ const char* fConservativeRasterizationExtension = nullptr;
201
+
202
+ // Extensions that the other extensions above depend on:
203
+ // Dependency of VK_EXT_graphics_pipeline_library: VK_KHR_pipeline_library
204
+ const char* fPipelineLibraryExtension = nullptr;
205
+ // Dependencies of VK_EXT_host_image_copy: VK_KHR_copy_commands2, VK_KHR_format_feature_flags2
206
+ const char* fCopyCommands2Extension = nullptr;
207
+ const char* fFormatFeatureFlags2Extension = nullptr;
208
+ // Dependency of VK_EXT_multisampled_render_to_single_sampled: VK_KHR_depth_stencil_resolve
209
+ const char* fDepthStencilResolveExtension = nullptr;
210
+ };
211
+
212
+ } // namespace skgpu
213
+
214
+ #endif // skgpu_VulkanPreferredFeatures_DEFINED
@@ -20,5 +20,8 @@ class SkFontMgr;
20
20
  */
21
21
  class SkFontScanner;
22
22
  SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc, std::unique_ptr<SkFontScanner> scanner);
23
+
24
+ #if !defined(SK_DISABLE_LEGACY_FONTCONFIG_FACTORY)
23
25
  SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
26
+ #endif
24
27
  #endif // #ifndef SkFontMgr_fontconfig_DEFINED
@@ -34,11 +34,17 @@ public:
34
34
  * map to the rectangle dstRect. Sampling will be done according to gainmapSamplingOptions.
35
35
  *
36
36
  * The gainmap will be applied according to the HDR to SDR ratio specified in dstHdrRatio.
37
- *
38
- * This shader must know the color space of the canvas that it will be rendered to. This color
39
- * space must be specified in dstColorSpace.
40
- * TODO(ccameron): Remove the need for dstColorSpace.
41
37
  */
38
+ static sk_sp<SkShader> Make(const sk_sp<const SkImage>& baseImage,
39
+ const SkRect& baseRect,
40
+ const SkSamplingOptions& baseSamplingOptions,
41
+ const sk_sp<const SkImage>& gainmapImage,
42
+ const SkRect& gainmapRect,
43
+ const SkSamplingOptions& gainmapSamplingOptions,
44
+ const SkGainmapInfo& gainmapInfo,
45
+ const SkRect& dstRect,
46
+ float dstHdrRatio);
47
+
42
48
  static sk_sp<SkShader> Make(const sk_sp<const SkImage>& baseImage,
43
49
  const SkRect& baseRect,
44
50
  const SkSamplingOptions& baseSamplingOptions,
@@ -9,6 +9,7 @@
9
9
  #define SkPathRef_DEFINED
10
10
 
11
11
  #include "include/core/SkArc.h"
12
+ #include "include/core/SkPathTypes.h" // IWYU pragma: keep
12
13
  #include "include/core/SkPoint.h"
13
14
  #include "include/core/SkRect.h"
14
15
  #include "include/core/SkRefCnt.h"
@@ -310,6 +311,9 @@ public:
310
311
  */
311
312
  const uint8_t* verbsEnd() const { return fVerbs.end(); }
312
313
 
314
+ SkSpan<const SkPathVerb> verbs() const {
315
+ return {reinterpret_cast<const SkPathVerb*>(fVerbs.begin()), fVerbs.size()};
316
+ }
313
317
  /**
314
318
  * Returns a const pointer to the first point.
315
319
  */
@@ -337,7 +341,7 @@ public:
337
341
  * Gets an ID that uniquely identifies the contents of the path ref. If two path refs have the
338
342
  * same ID then they have the same verbs and points. However, two path refs may have the same
339
343
  * contents but different genIDs.
340
- * skbug.com/1762 for background on why fillType is necessary (for now).
344
+ * skbug.com/40032862 for background on why fillType is necessary (for now).
341
345
  */
342
346
  uint32_t genID(uint8_t fillType) const;
343
347
 
@@ -395,7 +399,7 @@ private:
395
399
 
396
400
  // Return true if the computed bounds are finite.
397
401
  static bool ComputePtBounds(SkRect* bounds, const SkPathRef& ref) {
398
- return bounds->setBoundsCheck(ref.points(), ref.countPoints());
402
+ return bounds->setBoundsCheck({ref.points(), ref.countPoints()});
399
403
  }
400
404
 
401
405
  // called, if dirty, by getBounds()
@@ -41,4 +41,15 @@ static inline constexpr size_t SkAlignTo(size_t x, size_t alignment) {
41
41
  return (x + alignment - 1) & ~(alignment - 1);
42
42
  }
43
43
 
44
+ /**
45
+ * align up to a non power of 2
46
+ */
47
+ static inline constexpr size_t SkAlignNonPow2(size_t x, size_t alignment) {
48
+ const size_t misalignment = x % alignment;
49
+ if (misalignment) {
50
+ x += alignment - misalignment;
51
+ }
52
+ return x;
53
+ }
54
+
44
55
  #endif
@@ -473,7 +473,7 @@ constexpr static int kGrInternalTextureFlagsMask = static_cast<int>(
473
473
  // if the proxy has it set then the surface must also have it set. All other flags listed here must
474
474
  // match on the proxy and surface.
475
475
  // TODO: Add back kFramebufferOnly flag here once we update GrSurfaceCharacterization to take it
476
- // as a flag. skbug.com/10672
476
+ // as a flag. skbug.com/40042017
477
477
  constexpr static int kGrInternalRenderTargetFlagsMask = static_cast<int>(
478
478
  GrInternalSurfaceFlags::kGLRTFBOIDIs0 |
479
479
  GrInternalSurfaceFlags::kRequiresManualMSAAResolve/* |
@@ -0,0 +1,255 @@
1
+ /*
2
+ * Copyright 2015-2023 The Khronos Group Inc.
3
+ * Copyright 2015-2023 Valve Corporation
4
+ * Copyright 2015-2023 LunarG, Inc.
5
+ *
6
+ * SPDX-License-Identifier: Apache-2.0
7
+ */
8
+ #pragma once
9
+
10
+ #include <stdbool.h>
11
+ #include "vulkan.h"
12
+
13
+ // Loader-ICD version negotiation API. Versions add the following features:
14
+ // Version 0 - Initial. Doesn't support vk_icdGetInstanceProcAddr
15
+ // or vk_icdNegotiateLoaderICDInterfaceVersion.
16
+ // Version 1 - Add support for vk_icdGetInstanceProcAddr.
17
+ // Version 2 - Add Loader/ICD Interface version negotiation
18
+ // via vk_icdNegotiateLoaderICDInterfaceVersion.
19
+ // Version 3 - Add ICD creation/destruction of KHR_surface objects.
20
+ // Version 4 - Add unknown physical device extension querying via
21
+ // vk_icdGetPhysicalDeviceProcAddr.
22
+ // Version 5 - Tells ICDs that the loader is now paying attention to the
23
+ // application version of Vulkan passed into the ApplicationInfo
24
+ // structure during vkCreateInstance. This will tell the ICD
25
+ // that if the loader is older, it should automatically fail a
26
+ // call for any API version > 1.0. Otherwise, the loader will
27
+ // manually determine if it can support the expected version.
28
+ // Version 6 - Add support for vk_icdEnumerateAdapterPhysicalDevices.
29
+ // Version 7 - If an ICD supports any of the following functions, they must be
30
+ // queryable with vk_icdGetInstanceProcAddr:
31
+ // vk_icdNegotiateLoaderICDInterfaceVersion
32
+ // vk_icdGetPhysicalDeviceProcAddr
33
+ // vk_icdEnumerateAdapterPhysicalDevices (Windows only)
34
+ // In addition, these functions no longer need to be exported directly.
35
+ // This version allows drivers provided through the extension
36
+ // VK_LUNARG_direct_driver_loading be able to support the entire
37
+ // Driver-Loader interface.
38
+
39
+ #define CURRENT_LOADER_ICD_INTERFACE_VERSION 7
40
+ #define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0
41
+ #define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4
42
+
43
+ // Old typedefs that don't follow a proper naming convention but are preserved for compatibility
44
+ typedef VkResult(VKAPI_PTR* PFN_vkNegotiateLoaderICDInterfaceVersion)(uint32_t* pVersion);
45
+ // This is defined in vk_layer.h which will be found by the loader, but if an ICD is building
46
+ // against this file directly, it won't be found.
47
+ #ifndef PFN_GetPhysicalDeviceProcAddr
48
+ typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_GetPhysicalDeviceProcAddr)(VkInstance instance,
49
+ const char* pName);
50
+ #endif
51
+
52
+ // Typedefs for loader/ICD interface
53
+ typedef VkResult(VKAPI_PTR* PFN_vk_icdNegotiateLoaderICDInterfaceVersion)(uint32_t* pVersion);
54
+ typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vk_icdGetInstanceProcAddr)(VkInstance instance,
55
+ const char* pName);
56
+ typedef PFN_vkVoidFunction(VKAPI_PTR* PFN_vk_icdGetPhysicalDeviceProcAddr)(VkInstance instance,
57
+ const char* pName);
58
+ #if defined(VK_USE_PLATFORM_WIN32_KHR)
59
+ typedef VkResult(VKAPI_PTR* PFN_vk_icdEnumerateAdapterPhysicalDevices)(
60
+ VkInstance instance,
61
+ LUID adapterLUID,
62
+ uint32_t* pPhysicalDeviceCount,
63
+ VkPhysicalDevice* pPhysicalDevices);
64
+ #endif
65
+
66
+ // Prototypes for loader/ICD interface
67
+ #if !defined(VK_NO_PROTOTYPES)
68
+ #ifdef __cplusplus
69
+ extern "C" {
70
+ #endif
71
+ VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pVersion);
72
+ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance,
73
+ const char* pName);
74
+ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance instance,
75
+ const char* pName);
76
+ #if defined(VK_USE_PLATFORM_WIN32_KHR)
77
+ VKAPI_ATTR VkResult VKAPI_CALL
78
+ vk_icdEnumerateAdapterPhysicalDevices(VkInstance instance,
79
+ LUID adapterLUID,
80
+ uint32_t* pPhysicalDeviceCount,
81
+ VkPhysicalDevice* pPhysicalDevices);
82
+ #endif
83
+ #ifdef __cplusplus
84
+ }
85
+ #endif
86
+ #endif
87
+
88
+ /*
89
+ * The ICD must reserve space for a pointer for the loader's dispatch
90
+ * table, at the start of <each object>.
91
+ * The ICD must initialize this variable using the SET_LOADER_MAGIC_VALUE macro.
92
+ */
93
+
94
+ #define ICD_LOADER_MAGIC 0x01CDC0DE
95
+
96
+ typedef union {
97
+ uintptr_t loaderMagic;
98
+ void* loaderData;
99
+ } VK_LOADER_DATA;
100
+
101
+ static inline void set_loader_magic_value(void* pNewObject) {
102
+ VK_LOADER_DATA* loader_info = (VK_LOADER_DATA*)pNewObject;
103
+ loader_info->loaderMagic = ICD_LOADER_MAGIC;
104
+ }
105
+
106
+ static inline bool valid_loader_magic_value(void* pNewObject) {
107
+ const VK_LOADER_DATA* loader_info = (VK_LOADER_DATA*)pNewObject;
108
+ return (loader_info->loaderMagic & 0xffffffff) == ICD_LOADER_MAGIC;
109
+ }
110
+
111
+ /*
112
+ * Windows and Linux ICDs will treat VkSurfaceKHR as a pointer to a struct that
113
+ * contains the platform-specific connection and surface information.
114
+ */
115
+ typedef enum {
116
+ VK_ICD_WSI_PLATFORM_MIR,
117
+ VK_ICD_WSI_PLATFORM_WAYLAND,
118
+ VK_ICD_WSI_PLATFORM_WIN32,
119
+ VK_ICD_WSI_PLATFORM_XCB,
120
+ VK_ICD_WSI_PLATFORM_XLIB,
121
+ VK_ICD_WSI_PLATFORM_ANDROID,
122
+ VK_ICD_WSI_PLATFORM_MACOS,
123
+ VK_ICD_WSI_PLATFORM_IOS,
124
+ VK_ICD_WSI_PLATFORM_DISPLAY,
125
+ VK_ICD_WSI_PLATFORM_HEADLESS,
126
+ VK_ICD_WSI_PLATFORM_METAL,
127
+ VK_ICD_WSI_PLATFORM_DIRECTFB,
128
+ VK_ICD_WSI_PLATFORM_VI,
129
+ VK_ICD_WSI_PLATFORM_GGP,
130
+ VK_ICD_WSI_PLATFORM_SCREEN,
131
+ VK_ICD_WSI_PLATFORM_FUCHSIA,
132
+ } VkIcdWsiPlatform;
133
+
134
+ typedef struct {
135
+ VkIcdWsiPlatform platform;
136
+ } VkIcdSurfaceBase;
137
+
138
+ #ifdef VK_USE_PLATFORM_MIR_KHR
139
+ typedef struct {
140
+ VkIcdSurfaceBase base;
141
+ MirConnection* connection;
142
+ MirSurface* mirSurface;
143
+ } VkIcdSurfaceMir;
144
+ #endif // VK_USE_PLATFORM_MIR_KHR
145
+
146
+ #ifdef VK_USE_PLATFORM_WAYLAND_KHR
147
+ typedef struct {
148
+ VkIcdSurfaceBase base;
149
+ struct wl_display* display;
150
+ struct wl_surface* surface;
151
+ } VkIcdSurfaceWayland;
152
+ #endif // VK_USE_PLATFORM_WAYLAND_KHR
153
+
154
+ #ifdef VK_USE_PLATFORM_WIN32_KHR
155
+ typedef struct {
156
+ VkIcdSurfaceBase base;
157
+ HINSTANCE hinstance;
158
+ HWND hwnd;
159
+ } VkIcdSurfaceWin32;
160
+ #endif // VK_USE_PLATFORM_WIN32_KHR
161
+
162
+ #ifdef VK_USE_PLATFORM_XCB_KHR
163
+ typedef struct {
164
+ VkIcdSurfaceBase base;
165
+ xcb_connection_t* connection;
166
+ xcb_window_t window;
167
+ } VkIcdSurfaceXcb;
168
+ #endif // VK_USE_PLATFORM_XCB_KHR
169
+
170
+ #ifdef VK_USE_PLATFORM_XLIB_KHR
171
+ typedef struct {
172
+ VkIcdSurfaceBase base;
173
+ Display* dpy;
174
+ Window window;
175
+ } VkIcdSurfaceXlib;
176
+ #endif // VK_USE_PLATFORM_XLIB_KHR
177
+
178
+ #ifdef VK_USE_PLATFORM_DIRECTFB_EXT
179
+ typedef struct {
180
+ VkIcdSurfaceBase base;
181
+ IDirectFB* dfb;
182
+ IDirectFBSurface* surface;
183
+ } VkIcdSurfaceDirectFB;
184
+ #endif // VK_USE_PLATFORM_DIRECTFB_EXT
185
+
186
+ #ifdef VK_USE_PLATFORM_ANDROID_KHR
187
+ typedef struct {
188
+ VkIcdSurfaceBase base;
189
+ struct ANativeWindow* window;
190
+ } VkIcdSurfaceAndroid;
191
+ #endif // VK_USE_PLATFORM_ANDROID_KHR
192
+
193
+ #ifdef VK_USE_PLATFORM_MACOS_MVK
194
+ typedef struct {
195
+ VkIcdSurfaceBase base;
196
+ const void* pView;
197
+ } VkIcdSurfaceMacOS;
198
+ #endif // VK_USE_PLATFORM_MACOS_MVK
199
+
200
+ #ifdef VK_USE_PLATFORM_IOS_MVK
201
+ typedef struct {
202
+ VkIcdSurfaceBase base;
203
+ const void* pView;
204
+ } VkIcdSurfaceIOS;
205
+ #endif // VK_USE_PLATFORM_IOS_MVK
206
+
207
+ #ifdef VK_USE_PLATFORM_GGP
208
+ typedef struct {
209
+ VkIcdSurfaceBase base;
210
+ GgpStreamDescriptor streamDescriptor;
211
+ } VkIcdSurfaceGgp;
212
+ #endif // VK_USE_PLATFORM_GGP
213
+
214
+ typedef struct {
215
+ VkIcdSurfaceBase base;
216
+ VkDisplayModeKHR displayMode;
217
+ uint32_t planeIndex;
218
+ uint32_t planeStackIndex;
219
+ VkSurfaceTransformFlagBitsKHR transform;
220
+ float globalAlpha;
221
+ VkDisplayPlaneAlphaFlagBitsKHR alphaMode;
222
+ VkExtent2D imageExtent;
223
+ } VkIcdSurfaceDisplay;
224
+
225
+ typedef struct {
226
+ VkIcdSurfaceBase base;
227
+ } VkIcdSurfaceHeadless;
228
+
229
+ #ifdef VK_USE_PLATFORM_METAL_EXT
230
+ typedef struct {
231
+ VkIcdSurfaceBase base;
232
+ const CAMetalLayer* pLayer;
233
+ } VkIcdSurfaceMetal;
234
+ #endif // VK_USE_PLATFORM_METAL_EXT
235
+
236
+ #ifdef VK_USE_PLATFORM_VI_NN
237
+ typedef struct {
238
+ VkIcdSurfaceBase base;
239
+ void* window;
240
+ } VkIcdSurfaceVi;
241
+ #endif // VK_USE_PLATFORM_VI_NN
242
+
243
+ #ifdef VK_USE_PLATFORM_SCREEN_QNX
244
+ typedef struct {
245
+ VkIcdSurfaceBase base;
246
+ struct _screen_context* context;
247
+ struct _screen_window* window;
248
+ } VkIcdSurfaceScreen;
249
+ #endif // VK_USE_PLATFORM_SCREEN_QNX
250
+
251
+ #ifdef VK_USE_PLATFORM_FUCHSIA
252
+ typedef struct {
253
+ VkIcdSurfaceBase base;
254
+ } VkIcdSurfaceImagePipe;
255
+ #endif // VK_USE_PLATFORM_FUCHSIA