@shopify/react-native-skia 0.1.212 → 0.1.214

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 (254) hide show
  1. package/android/build.gradle +5 -0
  2. package/android/cpp/rnskia-android/SkiaOpenGLHelper.h +3 -2
  3. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +9 -2
  4. package/cpp/api/JsiSkSurface.h +4 -1
  5. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +99 -0
  6. package/cpp/skia/include/android/SkHeifDecoder.h +10 -3
  7. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -0
  8. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -0
  9. package/cpp/skia/include/codec/SkCodec.h +4 -3
  10. package/cpp/skia/include/codec/SkEncodedImageFormat.h +0 -3
  11. package/cpp/skia/include/codec/SkGifDecoder.h +1 -0
  12. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -0
  13. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -0
  14. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -0
  15. package/cpp/skia/include/codec/SkPngDecoder.h +1 -0
  16. package/cpp/skia/include/codec/SkRawDecoder.h +1 -0
  17. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -0
  18. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -0
  19. package/cpp/skia/include/config/SkUserConfig.h +0 -2
  20. package/cpp/skia/include/core/SkBitmap.h +8 -8
  21. package/cpp/skia/include/core/SkCanvas.h +37 -50
  22. package/cpp/skia/include/core/SkCapabilities.h +2 -7
  23. package/cpp/skia/include/core/SkColor.h +1 -1
  24. package/cpp/skia/include/core/SkColorFilter.h +6 -0
  25. package/cpp/skia/include/core/SkColorTable.h +3 -0
  26. package/cpp/skia/include/core/SkColorType.h +2 -0
  27. package/cpp/skia/include/core/SkContourMeasure.h +12 -8
  28. package/cpp/skia/include/core/SkDocument.h +1 -0
  29. package/cpp/skia/include/core/SkFont.h +11 -2
  30. package/cpp/skia/include/core/SkFontMgr.h +2 -3
  31. package/cpp/skia/include/core/SkGraphics.h +3 -13
  32. package/cpp/skia/include/core/SkImage.h +57 -111
  33. package/cpp/skia/include/core/SkImageFilter.h +6 -1
  34. package/cpp/skia/include/core/SkImageGenerator.h +8 -0
  35. package/cpp/skia/include/core/SkImageInfo.h +0 -2
  36. package/cpp/skia/include/core/SkM44.h +7 -3
  37. package/cpp/skia/include/core/SkMallocPixelRef.h +4 -1
  38. package/cpp/skia/include/core/SkMatrix.h +17 -17
  39. package/cpp/skia/include/core/SkMesh.h +71 -61
  40. package/cpp/skia/include/core/SkMilestone.h +1 -1
  41. package/cpp/skia/include/core/SkOverdrawCanvas.h +25 -0
  42. package/cpp/skia/include/core/SkPaint.h +1 -1
  43. package/cpp/skia/include/core/SkPath.h +12 -4
  44. package/cpp/skia/include/core/SkPathMeasure.h +3 -4
  45. package/cpp/skia/include/core/SkPicture.h +19 -6
  46. package/cpp/skia/include/core/SkPictureRecorder.h +6 -6
  47. package/cpp/skia/include/core/SkPixmap.h +2 -3
  48. package/cpp/skia/include/core/SkRRect.h +1 -1
  49. package/cpp/skia/include/core/SkRect.h +107 -110
  50. package/cpp/skia/include/core/SkRefCnt.h +1 -1
  51. package/cpp/skia/include/core/SkRegion.h +7 -1
  52. package/cpp/skia/include/core/SkSerialProcs.h +14 -0
  53. package/cpp/skia/include/core/SkShader.h +9 -0
  54. package/cpp/skia/include/core/SkStream.h +9 -9
  55. package/cpp/skia/include/core/SkString.h +1 -1
  56. package/cpp/skia/include/core/SkSurface.h +14 -25
  57. package/cpp/skia/include/core/SkTextBlob.h +17 -4
  58. package/cpp/skia/include/core/SkTiledImageUtils.h +28 -0
  59. package/cpp/skia/include/core/SkTypeface.h +7 -2
  60. package/cpp/skia/include/core/SkTypes.h +4 -12
  61. package/cpp/skia/include/docs/SkPDFDocument.h +17 -3
  62. package/cpp/skia/include/effects/SkImageFilters.h +73 -24
  63. package/cpp/skia/include/effects/SkRuntimeEffect.h +20 -51
  64. package/cpp/skia/include/gpu/GpuTypes.h +13 -0
  65. package/cpp/skia/include/gpu/GrBackendSurface.h +95 -262
  66. package/cpp/skia/include/gpu/GrContextOptions.h +7 -1
  67. package/cpp/skia/include/gpu/GrDirectContext.h +138 -128
  68. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -4
  69. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -24
  70. package/cpp/skia/include/gpu/GrTypes.h +16 -1
  71. package/cpp/skia/include/gpu/GrYUVABackendTextures.h +4 -4
  72. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +2 -2
  73. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +44 -12
  74. package/cpp/skia/include/gpu/ganesh/SkMeshGanesh.h +57 -0
  75. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +2 -1
  76. package/cpp/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +58 -0
  77. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +29 -0
  78. package/cpp/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +1 -1
  79. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +67 -0
  80. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -2
  81. package/cpp/skia/include/gpu/graphite/BackendTexture.h +14 -3
  82. package/cpp/skia/include/gpu/graphite/Context.h +93 -13
  83. package/cpp/skia/include/gpu/graphite/ContextOptions.h +19 -8
  84. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +23 -0
  85. package/cpp/skia/include/gpu/graphite/Image.h +56 -0
  86. package/cpp/skia/include/gpu/graphite/ImageProvider.h +5 -0
  87. package/cpp/skia/include/gpu/graphite/Recorder.h +26 -9
  88. package/cpp/skia/include/gpu/graphite/Recording.h +7 -5
  89. package/cpp/skia/include/gpu/graphite/TextureInfo.h +8 -0
  90. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +2 -2
  91. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  92. package/cpp/skia/include/gpu/vk/GrVkTypes.h +4 -3
  93. package/cpp/skia/include/ports/SkCFObject.h +1 -1
  94. package/cpp/skia/include/private/SkGainmapInfo.h +4 -13
  95. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +1 -24
  96. package/cpp/skia/include/private/SkWeakRefCnt.h +1 -1
  97. package/cpp/skia/include/private/base/SkAnySubclass.h +73 -0
  98. package/cpp/skia/include/private/base/SkAssert.h +106 -12
  99. package/cpp/skia/include/private/base/SkAttributes.h +0 -12
  100. package/cpp/skia/include/private/base/SkFeatures.h +0 -3
  101. package/cpp/skia/include/private/base/SkFloatingPoint.h +58 -105
  102. package/cpp/skia/include/private/base/SkSpan_impl.h +18 -12
  103. package/cpp/skia/include/private/base/SkTArray.h +22 -17
  104. package/cpp/skia/include/private/base/SkTDArray.h +5 -6
  105. package/cpp/skia/include/private/base/SkTemplates.h +50 -30
  106. package/cpp/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +5 -2
  107. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +2 -2
  108. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +13 -8
  109. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +1 -1
  110. package/cpp/skia/include/private/chromium/SkImageChromium.h +16 -3
  111. package/cpp/skia/include/private/chromium/Slug.h +11 -4
  112. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  113. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +6 -9
  114. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +29 -13
  115. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -28
  116. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +34 -0
  117. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +6 -0
  118. package/cpp/skia/include/private/gpu/graphite/MtlGraphiteTypesPriv.h +8 -0
  119. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +10 -0
  120. package/cpp/skia/include/utils/SkBase64.h +2 -2
  121. package/cpp/skia/include/utils/SkNWayCanvas.h +1 -11
  122. package/cpp/skia/include/utils/SkNoDrawCanvas.h +0 -2
  123. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +1 -2
  124. package/cpp/skia/include/utils/SkShadowUtils.h +15 -1
  125. package/cpp/skia/include/utils/SkTextUtils.h +1 -1
  126. package/cpp/skia/modules/skparagraph/include/Paragraph.h +107 -1
  127. package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +3 -2
  128. package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +4 -0
  129. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +5 -3
  130. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +4 -0
  131. package/cpp/skia/src/core/SkChecksum.h +2 -1
  132. package/cpp/skia/src/core/SkPathPriv.h +1 -1
  133. package/cpp/skia/src/core/SkTHash.h +19 -9
  134. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +3 -1
  135. package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
  136. package/lib/commonjs/dom/nodes/datatypes/Rect.js +5 -1
  137. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  138. package/lib/commonjs/external/reanimated/index.d.ts +1 -0
  139. package/lib/commonjs/external/reanimated/index.js +13 -0
  140. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  141. package/lib/commonjs/external/reanimated/moduleWrapper.js +3 -8
  142. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  143. package/lib/commonjs/external/reanimated/renderHelpers.js +46 -1
  144. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +2 -0
  146. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +26 -0
  147. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/useSharedValueEffect.js +2 -5
  149. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  150. package/lib/commonjs/index.d.ts +1 -0
  151. package/lib/commonjs/index.js +21 -0
  152. package/lib/commonjs/index.js.map +1 -1
  153. package/lib/commonjs/skia/types/MaskFilter.js +4 -0
  154. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  155. package/lib/commonjs/skia/web/JsiSkPicture.js +2 -1
  156. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  157. package/lib/commonjs/views/SkiaBaseWebView.js +1 -1
  158. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  159. package/lib/commonjs/views/types.js +3 -0
  160. package/lib/commonjs/views/types.js.map +1 -1
  161. package/lib/module/dom/nodes/datatypes/Rect.js +5 -1
  162. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  163. package/lib/module/external/reanimated/index.d.ts +1 -0
  164. package/lib/module/external/reanimated/index.js +1 -0
  165. package/lib/module/external/reanimated/index.js.map +1 -1
  166. package/lib/module/external/reanimated/moduleWrapper.js +1 -9
  167. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  168. package/lib/module/external/reanimated/renderHelpers.js +48 -2
  169. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  170. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +2 -0
  171. package/lib/module/external/reanimated/useDerivedValueOnJS.js +15 -0
  172. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +1 -0
  173. package/lib/module/external/reanimated/useSharedValueEffect.js +3 -6
  174. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  175. package/lib/module/index.d.ts +1 -0
  176. package/lib/module/index.js +1 -0
  177. package/lib/module/index.js.map +1 -1
  178. package/lib/module/skia/types/MaskFilter.js +3 -0
  179. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  180. package/lib/module/views/types.js +3 -0
  181. package/lib/module/views/types.js.map +1 -1
  182. package/lib/typescript/src/external/reanimated/index.d.ts +1 -0
  183. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +2 -0
  184. package/lib/typescript/src/index.d.ts +1 -0
  185. package/libs/android/arm64-v8a/libskia.a +0 -0
  186. package/libs/android/arm64-v8a/libskottie.a +0 -0
  187. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  188. package/libs/android/arm64-v8a/libsksg.a +0 -0
  189. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  190. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  191. package/libs/android/arm64-v8a/libsvg.a +0 -0
  192. package/libs/android/armeabi-v7a/libskia.a +0 -0
  193. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  194. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  195. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  196. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  197. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  198. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  199. package/libs/android/x86/libskia.a +0 -0
  200. package/libs/android/x86/libskottie.a +0 -0
  201. package/libs/android/x86/libskparagraph.a +0 -0
  202. package/libs/android/x86/libsksg.a +0 -0
  203. package/libs/android/x86/libskshaper.a +0 -0
  204. package/libs/android/x86/libskunicode.a +0 -0
  205. package/libs/android/x86/libsvg.a +0 -0
  206. package/libs/android/x86_64/libskia.a +0 -0
  207. package/libs/android/x86_64/libskottie.a +0 -0
  208. package/libs/android/x86_64/libskparagraph.a +0 -0
  209. package/libs/android/x86_64/libsksg.a +0 -0
  210. package/libs/android/x86_64/libskshaper.a +0 -0
  211. package/libs/android/x86_64/libskunicode.a +0 -0
  212. package/libs/android/x86_64/libsvg.a +0 -0
  213. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  214. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  215. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  216. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  217. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  218. package/libs/ios/libskparagraph.xcframework/Info.plist +5 -5
  219. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  220. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  221. package/libs/ios/libsksg.xcframework/Info.plist +5 -5
  222. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  223. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  224. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  225. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  226. package/libs/ios/libskunicode.xcframework/Info.plist +5 -5
  227. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  228. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  229. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  230. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  231. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  232. package/package.json +1 -1
  233. package/react-native-skia.podspec +1 -1
  234. package/src/dom/nodes/datatypes/Rect.ts +6 -2
  235. package/src/external/reanimated/index.ts +1 -0
  236. package/src/external/reanimated/moduleWrapper.ts +6 -10
  237. package/src/external/reanimated/renderHelpers.ts +41 -1
  238. package/src/external/reanimated/useDerivedValueOnJS.ts +24 -0
  239. package/src/external/reanimated/useSharedValueEffect.ts +4 -7
  240. package/src/index.ts +1 -0
  241. package/cpp/skia/include/core/SkDeferredDisplayList.h +0 -15
  242. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +0 -15
  243. package/cpp/skia/include/core/SkPromiseImageTexture.h +0 -20
  244. package/cpp/skia/include/core/SkSurfaceCharacterization.h +0 -15
  245. package/cpp/skia/include/core/SkTime.h +0 -63
  246. package/cpp/skia/include/effects/SkOpPathEffect.h +0 -43
  247. package/cpp/skia/include/effects/SkStrokeAndFillPathEffect.h +0 -28
  248. package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +0 -32
  249. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +0 -95
  250. package/cpp/skia/include/private/SkBitmaskEnum.h +0 -59
  251. package/cpp/skia/include/private/SkSLDefines.h +0 -64
  252. package/cpp/skia/include/private/SkShadowFlags.h +0 -27
  253. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +0 -26
  254. /package/cpp/skia/{include/private/base → src/core}/SkPathEnums.h +0 -0
@@ -62,7 +62,7 @@ enum class BackendSurfaceAccess;
62
62
 
63
63
  class SK_API GrDirectContext : public GrRecordingContext {
64
64
  public:
65
- #ifdef SK_GL
65
+ #if defined(SK_GL) && !defined(SK_DISABLE_LEGACY_GL_GRDIRECTCONTEXT_FACTORIES)
66
66
  /**
67
67
  * Creates a GrDirectContext for a backend context. If no GrGLInterface is provided then the
68
68
  * result of GrGLMakeNativeInterface() is used if it succeeds.
@@ -116,12 +116,6 @@ public:
116
116
  static sk_sp<GrDirectContext> MakeDirect3D(const GrD3DBackendContext&);
117
117
  #endif
118
118
 
119
- #ifdef SK_DAWN
120
- static sk_sp<GrDirectContext> MakeDawn(const wgpu::Device&,
121
- const GrContextOptions&);
122
- static sk_sp<GrDirectContext> MakeDawn(const wgpu::Device&);
123
- #endif
124
-
125
119
  static sk_sp<GrDirectContext> MakeMock(const GrMockOptions*, const GrContextOptions&);
126
120
  static sk_sp<GrDirectContext> MakeMock(const GrMockOptions*);
127
121
 
@@ -171,13 +165,20 @@ public:
171
165
  void abandonContext() override;
172
166
 
173
167
  /**
174
- * Returns true if the context was abandoned or if the if the backend specific context has
175
- * gotten into an unrecoverarble, lost state (e.g. in Vulkan backend if we've gotten a
168
+ * Returns true if the context was abandoned or if the backend specific context has gotten into
169
+ * an unrecoverarble, lost state (e.g. in Vulkan backend if we've gotten a
176
170
  * VK_ERROR_DEVICE_LOST). If the backend context is lost, this call will also abandon this
177
171
  * context.
178
172
  */
179
173
  bool abandoned() override;
180
174
 
175
+ /**
176
+ * Returns true if the backend specific context has gotten into an unrecoverarble, lost state
177
+ * (e.g. in Vulkan backend if we've gotten a VK_ERROR_DEVICE_LOST). If the backend context is
178
+ * lost, this call will also abandon this context.
179
+ */
180
+ bool isDeviceLost();
181
+
181
182
  // TODO: Remove this from public after migrating Chrome.
182
183
  sk_sp<GrContextThreadSafeProxy> threadSafeProxy();
183
184
 
@@ -272,18 +273,19 @@ public:
272
273
  /**
273
274
  * Purge GPU resources that haven't been used in the past 'msNotUsed' milliseconds or are
274
275
  * otherwise marked for deletion, regardless of whether the context is under budget.
276
+
275
277
  *
276
- * If 'scratchResourcesOnly' is true all unlocked scratch resources older than 'msNotUsed' will
277
- * be purged but the unlocked resources with persistent data will remain. If
278
- * 'scratchResourcesOnly' is false then all unlocked resources older than 'msNotUsed' will be
279
- * purged.
280
- *
281
- * @param msNotUsed Only unlocked resources not used in these last milliseconds
282
- * will be cleaned up.
283
- * @param scratchResourcesOnly If true only unlocked scratch resources will be purged.
278
+ * @param msNotUsed Only unlocked resources not used in these last milliseconds will be
279
+ * cleaned up.
280
+ * @param opts Specify which resources should be cleaned up. If kScratchResourcesOnly
281
+ * then, all unlocked scratch resources older than 'msNotUsed' will be purged
282
+ * but the unlocked resources with persistent data will remain. If
283
+ * kAllResources
284
284
  */
285
- void performDeferredCleanup(std::chrono::milliseconds msNotUsed,
286
- bool scratchResourcesOnly=false);
285
+
286
+ void performDeferredCleanup(
287
+ std::chrono::milliseconds msNotUsed,
288
+ GrPurgeResourceOptions opts = GrPurgeResourceOptions::kAllResources);
287
289
 
288
290
  // Temporary compatibility API for Android.
289
291
  void purgeResourcesNotUsedInMs(std::chrono::milliseconds msNotUsed) {
@@ -312,10 +314,10 @@ public:
312
314
  * ensure that resource usage is under budget (i.e., even if 'scratchResourcesOnly' is true
313
315
  * some resources with persistent data may be purged to be under budget).
314
316
  *
315
- * @param scratchResourcesOnly If true only unlocked scratch resources will be purged prior
316
- * enforcing the budget requirements.
317
+ * @param opts If kScratchResourcesOnly only unlocked scratch resources will be purged prior
318
+ * enforcing the budget requirements.
317
319
  */
318
- void purgeUnlockedResources(bool scratchResourcesOnly);
320
+ void purgeUnlockedResources(GrPurgeResourceOptions opts);
319
321
 
320
322
  /**
321
323
  * Gets the maximum supported texture size.
@@ -332,6 +334,11 @@ public:
332
334
  */
333
335
  using GrRecordingContext::colorTypeSupportedAsImage;
334
336
 
337
+ /**
338
+ * Does this context support protected content?
339
+ */
340
+ using GrRecordingContext::supportsProtectedContent;
341
+
335
342
  /**
336
343
  * Can a SkSurface be created with the given color type. To check whether MSAA is supported
337
344
  * use maxSurfaceSampleCountForColorType().
@@ -365,11 +372,11 @@ public:
365
372
  /**
366
373
  * Call to ensure all drawing to the context has been flushed and submitted to the underlying 3D
367
374
  * API. This is equivalent to calling GrContext::flush with a default GrFlushInfo followed by
368
- * GrContext::submit(syncCpu).
375
+ * GrContext::submit(sync).
369
376
  */
370
- void flushAndSubmit(bool syncCpu = false) {
377
+ void flushAndSubmit(GrSyncCpu sync = GrSyncCpu::kNo) {
371
378
  this->flush(GrFlushInfo());
372
- this->submit(syncCpu);
379
+ this->submit(sync);
373
380
  }
374
381
 
375
382
  /**
@@ -391,7 +398,7 @@ public:
391
398
  * the GPU. Thus the client should not have the GPU wait on any of the semaphores passed in with
392
399
  * the GrFlushInfo. Regardless of whether semaphores were submitted to the GPU or not, the
393
400
  * client is still responsible for deleting any initialized semaphores.
394
- * Regardleess of semaphore submission the context will still be flushed. It should be
401
+ * Regardless of semaphore submission the context will still be flushed. It should be
395
402
  * emphasized that a return value of GrSemaphoresSubmitted::kNo does not mean the flush did not
396
403
  * happen. It simply means there were no semaphores submitted to the GPU. A caller should only
397
404
  * take this as a failure if they passed in semaphores to be submitted.
@@ -462,9 +469,6 @@ public:
462
469
  * @param access type of access the call will do on the backend object after flush
463
470
  * @param info flush options
464
471
  */
465
- GrSemaphoresSubmitted flush(sk_sp<SkSurface> surface,
466
- SkSurfaces::BackendSurfaceAccess access,
467
- const GrFlushInfo& info);
468
472
  GrSemaphoresSubmitted flush(SkSurface* surface,
469
473
  SkSurfaces::BackendSurfaceAccess access,
470
474
  const GrFlushInfo& info);
@@ -488,9 +492,6 @@ public:
488
492
  * @param info flush options
489
493
  * @param newState optional state change request after flush
490
494
  */
491
- GrSemaphoresSubmitted flush(sk_sp<SkSurface> surface,
492
- const GrFlushInfo& info,
493
- const skgpu::MutableTextureState* newState = nullptr);
494
495
  GrSemaphoresSubmitted flush(SkSurface* surface,
495
496
  const GrFlushInfo& info,
496
497
  const skgpu::MutableTextureState* newState = nullptr);
@@ -503,14 +504,14 @@ public:
503
504
  *
504
505
  * Has no effect on a CPU-backed surface.
505
506
  */
506
- void flushAndSubmit(sk_sp<SkSurface> surface, bool syncCpu = false);
507
+ void flushAndSubmit(SkSurface* surface, GrSyncCpu sync = GrSyncCpu::kNo);
507
508
 
508
509
  /**
509
510
  * Flushes the given surface with the default GrFlushInfo.
510
511
  *
511
512
  * Has no effect on a CPU-backed surface.
512
513
  */
513
- void flush(sk_sp<SkSurface> surface);
514
+ void flush(SkSurface* surface);
514
515
 
515
516
  /**
516
517
  * Submit outstanding work to the gpu from all previously un-submitted flushes. The return
@@ -523,10 +524,10 @@ public:
523
524
  * If it returns false, then those same semaphores will not have been submitted and we will not
524
525
  * try to submit them again. The caller is free to delete the semaphores at any time.
525
526
  *
526
- * If the syncCpu flag is true this function will return once the gpu has finished with all
527
+ * If sync flag is GrSyncCpu::kYes, this function will return once the gpu has finished with all
527
528
  * submitted work.
528
529
  */
529
- bool submit(bool syncCpu = false);
530
+ bool submit(GrSyncCpu sync = GrSyncCpu::kNo);
530
531
 
531
532
  /**
532
533
  * Checks whether any asynchronous work is complete and if so calls related callbacks.
@@ -574,93 +575,96 @@ public:
574
575
  GrBackendTexture createBackendTexture(int width,
575
576
  int height,
576
577
  const GrBackendFormat&,
577
- GrMipmapped,
578
+ skgpu::Mipmapped,
578
579
  GrRenderable,
579
580
  GrProtected = GrProtected::kNo,
580
581
  std::string_view label = {});
581
582
 
582
- /**
583
- * If possible, create an uninitialized backend texture. The client should ensure that the
584
- * returned backend texture is valid.
585
- * If successful, the created backend texture will be compatible with the provided
586
- * SkColorType.
587
- * For the Vulkan backend the layout of the created VkImage will be:
588
- * VK_IMAGE_LAYOUT_UNDEFINED.
589
- */
590
- GrBackendTexture createBackendTexture(int width, int height,
591
- SkColorType,
592
- GrMipmapped,
593
- GrRenderable,
594
- GrProtected = GrProtected::kNo,
595
- std::string_view label = {});
583
+ /**
584
+ * If possible, create an uninitialized backend texture. The client should ensure that the
585
+ * returned backend texture is valid.
586
+ * If successful, the created backend texture will be compatible with the provided
587
+ * SkColorType.
588
+ * For the Vulkan backend the layout of the created VkImage will be:
589
+ * VK_IMAGE_LAYOUT_UNDEFINED.
590
+ */
591
+ GrBackendTexture createBackendTexture(int width,
592
+ int height,
593
+ SkColorType,
594
+ skgpu::Mipmapped,
595
+ GrRenderable,
596
+ GrProtected = GrProtected::kNo,
597
+ std::string_view label = {});
596
598
 
597
- /**
598
- * If possible, create a backend texture initialized to a particular color. The client should
599
- * ensure that the returned backend texture is valid. The client can pass in a finishedProc
600
- * to be notified when the data has been uploaded by the gpu and the texture can be deleted. The
601
- * client is required to call `submit` to send the upload work to the gpu. The
602
- * finishedProc will always get called even if we failed to create the GrBackendTexture.
603
- * For the Vulkan backend the layout of the created VkImage will be:
604
- * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
605
- */
606
- GrBackendTexture createBackendTexture(int width, int height,
607
- const GrBackendFormat&,
608
- const SkColor4f& color,
609
- GrMipmapped,
610
- GrRenderable,
611
- GrProtected = GrProtected::kNo,
612
- GrGpuFinishedProc finishedProc = nullptr,
613
- GrGpuFinishedContext finishedContext = nullptr,
614
- std::string_view label = {});
599
+ /**
600
+ * If possible, create a backend texture initialized to a particular color. The client should
601
+ * ensure that the returned backend texture is valid. The client can pass in a finishedProc
602
+ * to be notified when the data has been uploaded by the gpu and the texture can be deleted. The
603
+ * client is required to call `submit` to send the upload work to the gpu. The
604
+ * finishedProc will always get called even if we failed to create the GrBackendTexture.
605
+ * For the Vulkan backend the layout of the created VkImage will be:
606
+ * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
607
+ */
608
+ GrBackendTexture createBackendTexture(int width,
609
+ int height,
610
+ const GrBackendFormat&,
611
+ const SkColor4f& color,
612
+ skgpu::Mipmapped,
613
+ GrRenderable,
614
+ GrProtected = GrProtected::kNo,
615
+ GrGpuFinishedProc finishedProc = nullptr,
616
+ GrGpuFinishedContext finishedContext = nullptr,
617
+ std::string_view label = {});
615
618
 
616
- /**
617
- * If possible, create a backend texture initialized to a particular color. The client should
618
- * ensure that the returned backend texture is valid. The client can pass in a finishedProc
619
- * to be notified when the data has been uploaded by the gpu and the texture can be deleted. The
620
- * client is required to call `submit` to send the upload work to the gpu. The
621
- * finishedProc will always get called even if we failed to create the GrBackendTexture.
622
- * If successful, the created backend texture will be compatible with the provided
623
- * SkColorType.
624
- * For the Vulkan backend the layout of the created VkImage will be:
625
- * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
626
- */
627
- GrBackendTexture createBackendTexture(int width, int height,
628
- SkColorType,
629
- const SkColor4f& color,
630
- GrMipmapped,
631
- GrRenderable,
632
- GrProtected = GrProtected::kNo,
633
- GrGpuFinishedProc finishedProc = nullptr,
634
- GrGpuFinishedContext finishedContext = nullptr,
635
- std::string_view label = {});
619
+ /**
620
+ * If possible, create a backend texture initialized to a particular color. The client should
621
+ * ensure that the returned backend texture is valid. The client can pass in a finishedProc
622
+ * to be notified when the data has been uploaded by the gpu and the texture can be deleted. The
623
+ * client is required to call `submit` to send the upload work to the gpu. The
624
+ * finishedProc will always get called even if we failed to create the GrBackendTexture.
625
+ * If successful, the created backend texture will be compatible with the provided
626
+ * SkColorType.
627
+ * For the Vulkan backend the layout of the created VkImage will be:
628
+ * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
629
+ */
630
+ GrBackendTexture createBackendTexture(int width,
631
+ int height,
632
+ SkColorType,
633
+ const SkColor4f& color,
634
+ skgpu::Mipmapped,
635
+ GrRenderable,
636
+ GrProtected = GrProtected::kNo,
637
+ GrGpuFinishedProc finishedProc = nullptr,
638
+ GrGpuFinishedContext finishedContext = nullptr,
639
+ std::string_view label = {});
636
640
 
637
- /**
638
- * If possible, create a backend texture initialized with the provided pixmap data. The client
639
- * should ensure that the returned backend texture is valid. The client can pass in a
640
- * finishedProc to be notified when the data has been uploaded by the gpu and the texture can be
641
- * deleted. The client is required to call `submit` to send the upload work to the gpu.
642
- * The finishedProc will always get called even if we failed to create the GrBackendTexture.
643
- * If successful, the created backend texture will be compatible with the provided
644
- * pixmap(s). Compatible, in this case, means that the backend format will be the result
645
- * of calling defaultBackendFormat on the base pixmap's colortype. The src data can be deleted
646
- * when this call returns.
647
- * If numLevels is 1 a non-mipmapped texture will result. If a mipmapped texture is desired
648
- * the data for all the mipmap levels must be provided. In the mipmapped case all the
649
- * colortypes of the provided pixmaps must be the same. Additionally, all the miplevels
650
- * must be sized correctly (please see SkMipmap::ComputeLevelSize and ComputeLevelCount). The
651
- * GrSurfaceOrigin controls whether the pixmap data is vertically flipped in the texture.
652
- * Note: the pixmap's alphatypes and colorspaces are ignored.
653
- * For the Vulkan backend the layout of the created VkImage will be:
654
- * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
655
- */
656
- GrBackendTexture createBackendTexture(const SkPixmap srcData[],
657
- int numLevels,
658
- GrSurfaceOrigin,
659
- GrRenderable,
660
- GrProtected,
661
- GrGpuFinishedProc finishedProc = nullptr,
662
- GrGpuFinishedContext finishedContext = nullptr,
663
- std::string_view label = {});
641
+ /**
642
+ * If possible, create a backend texture initialized with the provided pixmap data. The client
643
+ * should ensure that the returned backend texture is valid. The client can pass in a
644
+ * finishedProc to be notified when the data has been uploaded by the gpu and the texture can be
645
+ * deleted. The client is required to call `submit` to send the upload work to the gpu.
646
+ * The finishedProc will always get called even if we failed to create the GrBackendTexture.
647
+ * If successful, the created backend texture will be compatible with the provided
648
+ * pixmap(s). Compatible, in this case, means that the backend format will be the result
649
+ * of calling defaultBackendFormat on the base pixmap's colortype. The src data can be deleted
650
+ * when this call returns.
651
+ * If numLevels is 1 a non-mipmapped texture will result. If a mipmapped texture is desired
652
+ * the data for all the mipmap levels must be provided. In the mipmapped case all the
653
+ * colortypes of the provided pixmaps must be the same. Additionally, all the miplevels
654
+ * must be sized correctly (please see SkMipmap::ComputeLevelSize and ComputeLevelCount). The
655
+ * GrSurfaceOrigin controls whether the pixmap data is vertically flipped in the texture.
656
+ * Note: the pixmap's alphatypes and colorspaces are ignored.
657
+ * For the Vulkan backend the layout of the created VkImage will be:
658
+ * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
659
+ */
660
+ GrBackendTexture createBackendTexture(const SkPixmap srcData[],
661
+ int numLevels,
662
+ GrSurfaceOrigin,
663
+ GrRenderable,
664
+ GrProtected,
665
+ GrGpuFinishedProc finishedProc = nullptr,
666
+ GrGpuFinishedContext finishedContext = nullptr,
667
+ std::string_view label = {});
664
668
 
665
669
  /**
666
670
  * Convenience version createBackendTexture() that takes just a base level pixmap.
@@ -786,18 +790,20 @@ public:
786
790
  * For the Vulkan backend the layout of the created VkImage will be:
787
791
  * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
788
792
  */
789
- GrBackendTexture createCompressedBackendTexture(int width, int height,
793
+ GrBackendTexture createCompressedBackendTexture(int width,
794
+ int height,
790
795
  const GrBackendFormat&,
791
796
  const SkColor4f& color,
792
- GrMipmapped,
797
+ skgpu::Mipmapped,
793
798
  GrProtected = GrProtected::kNo,
794
799
  GrGpuFinishedProc finishedProc = nullptr,
795
800
  GrGpuFinishedContext finishedContext = nullptr);
796
801
 
797
- GrBackendTexture createCompressedBackendTexture(int width, int height,
802
+ GrBackendTexture createCompressedBackendTexture(int width,
803
+ int height,
798
804
  SkTextureCompressionType,
799
805
  const SkColor4f& color,
800
- GrMipmapped,
806
+ skgpu::Mipmapped,
801
807
  GrProtected = GrProtected::kNo,
802
808
  GrGpuFinishedProc finishedProc = nullptr,
803
809
  GrGpuFinishedContext finishedContext = nullptr);
@@ -814,18 +820,22 @@ public:
814
820
  * For the Vulkan backend the layout of the created VkImage will be:
815
821
  * VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
816
822
  */
817
- GrBackendTexture createCompressedBackendTexture(int width, int height,
823
+ GrBackendTexture createCompressedBackendTexture(int width,
824
+ int height,
818
825
  const GrBackendFormat&,
819
- const void* data, size_t dataSize,
820
- GrMipmapped,
826
+ const void* data,
827
+ size_t dataSize,
828
+ skgpu::Mipmapped,
821
829
  GrProtected = GrProtected::kNo,
822
830
  GrGpuFinishedProc finishedProc = nullptr,
823
831
  GrGpuFinishedContext finishedContext = nullptr);
824
832
 
825
- GrBackendTexture createCompressedBackendTexture(int width, int height,
833
+ GrBackendTexture createCompressedBackendTexture(int width,
834
+ int height,
826
835
  SkTextureCompressionType,
827
- const void* data, size_t dataSize,
828
- GrMipmapped,
836
+ const void* data,
837
+ size_t dataSize,
838
+ skgpu::Mipmapped,
829
839
  GrProtected = GrProtected::kNo,
830
840
  GrGpuFinishedProc finishedProc = nullptr,
831
841
  GrGpuFinishedContext finishedContext = nullptr);
@@ -892,7 +902,7 @@ public:
892
902
  GrGpuFinishedProc finishedProc = nullptr,
893
903
  GrGpuFinishedContext finishedContext = nullptr);
894
904
 
895
- void deleteBackendTexture(GrBackendTexture);
905
+ void deleteBackendTexture(const GrBackendTexture&);
896
906
 
897
907
  // This interface allows clients to pre-compile shaders and populate the runtime program cache.
898
908
  // The key and data blobs should be the ones passed to the PersistentCache, in SkSL format.
@@ -996,7 +1006,7 @@ private:
996
1006
  // invoked after objects they depend upon have already been destroyed.
997
1007
  std::unique_ptr<SkTaskGroup> fTaskGroup;
998
1008
  std::unique_ptr<sktext::gpu::StrikeCache> fStrikeCache;
999
- sk_sp<GrGpu> fGpu;
1009
+ std::unique_ptr<GrGpu> fGpu;
1000
1010
  std::unique_ptr<GrResourceCache> fResourceCache;
1001
1011
  std::unique_ptr<GrResourceProvider> fResourceProvider;
1002
1012
 
@@ -83,6 +83,11 @@ public:
83
83
  */
84
84
  SK_API bool colorTypeSupportedAsImage(SkColorType) const;
85
85
 
86
+ /**
87
+ * Does this context support protected content?
88
+ */
89
+ SK_API bool supportsProtectedContent() const;
90
+
86
91
  /**
87
92
  * Gets the maximum supported sample count for a color type. 1 is returned if only non-MSAA
88
93
  * rendering is supported for the color type. 0 is returned if rendering to this color type
@@ -215,7 +220,7 @@ protected:
215
220
  int numPathMaskCacheHits() const { return fNumPathMaskCacheHits; }
216
221
  void incNumPathMasksCacheHits() { fNumPathMaskCacheHits++; }
217
222
 
218
- #if GR_TEST_UTILS
223
+ #if defined(GR_TEST_UTILS)
219
224
  void dump(SkString* out) const;
220
225
  void dumpKeyValuePairs(skia_private::TArray<SkString>* keys,
221
226
  skia_private::TArray<double>* values) const;
@@ -229,7 +234,7 @@ protected:
229
234
  void incNumPathMasksGenerated() {}
230
235
  void incNumPathMasksCacheHits() {}
231
236
 
232
- #if GR_TEST_UTILS
237
+ #if defined(GR_TEST_UTILS)
233
238
  void dump(SkString*) const {}
234
239
  void dumpKeyValuePairs(skia_private::TArray<SkString>* keys,
235
240
  skia_private::TArray<double>* values) const {}
@@ -237,7 +242,7 @@ protected:
237
242
  #endif // GR_GPU_STATS
238
243
  } fStats;
239
244
 
240
- #if GR_GPU_STATS && GR_TEST_UTILS
245
+ #if GR_GPU_STATS && defined(GR_TEST_UTILS)
241
246
  struct DMSAAStats {
242
247
  void dumpKeyValuePairs(skia_private::TArray<SkString>* keys,
243
248
  skia_private::TArray<double>* values) const;
@@ -265,7 +270,7 @@ private:
265
270
  std::unique_ptr<GrDrawingManager> fDrawingManager;
266
271
  std::unique_ptr<GrProxyProvider> fProxyProvider;
267
272
 
268
- #if GR_TEST_UTILS
273
+ #if defined(GR_TEST_UTILS)
269
274
  int fSuppressWarningMessages = 0;
270
275
  #endif
271
276
  };
@@ -23,9 +23,6 @@ struct GrD3DSurfaceInfo;
23
23
  #ifdef SK_METAL
24
24
  #include "include/private/gpu/ganesh/GrMtlTypesPriv.h"
25
25
  #endif
26
- #ifdef SK_DAWN
27
- #include "include/private/gpu/ganesh/GrDawnTypesPriv.h"
28
- #endif
29
26
  #include "include/private/gpu/ganesh/GrMockTypesPriv.h"
30
27
 
31
28
  class GrSurfaceInfo {
@@ -60,15 +57,6 @@ public:
60
57
  , fLevelCount(mtlInfo.fLevelCount)
61
58
  , fProtected(mtlInfo.fProtected)
62
59
  , fMtlSpec(mtlInfo) {}
63
- #endif
64
- #ifdef SK_DAWN
65
- GrSurfaceInfo(const GrDawnSurfaceInfo& dawnInfo)
66
- : fBackend(GrBackendApi::kDawn)
67
- , fValid(true)
68
- , fSampleCount(dawnInfo.fSampleCount)
69
- , fLevelCount(dawnInfo.fLevelCount)
70
- , fProtected(dawnInfo.fProtected)
71
- , fDawnSpec(dawnInfo) {}
72
60
  #endif
73
61
  GrSurfaceInfo(const GrMockSurfaceInfo& mockInfo)
74
62
  : fBackend(GrBackendApi::kMock)
@@ -117,15 +105,6 @@ public:
117
105
  *info = GrMtlTextureSpecToSurfaceInfo(fMtlSpec, fSampleCount, fLevelCount, fProtected);
118
106
  return true;
119
107
  }
120
- #endif
121
- #ifdef SK_DAWN
122
- bool getDawnSurfaceInfo(GrDawnSurfaceInfo* info) const {
123
- if (!this->isValid() || fBackend != GrBackendApi::kDawn) {
124
- return false;
125
- }
126
- *info = GrDawnTextureSpecToSurfaceInfo(fDawnSpec, fSampleCount, fLevelCount, fProtected);
127
- return true;
128
- }
129
108
  #endif
130
109
  bool getMockSurfaceInfo(GrMockSurfaceInfo* info) const {
131
110
  if (!this->isValid() || fBackend != GrBackendApi::kMock) {
@@ -155,9 +134,6 @@ private:
155
134
  #endif
156
135
  #ifdef SK_METAL
157
136
  GrMtlTextureSpec fMtlSpec;
158
- #endif
159
- #ifdef SK_DAWN
160
- GrDawnTextureSpec fDawnSpec;
161
137
  #endif
162
138
  GrMockTextureSpec fMockSpec;
163
139
  };
@@ -98,13 +98,18 @@ enum class GrBackendApi : unsigned {
98
98
  kVulkan,
99
99
  kMetal,
100
100
  kDirect3D,
101
- kDawn,
101
+
102
102
  /**
103
103
  * Mock is a backend that does not draw anything. It is used for unit tests
104
104
  * and to measure CPU overhead.
105
105
  */
106
106
  kMock,
107
107
 
108
+ /**
109
+ * Ganesh doesn't support some context types (e.g. Dawn) and will return Unsupported.
110
+ */
111
+ kUnsupported,
112
+
108
113
  /**
109
114
  * Added here to support the legacy GrBackend enum value and clients who referenced it using
110
115
  * GrBackend::kOpenGL_GrBackend.
@@ -241,4 +246,14 @@ enum class GrSemaphoresSubmitted : bool {
241
246
  kYes = true
242
247
  };
243
248
 
249
+ enum class GrPurgeResourceOptions {
250
+ kAllResources,
251
+ kScratchResourcesOnly,
252
+ };
253
+
254
+ enum class GrSyncCpu : bool {
255
+ kNo = false,
256
+ kYes = true,
257
+ };
258
+
244
259
  #endif
@@ -28,12 +28,12 @@ public:
28
28
  * planes indicated by the SkYUVAInfo. The texture dimensions are taken from the SkYUVAInfo's
29
29
  * plane dimensions. All the described textures share a common origin. The planar image this
30
30
  * describes will be mip mapped if all the textures are individually mip mapped as indicated
31
- * by GrMipmapped. This will produce an invalid result (return false from isValid()) if the
31
+ * by skgpu::Mipmapped. This will produce an invalid result (return false from isValid()) if the
32
32
  * passed formats' channels don't agree with SkYUVAInfo.
33
33
  */
34
34
  GrYUVABackendTextureInfo(const SkYUVAInfo&,
35
35
  const GrBackendFormat[kMaxPlanes],
36
- GrMipmapped,
36
+ skgpu::Mipmapped,
37
37
  GrSurfaceOrigin);
38
38
 
39
39
  GrYUVABackendTextureInfo(const GrYUVABackendTextureInfo&) = default;
@@ -47,7 +47,7 @@ public:
47
47
 
48
48
  SkYUVColorSpace yuvColorSpace() const { return fYUVAInfo.yuvColorSpace(); }
49
49
 
50
- GrMipmapped mipmapped() const { return fMipmapped; }
50
+ skgpu::Mipmapped mipmapped() const { return fMipmapped; }
51
51
 
52
52
  GrSurfaceOrigin textureOrigin() const { return fTextureOrigin; }
53
53
 
@@ -72,7 +72,7 @@ public:
72
72
  private:
73
73
  SkYUVAInfo fYUVAInfo;
74
74
  GrBackendFormat fPlaneFormats[kMaxPlanes];
75
- GrMipmapped fMipmapped = GrMipmapped::kNo;
75
+ skgpu::Mipmapped fMipmapped = skgpu::Mipmapped::kNo;
76
76
  GrSurfaceOrigin fTextureOrigin = kTopLeft_GrSurfaceOrigin;
77
77
  };
78
78
 
@@ -134,7 +134,7 @@ public:
134
134
  * The caller must assume ownership of the object, and manage its reference count directly.
135
135
  * No call to Release() will be made.
136
136
  */
137
- T* SK_WARN_UNUSED_RESULT release() {
137
+ [[nodiscard]] T* release() {
138
138
  T* obj = fObject;
139
139
  fObject = nullptr;
140
140
  return obj;
@@ -216,7 +216,7 @@ struct GrD3DTextureResourceInfo {
216
216
  , fSampleQualityPattern(info.fSampleQualityPattern)
217
217
  , fProtected(info.fProtected) {}
218
218
 
219
- #if GR_TEST_UTILS
219
+ #if defined(GR_TEST_UTILS)
220
220
  bool operator==(const GrD3DTextureResourceInfo& that) const {
221
221
  return fResource == that.fResource && fResourceState == that.fResourceState &&
222
222
  fFormat == that.fFormat && fSampleCount == that.fSampleCount &&