@shopify/react-native-skia 2.0.4 → 2.0.6

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 (197) 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 +4 -2
  7. package/cpp/api/JsiSkPathEffectFactory.h +2 -2
  8. package/cpp/api/JsiSkTextBlobFactory.h +5 -3
  9. package/cpp/api/JsiSkTypeface.h +5 -4
  10. package/cpp/api/recorder/Drawings.h +26 -20
  11. package/cpp/api/recorder/PathEffects.h +3 -2
  12. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +1 -1
  13. package/cpp/skia/include/android/SkImageAndroid.h +1 -8
  14. package/cpp/skia/include/config/SkUserConfig.h +9 -0
  15. package/cpp/skia/include/core/SkCPUContext.h +31 -0
  16. package/cpp/skia/include/core/SkCPURecorder.h +69 -0
  17. package/cpp/skia/include/core/SkCanvas.h +57 -13
  18. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  19. package/cpp/skia/include/core/SkData.h +63 -37
  20. package/cpp/skia/include/core/SkFont.h +94 -65
  21. package/cpp/skia/include/core/SkImage.h +10 -9
  22. package/cpp/skia/include/core/SkImageGenerator.h +3 -0
  23. package/cpp/skia/include/core/SkMatrix.h +102 -116
  24. package/cpp/skia/include/core/SkMilestone.h +1 -1
  25. package/cpp/skia/include/core/SkPath.h +163 -60
  26. package/cpp/skia/include/core/SkPathBuilder.h +713 -30
  27. package/cpp/skia/include/core/SkPathTypes.h +5 -1
  28. package/cpp/skia/include/core/SkPictureRecorder.h +6 -6
  29. package/cpp/skia/include/core/SkRecorder.h +35 -0
  30. package/cpp/skia/include/core/SkRect.h +57 -27
  31. package/cpp/skia/include/core/SkRegion.h +1 -1
  32. package/cpp/skia/include/core/SkSurface.h +8 -1
  33. package/cpp/skia/include/core/SkTextBlob.h +50 -6
  34. package/cpp/skia/include/core/SkTraceMemoryDump.h +7 -0
  35. package/cpp/skia/include/core/SkTypeface.h +53 -26
  36. package/cpp/skia/include/core/SkTypes.h +6 -0
  37. package/cpp/skia/include/effects/SkDashPathEffect.h +9 -3
  38. package/cpp/skia/include/effects/SkRuntimeEffect.h +1 -1
  39. package/cpp/skia/include/encode/SkEncoder.h +1 -1
  40. package/cpp/skia/include/encode/SkICC.h +1 -1
  41. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +23 -0
  42. package/cpp/skia/include/gpu/ganesh/GrRecordingContext.h +12 -0
  43. package/cpp/skia/include/gpu/graphite/Context.h +32 -8
  44. package/cpp/skia/include/gpu/graphite/ContextOptions.h +22 -4
  45. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +21 -4
  46. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +16 -2
  47. package/cpp/skia/include/gpu/graphite/Recorder.h +30 -10
  48. package/cpp/skia/include/gpu/graphite/Recording.h +7 -3
  49. package/cpp/skia/include/gpu/graphite/TextureInfo.h +3 -3
  50. package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +15 -0
  51. package/cpp/skia/include/gpu/graphite/precompile/PrecompileShader.h +89 -13
  52. package/cpp/skia/include/gpu/graphite/vk/precompile/VulkanPrecompileShader.h +39 -0
  53. package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +1 -1
  54. package/cpp/skia/include/gpu/vk/VulkanPreferredFeatures.h +214 -0
  55. package/cpp/skia/include/pathops/SkPathOps.h +7 -111
  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/pathops/include/SkPathOps.h +121 -0
  92. package/cpp/skia/modules/skcms/src/skcms_internals.h +10 -2
  93. package/cpp/skia/modules/skcms/src/skcms_public.h +39 -10
  94. package/lib/commonjs/sksg/Container.d.ts +1 -0
  95. package/lib/commonjs/sksg/Container.js +3 -0
  96. package/lib/commonjs/sksg/Container.js.map +1 -1
  97. package/lib/commonjs/sksg/Reconciler.js +1 -0
  98. package/lib/commonjs/sksg/Reconciler.js.map +1 -1
  99. package/lib/module/sksg/Container.d.ts +1 -0
  100. package/lib/module/sksg/Container.js +3 -0
  101. package/lib/module/sksg/Container.js.map +1 -1
  102. package/lib/module/sksg/Reconciler.js +1 -0
  103. package/lib/module/sksg/Reconciler.js.map +1 -1
  104. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +2 -1
  105. package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +6 -3
  106. package/lib/typescript/lib/module/sksg/Container.d.ts +2 -1
  107. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +6 -3
  108. package/lib/typescript/src/sksg/Container.d.ts +1 -0
  109. package/libs/android/arm64-v8a/libpathops.a +0 -0
  110. package/libs/android/arm64-v8a/libskia.a +0 -0
  111. package/libs/android/arm64-v8a/libskottie.a +0 -0
  112. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  113. package/libs/android/arm64-v8a/libsksg.a +0 -0
  114. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  115. package/libs/android/arm64-v8a/libskunicode_icu.a +0 -0
  116. package/libs/android/arm64-v8a/libsvg.a +0 -0
  117. package/libs/android/armeabi-v7a/libpathops.a +0 -0
  118. package/libs/android/armeabi-v7a/libskia.a +0 -0
  119. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  120. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  121. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  122. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  123. package/libs/android/armeabi-v7a/libskunicode_icu.a +0 -0
  124. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  125. package/libs/android/x86/libpathops.a +0 -0
  126. package/libs/android/x86/libskia.a +0 -0
  127. package/libs/android/x86/libskottie.a +0 -0
  128. package/libs/android/x86/libskparagraph.a +0 -0
  129. package/libs/android/x86/libsksg.a +0 -0
  130. package/libs/android/x86/libskshaper.a +0 -0
  131. package/libs/android/x86/libskunicode_icu.a +0 -0
  132. package/libs/android/x86/libsvg.a +0 -0
  133. package/libs/android/x86_64/libpathops.a +0 -0
  134. package/libs/android/x86_64/libskia.a +0 -0
  135. package/libs/android/x86_64/libskottie.a +0 -0
  136. package/libs/android/x86_64/libskparagraph.a +0 -0
  137. package/libs/android/x86_64/libsksg.a +0 -0
  138. package/libs/android/x86_64/libskshaper.a +0 -0
  139. package/libs/android/x86_64/libskunicode_icu.a +0 -0
  140. package/libs/android/x86_64/libsvg.a +0 -0
  141. package/libs/apple/libpathops.xcframework/Info.plist +94 -0
  142. package/libs/apple/libpathops.xcframework/ios-arm64_arm64e/libpathops.a +0 -0
  143. package/libs/apple/libpathops.xcframework/ios-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
  144. package/libs/apple/libpathops.xcframework/macos-arm64_x86_64/libpathops.a +0 -0
  145. package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e/libpathops.a +0 -0
  146. package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
  147. package/libs/apple/libskia.xcframework/Info.plist +7 -7
  148. package/libs/apple/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  149. package/libs/apple/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  150. package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
  151. package/libs/apple/libskia.xcframework/tvos-arm64_arm64e/libskia.a +0 -0
  152. package/libs/apple/libskia.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  153. package/libs/apple/libskottie.xcframework/Info.plist +10 -10
  154. package/libs/apple/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  155. package/libs/apple/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  156. package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
  157. package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e/libskottie.a +0 -0
  158. package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  159. package/libs/apple/libskparagraph.xcframework/Info.plist +13 -13
  160. package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  161. package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  162. package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
  163. package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e/libskparagraph.a +0 -0
  164. package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  165. package/libs/apple/libsksg.xcframework/Info.plist +11 -11
  166. package/libs/apple/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  167. package/libs/apple/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  168. package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
  169. package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e/libsksg.a +0 -0
  170. package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  171. package/libs/apple/libskshaper.xcframework/Info.plist +12 -12
  172. package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  173. package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  174. package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
  175. package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e/libskshaper.a +0 -0
  176. package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  177. package/libs/apple/libskunicode_core.xcframework/Info.plist +14 -14
  178. package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  179. package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
  180. package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
  181. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +13 -13
  182. package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  183. package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  184. package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
  185. package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
  186. package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
  187. package/libs/apple/libsvg.xcframework/Info.plist +17 -17
  188. package/libs/apple/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  189. package/libs/apple/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  190. package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
  191. package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e/libsvg.a +0 -0
  192. package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  193. package/package.json +1 -1
  194. package/react-native-skia.podspec +2 -1
  195. package/src/renderer/__tests__/e2e/BackdropFilters.spec.tsx +23 -0
  196. package/src/sksg/Container.ts +4 -0
  197. package/src/sksg/Reconciler.ts +1 -0
@@ -8,6 +8,10 @@
8
8
  #ifndef SkPathTypes_DEFINED
9
9
  #define SkPathTypes_DEFINED
10
10
 
11
+ #include "include/core/SkTypes.h"
12
+
13
+ #include <cstdint>
14
+
11
15
  enum class SkPathFillType {
12
16
  /** Specifies that "inside" is computed by a non-zero sum of signed edge crossings */
13
17
  kWinding,
@@ -45,7 +49,7 @@ enum SkPathSegmentMask {
45
49
  kCubic_SkPathSegmentMask = 1 << 3,
46
50
  };
47
51
 
48
- enum class SkPathVerb {
52
+ enum class SkPathVerb : uint8_t {
49
53
  kMove, //!< SkPath::RawIter returns 1 point
50
54
  kLine, //!< SkPath::RawIter returns 2 points
51
55
  kQuad, //!< SkPath::RawIter returns 3 points
@@ -27,7 +27,7 @@ class SkCanvas;
27
27
  class SkDrawable;
28
28
  class SkPicture;
29
29
  class SkRecord;
30
- class SkRecorder;
30
+ class SkRecordCanvas;
31
31
 
32
32
  class SK_API SkPictureRecorder {
33
33
  public:
@@ -102,11 +102,11 @@ private:
102
102
  friend class SkPictureRecorderReplayTester; // for unit testing
103
103
  void partialReplay(SkCanvas* canvas) const;
104
104
 
105
- bool fActivelyRecording;
106
- SkRect fCullRect;
107
- sk_sp<SkBBoxHierarchy> fBBH;
108
- std::unique_ptr<SkRecorder> fRecorder;
109
- sk_sp<SkRecord> fRecord;
105
+ sk_sp<SkBBoxHierarchy> fBBH;
106
+ std::unique_ptr<SkRecordCanvas> fRecorder;
107
+ sk_sp<SkRecord> fRecord;
108
+ SkRect fCullRect;
109
+ bool fActivelyRecording;
110
110
 
111
111
  SkPictureRecorder(SkPictureRecorder&&) = delete;
112
112
  SkPictureRecorder& operator=(SkPictureRecorder&&) = delete;
@@ -0,0 +1,35 @@
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
+ #ifndef SkRecorder_DEFINED
8
+ #define SkRecorder_DEFINED
9
+
10
+ #include "include/private/base/SkAPI.h"
11
+
12
+ namespace skcpu {
13
+ class Recorder;
14
+ }
15
+
16
+ class SK_API SkRecorder {
17
+ public:
18
+ SkRecorder() = default;
19
+ virtual ~SkRecorder() = default;
20
+ SkRecorder(const SkRecorder&) = delete;
21
+ SkRecorder(SkRecorder&&) = delete;
22
+ SkRecorder& operator=(const SkRecorder&) = delete;
23
+
24
+ enum class Type {
25
+ kCPU,
26
+ kGanesh,
27
+ kGraphite,
28
+ };
29
+
30
+ virtual Type type() const = 0;
31
+
32
+ virtual skcpu::Recorder* cpuRecorder() = 0;
33
+ };
34
+
35
+ #endif
@@ -10,6 +10,7 @@
10
10
 
11
11
  #include "include/core/SkPoint.h"
12
12
  #include "include/core/SkSize.h"
13
+ #include "include/core/SkSpan.h"
13
14
  #include "include/core/SkTypes.h"
14
15
  #include "include/private/base/SkFloatingPoint.h"
15
16
  #include "include/private/base/SkSafe32.h"
@@ -19,6 +20,7 @@
19
20
  #include <cmath>
20
21
  #include <cstdint>
21
22
  #include <cstring>
23
+ #include <optional>
22
24
 
23
25
  struct SkRect;
24
26
  class SkString;
@@ -571,6 +573,13 @@ struct SK_API SkIRect {
571
573
  return MakeLTRB(std::min(fLeft, fRight), std::min(fTop, fBottom),
572
574
  std::max(fLeft, fRight), std::max(fTop, fBottom));
573
575
  }
576
+
577
+ /** Returns pointer to first int32 in SkIRect, to treat it as an array with four
578
+ entries.
579
+
580
+ @return pointer to fLeft
581
+ */
582
+ const int32_t* asInt32s() const { return &fLeft; }
574
583
  };
575
584
 
576
585
  /** \struct SkRect
@@ -870,43 +879,64 @@ struct SK_API SkRect {
870
879
  fBottom = bottom;
871
880
  }
872
881
 
873
- /** Sets to bounds of SkPoint array with count entries. If count is zero or smaller,
874
- or if SkPoint array contains an infinity or NaN, sets to (0, 0, 0, 0).
875
-
876
- Result is either empty or sorted: fLeft is less than or equal to fRight, and
877
- fTop is less than or equal to fBottom.
882
+ /**
883
+ * Compute the bounds of the span of points.
884
+ * If the span is empty, returns the empty-rect {0, 0, 0, 0.
885
+ * If the span contains non-finite values (inf or nan), returns {}
886
+ */
887
+ static std::optional<SkRect> Bounds(SkSpan<const SkPoint> pts);
878
888
 
879
- @param pts SkPoint array
880
- @param count entries in array
881
- */
882
- void setBounds(const SkPoint pts[], int count) {
883
- (void)this->setBoundsCheck(pts, count);
889
+ static SkRect BoundsOrEmpty(SkSpan<const SkPoint> pts) {
890
+ if (auto bounds = Bounds(pts)) {
891
+ return bounds.value();
892
+ } else {
893
+ return MakeEmpty();
894
+ }
884
895
  }
885
896
 
886
- /** Sets to bounds of SkPoint array with count entries. Returns false if count is
887
- zero or smaller, or if SkPoint array contains an infinity or NaN; in these cases
888
- sets SkRect to (0, 0, 0, 0).
897
+ /** Sets to bounds of SkPoint array with count entries. If count is zero or smaller,
898
+ or if SkPoint array contains an infinity or NaN, sets to (0, 0, 0, 0).
889
899
 
890
900
  Result is either empty or sorted: fLeft is less than or equal to fRight, and
891
901
  fTop is less than or equal to fBottom.
892
902
 
893
- @param pts SkPoint array
894
- @param count entries in array
895
- @return true if all SkPoint values are finite
896
-
897
- example: https://fiddle.skia.org/c/@Rect_setBoundsCheck
903
+ @param pts SkPoint span
898
904
  */
899
- bool setBoundsCheck(const SkPoint pts[], int count);
900
-
901
- /** Sets to bounds of SkPoint pts array with count entries. If any SkPoint in pts
902
- contains infinity or NaN, all SkRect dimensions are set to NaN.
905
+ void setBounds(SkSpan<const SkPoint> pts) {
906
+ (void)this->setBoundsCheck(pts);
907
+ }
903
908
 
904
- @param pts SkPoint array
905
- @param count entries in array
909
+ /** Sets to bounds of the span of points, and return true (if all point values were finite).
910
+ *
911
+ * If the span is empty, set the rect to empty() and return true.
912
+ * If any point contains an infinity or NaN, set the rect to empty and return false.
913
+ *
914
+ * @param pts SkPoint span
915
+ * example: https://fiddle.skia.org/c/@Rect_setBoundsCheck
916
+ */
917
+ bool setBoundsCheck(SkSpan<const SkPoint> pts);
918
+
919
+ /** Sets to bounds of the span of points.
920
+ *
921
+ * If the span is empty, set the rect to empty().
922
+ * If any point contains an infinity or NaN, set the rect to NaN.
923
+ *
924
+ * @param pts SkPoint span
925
+ * example: https://fiddle.skia.org/c/@Rect_setBoundsNoCheck
926
+ */
927
+ void setBoundsNoCheck(SkSpan<const SkPoint> pts);
906
928
 
907
- example: https://fiddle.skia.org/c/@Rect_setBoundsNoCheck
908
- */
909
- void setBoundsNoCheck(const SkPoint pts[], int count);
929
+ #ifdef SK_SUPPORT_UNSPANNED_APIS
930
+ void setBounds(const SkPoint pts[], int count) {
931
+ this->setBounds({pts, count});
932
+ }
933
+ void setBoundsNoCheck(const SkPoint pts[], int count) {
934
+ this->setBoundsNoCheck({pts, count});
935
+ }
936
+ bool setBoundsCheck(const SkPoint pts[], int count) {
937
+ return this->setBoundsCheck({pts, count});
938
+ }
939
+ #endif
910
940
 
911
941
  /** Sets bounds to the smallest SkRect enclosing SkPoint p0 and p1. The result is
912
942
  sorted and may be empty. Does not check to see if values are finite.
@@ -626,7 +626,7 @@ private:
626
626
  struct RunHead;
627
627
 
628
628
  static RunHead* emptyRunHeadPtr() { return (SkRegion::RunHead*) -1; }
629
- static constexpr RunHead* kRectRunHeadPtr = nullptr;
629
+ static constexpr const RunHead* const kRectRunHeadPtr = nullptr;
630
630
 
631
631
  // allocate space for count runs
632
632
  void allocateRuns(int count);
@@ -25,13 +25,14 @@ class GrBackendSemaphore;
25
25
  class GrBackendTexture;
26
26
  class GrRecordingContext;
27
27
  class GrSurfaceCharacterization;
28
- enum GrSurfaceOrigin : int;
29
28
  class SkBitmap;
30
29
  class SkCanvas;
31
30
  class SkCapabilities;
32
31
  class SkColorSpace;
33
32
  class SkPaint;
33
+ class SkRecorder;
34
34
  class SkSurface;
35
+ enum GrSurfaceOrigin : int;
35
36
  struct SkIRect;
36
37
  struct SkISize;
37
38
 
@@ -226,6 +227,12 @@ public:
226
227
  */
227
228
  skgpu::graphite::Recorder* recorder() const;
228
229
 
230
+ /** Returns the base SkRecorder being used by the SkSurface.
231
+
232
+ @return the recorder; should be non-null for drawable surfaces
233
+ */
234
+ SkRecorder* baseRecorder() const;
235
+
229
236
  enum class BackendHandleAccess {
230
237
  kFlushRead, //!< back-end object is readable
231
238
  kFlushWrite, //!< back-end object is writable
@@ -10,9 +10,12 @@
10
10
 
11
11
  #include "include/core/SkFont.h"
12
12
  #include "include/core/SkFontTypes.h"
13
+ #include "include/core/SkPoint.h"
14
+ #include "include/core/SkRSXform.h"
13
15
  #include "include/core/SkRect.h"
14
16
  #include "include/core/SkRefCnt.h"
15
17
  #include "include/core/SkScalar.h"
18
+ #include "include/core/SkSpan.h"
16
19
  #include "include/core/SkTypes.h"
17
20
  #include "include/private/base/SkDebug.h"
18
21
  #include "include/private/base/SkTemplates.h"
@@ -25,8 +28,6 @@ class SkData;
25
28
  class SkPaint;
26
29
  class SkTypeface;
27
30
  struct SkDeserialProcs;
28
- struct SkPoint;
29
- struct SkRSXform;
30
31
  struct SkSerialProcs;
31
32
 
32
33
  namespace sktext {
@@ -133,8 +134,9 @@ public:
133
134
  @return new textblob or nullptr
134
135
  */
135
136
  static sk_sp<SkTextBlob> MakeFromPosTextH(const void* text, size_t byteLength,
136
- const SkScalar xpos[], SkScalar constY, const SkFont& font,
137
- SkTextEncoding encoding = SkTextEncoding::kUTF8);
137
+ SkSpan<const SkScalar> xpos, SkScalar constY,
138
+ const SkFont& font,
139
+ SkTextEncoding encoding = SkTextEncoding::kUTF8);
138
140
 
139
141
  /** Returns a textblob built from a single run of text with positions.
140
142
  This is equivalent to using SkTextBlobBuilder and calling allocRunPos().
@@ -148,13 +150,33 @@ public:
148
150
  @return new textblob or nullptr
149
151
  */
150
152
  static sk_sp<SkTextBlob> MakeFromPosText(const void* text, size_t byteLength,
151
- const SkPoint pos[], const SkFont& font,
153
+ SkSpan<const SkPoint> pos, const SkFont& font,
152
154
  SkTextEncoding encoding = SkTextEncoding::kUTF8);
153
155
 
154
156
  static sk_sp<SkTextBlob> MakeFromRSXform(const void* text, size_t byteLength,
155
- const SkRSXform xform[], const SkFont& font,
157
+ SkSpan<const SkRSXform> xform, const SkFont& font,
156
158
  SkTextEncoding encoding = SkTextEncoding::kUTF8);
157
159
 
160
+ // Helpers for glyphs
161
+
162
+ static sk_sp<SkTextBlob> MakeFromPosHGlyphs(SkSpan<const SkGlyphID> glyphs,
163
+ SkSpan<const SkScalar> xpos, SkScalar constY,
164
+ const SkFont& font) {
165
+ return MakeFromPosTextH(glyphs.data(), glyphs.size() * sizeof(SkGlyphID), xpos, constY,
166
+ font, SkTextEncoding::kGlyphID);
167
+ }
168
+ static sk_sp<SkTextBlob> MakeFromPosGlyphs(SkSpan<const SkGlyphID> glyphs,
169
+ SkSpan<const SkPoint> pos, const SkFont& font) {
170
+ return MakeFromPosText(glyphs.data(), glyphs.size() * sizeof(SkGlyphID), pos, font,
171
+ SkTextEncoding::kGlyphID);
172
+ }
173
+ static sk_sp<SkTextBlob> MakeFromRSXformGlyphs(SkSpan<const SkGlyphID> glyphs,
174
+ SkSpan<const SkRSXform> xform,
175
+ const SkFont& font) {
176
+ return MakeFromRSXform(glyphs.data(), glyphs.size() * sizeof(SkGlyphID), xform, font,
177
+ SkTextEncoding::kGlyphID);
178
+ }
179
+
158
180
  /** Writes data to allow later reconstruction of SkTextBlob. memory points to storage
159
181
  to receive the encoded data, and memory_size describes the size of storage.
160
182
  Returns bytes used if provided storage is large enough to hold all data;
@@ -240,6 +262,28 @@ public:
240
262
  const RunRecord* fRunRecord;
241
263
  };
242
264
 
265
+ #ifdef SK_SUPPORT_UNSPANNED_APIS
266
+ static sk_sp<SkTextBlob> MakeFromPosTextH(const void* text, size_t byteLength,
267
+ const SkScalar xpos[], SkScalar constY,
268
+ const SkFont& font,
269
+ SkTextEncoding encoding = SkTextEncoding::kUTF8) {
270
+ const size_t worstCaseCount = byteLength;
271
+ return MakeFromPosTextH(text, byteLength, {xpos, worstCaseCount}, constY, font, encoding);
272
+ }
273
+ static sk_sp<SkTextBlob> MakeFromPosText(const void* text, size_t byteLength,
274
+ const SkPoint pos[], const SkFont& font,
275
+ SkTextEncoding encoding = SkTextEncoding::kUTF8) {
276
+ const size_t worstCaseCount = byteLength;
277
+ return MakeFromPosText(text, byteLength, {pos, worstCaseCount}, font, encoding);
278
+ }
279
+ static sk_sp<SkTextBlob> MakeFromRSXform(const void* text, size_t byteLength,
280
+ const SkRSXform xform[], const SkFont& font,
281
+ SkTextEncoding encoding = SkTextEncoding::kUTF8) {
282
+ const size_t worstCaseCount = byteLength;
283
+ return MakeFromRSXform(text, byteLength, {xform, worstCaseCount}, font, encoding);
284
+ }
285
+ #endif
286
+
243
287
  private:
244
288
  friend class SkNVRefCnt<SkTextBlob>;
245
289
 
@@ -104,6 +104,13 @@ public:
104
104
  */
105
105
  virtual void dumpBudgetedState(const char* /*dumpName*/, bool /*isBudgeted*/) {}
106
106
 
107
+ /**
108
+ * Returns true if we should dump sizeless non-texture objects (e.g. Samplers, pipelines, etc).
109
+ * Memoryless textures are always dumped. This call is only used when dumping Graphite memory
110
+ * statistics.
111
+ */
112
+ virtual bool shouldDumpSizelessObjects() const { return false; }
113
+
107
114
  protected:
108
115
  virtual ~SkTraceMemoryDump() = default;
109
116
  SkTraceMemoryDump() = default;
@@ -14,6 +14,7 @@
14
14
  #include "include/core/SkFourByteTag.h"
15
15
  #include "include/core/SkRect.h"
16
16
  #include "include/core/SkRefCnt.h"
17
+ #include "include/core/SkSpan.h"
17
18
  #include "include/core/SkString.h"
18
19
  #include "include/core/SkTypes.h"
19
20
  #include "include/private/SkWeakRefCnt.h"
@@ -68,31 +69,28 @@ public:
68
69
 
69
70
  /** Copy into 'coordinates' (allocated by the caller) the design variation coordinates.
70
71
  *
71
- * @param coordinates the buffer into which to write the design variation coordinates.
72
- * @param coordinateCount the number of entries available through 'coordinates'.
72
+ * @param coordinates the span into which to write the design variation coordinates.
73
73
  *
74
74
  * @return The number of axes, or -1 if there is an error.
75
- * If 'coordinates != nullptr' and 'coordinateCount >= numAxes' then 'coordinates' will be
75
+ * If 'coordinates.size() >= numAxes' then 'coordinates' will be
76
76
  * filled with the variation coordinates describing the position of this typeface in design
77
77
  * variation space. It is possible the number of axes can be retrieved but actual position
78
78
  * cannot.
79
79
  */
80
- int getVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
81
- int coordinateCount) const;
80
+ int getVariationDesignPosition(
81
+ SkSpan<SkFontArguments::VariationPosition::Coordinate> coordinates) const;
82
82
 
83
83
  /** Copy into 'parameters' (allocated by the caller) the design variation parameters.
84
84
  *
85
- * @param parameters the buffer into which to write the design variation parameters.
86
- * @param coordinateCount the number of entries available through 'parameters'.
85
+ * @param parameters the span into which to write the design variation parameters.
87
86
  *
88
87
  * @return The number of axes, or -1 if there is an error.
89
- * If 'parameters != nullptr' and 'parameterCount >= numAxes' then 'parameters' will be
88
+ * If 'parameters.size() >= numAxes' then 'parameters' will be
90
89
  * filled with the variation parameters describing the position of this typeface in design
91
90
  * variation space. It is possible the number of axes can be retrieved but actual parameters
92
91
  * cannot.
93
92
  */
94
- int getVariationDesignParameters(SkFontParameters::Variation::Axis parameters[],
95
- int parameterCount) const;
93
+ int getVariationDesignParameters(SkSpan<SkFontParameters::Variation::Axis> parameters) const;
96
94
 
97
95
  /** Return a 32bit value for this typeface, unique for the underlying font
98
96
  data. Will never return 0.
@@ -149,14 +147,13 @@ public:
149
147
  /**
150
148
  * Given an array of UTF32 character codes, return their corresponding glyph IDs.
151
149
  *
152
- * @param chars pointer to the array of UTF32 chars
153
- * @param number of chars and glyphs
150
+ * @param unis span of UTF32 chars
154
151
  * @param glyphs returns the corresponding glyph IDs for each character.
155
152
  */
156
- void unicharsToGlyphs(const SkUnichar uni[], int count, SkGlyphID glyphs[]) const;
153
+ void unicharsToGlyphs(SkSpan<const SkUnichar> unis, SkSpan<SkGlyphID> glyphs) const;
157
154
 
158
- int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding encoding,
159
- SkGlyphID glyphs[], int maxGlyphCount) const;
155
+ size_t textToGlyphs(const void* text, size_t byteLength, SkTextEncoding encoding,
156
+ SkSpan<SkGlyphID> glyphs) const;
160
157
 
161
158
  /**
162
159
  * Return the glyphID that corresponds to the specified unicode code-point
@@ -179,10 +176,10 @@ public:
179
176
 
180
177
  /** Copy into tags[] (allocated by the caller) the list of table tags in
181
178
  * the font, and return the number. This will be the same as CountTables()
182
- * or 0 if an error occured. If tags == NULL, this only returns the count
179
+ * or 0 if an error occured. If tags is empty, this only returns the count
183
180
  * (the same as calling countTables()).
184
181
  */
185
- int getTableTags(SkFontTableTag tags[]) const;
182
+ int readTableTags(SkSpan<SkFontTableTag> tags) const;
186
183
 
187
184
  /** Given a table tag, return the size of its contents, or 0 if not present
188
185
  */
@@ -232,22 +229,22 @@ public:
232
229
  * typeface's units per em (see getUnitsPerEm).
233
230
  *
234
231
  * Some typefaces are known to never support kerning. Calling this method
235
- * with all zeros (e.g. getKerningPairAdustments(NULL, 0, NULL)) returns
232
+ * with empty spans (e.g. getKerningPairAdustments({}, {})) returns
236
233
  * a boolean indicating if the typeface might support kerning. If it
237
234
  * returns false, then it will always return false (no kerning) for all
238
235
  * possible glyph runs. If it returns true, then it *may* return true for
239
- * somne glyph runs.
236
+ * some glyph runs.
240
237
  *
241
- * If count is non-zero, then the glyphs parameter must point to at least
242
- * [count] valid glyph IDs, and the adjustments parameter must be
243
- * sized to at least [count - 1] entries. If the method returns true, then
244
- * [count-1] entries in the adjustments array will be set. If the method
245
- * returns false, then no kerning should be applied, and the adjustments
238
+ * If the method returns true, and there are 1 or more glyphs in the span, then
239
+ * this will return in adjustments N values,
240
+ * where N = min(glyphs.size() - 1, adjustments.size()).
241
+
242
+ * If the method returns false, then no kerning should be applied, and the adjustments
246
243
  * array will be in an undefined state (possibly some values may have been
247
244
  * written, but none of them should be interpreted as valid values).
248
245
  */
249
- bool getKerningPairAdjustments(const SkGlyphID glyphs[], int count,
250
- int32_t adjustments[]) const;
246
+ bool getKerningPairAdjustments(SkSpan<const SkGlyphID> glyphs,
247
+ SkSpan<int32_t> adjustments) const;
251
248
 
252
249
  struct LocalizedString {
253
250
  SkString fString;
@@ -350,7 +347,37 @@ public:
350
347
  FactoryId id,
351
348
  sk_sp<SkTypeface> (*make)(std::unique_ptr<SkStreamAsset>, const SkFontArguments&));
352
349
 
350
+ #ifdef SK_SUPPORT_UNSPANNED_APIS
351
+ public:
352
+ int getVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[],
353
+ int count) const {
354
+ return this->getVariationDesignPosition({coordinates, count});
355
+ }
356
+ int getVariationDesignParameters(SkFontParameters::Variation::Axis parameters[],
357
+ int count) const {
358
+ return this->getVariationDesignParameters({parameters, count});
359
+ }
360
+ void unicharsToGlyphs(const SkUnichar unis[], int count, SkGlyphID glyphs[]) const {
361
+ this->unicharsToGlyphs({unis, count}, {glyphs, count});
362
+ }
363
+ int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding encoding,
364
+ SkGlyphID glyphs[], int maxGlyphCount) const {
365
+ return (int)this->textToGlyphs(text, byteLength, encoding, {glyphs, maxGlyphCount});
366
+ }
367
+ int getTableTags(SkFontTableTag tags[]) const {
368
+ const size_t count = tags ? MAX_REASONABLE_TABLE_COUNT : 0;
369
+ return this->readTableTags({tags, count});
370
+ }
371
+ bool getKerningPairAdjustments(const SkGlyphID glyphs[], int count,
372
+ int32_t adjustments[]) const {
373
+ return this->getKerningPairAdjustments({glyphs, count}, {adjustments, count});
374
+ }
375
+ #endif
376
+
353
377
  protected:
378
+ // needed until onGetTableTags() is updated to take a span
379
+ enum { MAX_REASONABLE_TABLE_COUNT = (1 << 16) - 1 };
380
+
354
381
  explicit SkTypeface(const SkFontStyle& style, bool isFixedPitch = false);
355
382
  ~SkTypeface() override;
356
383
 
@@ -96,6 +96,7 @@
96
96
  #if defined(SK_HISTOGRAM_ENUMERATION) || \
97
97
  defined(SK_HISTOGRAM_BOOLEAN) || \
98
98
  defined(SK_HISTOGRAM_EXACT_LINEAR) || \
99
+ defined(SK_HISTOGRAM_CUSTOM_EXACT_LINEAR) || \
99
100
  defined(SK_HISTOGRAM_MEMORY_KB) || \
100
101
  defined(SK_HISTOGRAM_CUSTOM_COUNTS)|| \
101
102
  defined(SK_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES)
@@ -116,6 +117,11 @@
116
117
  # define SK_HISTOGRAM_EXACT_LINEAR(name, sample, valueMax)
117
118
  #endif
118
119
 
120
+ #ifndef SK_HISTOGRAM_CUSTOM_EXACT_LINEAR
121
+ # define SK_HISTOGRAM_CUSTOM_EXACT_LINEAR(name, sample, value_min, \
122
+ value_max, bucket_count)
123
+ #endif
124
+
119
125
  #ifndef SK_HISTOGRAM_MEMORY_KB
120
126
  # define SK_HISTOGRAM_MEMORY_KB(name, sample)
121
127
  #endif
@@ -8,12 +8,12 @@
8
8
  #ifndef SkDashPathEffect_DEFINED
9
9
  #define SkDashPathEffect_DEFINED
10
10
 
11
+ #include "include/core/SkPathEffect.h" // IWYU pragma: keep (for unspanned apis)
11
12
  #include "include/core/SkRefCnt.h"
12
13
  #include "include/core/SkScalar.h"
14
+ #include "include/core/SkSpan.h"
13
15
  #include "include/core/SkTypes.h"
14
16
 
15
- class SkPathEffect;
16
-
17
17
  class SK_API SkDashPathEffect {
18
18
  public:
19
19
  /** intervals: array containing an even number of entries (>=2), with
@@ -37,7 +37,13 @@ public:
37
37
 
38
38
  Note: only affects stroked paths.
39
39
  */
40
- static sk_sp<SkPathEffect> Make(const SkScalar intervals[], int count, SkScalar phase);
40
+ static sk_sp<SkPathEffect> Make(SkSpan<const SkScalar> intervals, SkScalar phase);
41
+
42
+ #ifdef SK_SUPPORT_UNSPANNED_APIS
43
+ static sk_sp<SkPathEffect> Make(const SkScalar intervals[], int count, SkScalar phase) {
44
+ return intervals ? Make({intervals, count}, phase) : nullptr;
45
+ }
46
+ #endif
41
47
  };
42
48
 
43
49
  #endif
@@ -139,7 +139,7 @@ public:
139
139
  // When not 0, this field allows Skia to assign a stable key to a known runtime effect
140
140
  uint32_t fStableKey = 0;
141
141
 
142
- // TODO(skia:11209) - Replace this with a promised SkCapabilities?
142
+ // TODO(skbug.com/40042585) - Replace this with a promised SkCapabilities?
143
143
  // This flag lifts the ES2 restrictions on Runtime Effects that are gated by the
144
144
  // `strictES2Mode` check. Be aware that the software renderer and pipeline-stage effect are
145
145
  // still largely ES3-unaware and can still fail or crash if post-ES2 features are used.
@@ -22,7 +22,7 @@ public:
22
22
  * A single frame to be encoded into an animated image.
23
23
  *
24
24
  * If a frame does not fit in the canvas size, this is an error.
25
- * TODO(skia:13705): Add offsets when we have support for an encoder that supports using
25
+ * TODO(skbug.com/40044793): Add offsets when we have support for an encoder that supports using
26
26
  * offsets.
27
27
  */
28
28
  struct SK_API Frame {
@@ -26,7 +26,7 @@ SK_API sk_sp<SkData> SkWriteICCProfile(const skcms_ICCProfile*, const char* desc
26
26
  // Utility function for populating the grid_16 member of skcms_A2B and skcms_B2A
27
27
  // structures. This converts a point in XYZD50 to its representation in grid_16_lab.
28
28
  // It will write 6 bytes. The behavior of this function matches how skcms will decode
29
- // values, but might not match the specification, see https://crbug.com/skia/13807.
29
+ // values, but might not match the specification, see skbug.com/40044907.
30
30
  SK_API void SkICCFloatXYZD50ToGrid16Lab(const float* float_xyz, uint8_t* grid16_lab);
31
31
 
32
32
  // Utility function for popluating the table_16 member of skcms_Curve structure.
@@ -515,7 +515,30 @@ public:
515
515
 
516
516
  bool supportsDistanceFieldText() const;
517
517
 
518
+ /**
519
+ * Returns true if the underlying Vulkan implementation can accurately detect when the data in
520
+ * the pipeline cache changes. Returns false on non-Vulkan implementations.
521
+ *
522
+ * When this is false, the return value of `hasNewVkPipelineCacheData` will occasionally issue a
523
+ * false positive.
524
+ */
525
+ bool canDetectNewVkPipelineCacheData() const;
526
+ /**
527
+ * For Vulkan implementations, returns true if the data in the pipeline cache could have changed
528
+ * since the last call to `storeVkPipelineCacheData`. Always returns true on non-Vulkan
529
+ * implementations.
530
+ *
531
+ * Pipeline cache changes are detected when creating new pipelines, however this will
532
+ * occasionally result in a false positive. When VK_EXT_pipeline_creation_cache_control is
533
+ * enabled, we additionally know when a pipeline creation does not change the cache, thus
534
+ * eliminating false-positives.
535
+ *
536
+ * Check `canDetectNewVkPipelineCacheData` to see whether VK_EXT_pipeline_creation_cache_control
537
+ * is available and enabled.
538
+ */
539
+ bool hasNewVkPipelineCacheData() const;
518
540
  void storeVkPipelineCacheData();
541
+ void storeVkPipelineCacheData(size_t maxSize);
519
542
 
520
543
  /**
521
544
  * Retrieve the default GrBackendFormat for a given SkColorType and renderability.
@@ -33,6 +33,13 @@ class GrThreadSafeCache;
33
33
  class SkArenaAlloc;
34
34
  class SkCapabilities;
35
35
  class SkJSONWriter;
36
+ class SkGaneshRecorder;
37
+ class SkRecorder;
38
+
39
+ namespace skcpu {
40
+ class ContextImpl;
41
+ class Recorder;
42
+ } // namespace skcpu
36
43
 
37
44
  namespace sktext::gpu {
38
45
  class SubRunAllocator;
@@ -99,6 +106,9 @@ public:
99
106
 
100
107
  SK_API sk_sp<const SkCapabilities> skCapabilities() const;
101
108
 
109
+ SK_API SkRecorder* asRecorder();
110
+ SK_API std::unique_ptr<skcpu::Recorder> makeCPURecorder();
111
+
102
112
  // Provides access to functions that aren't part of the public API.
103
113
  GrRecordingContextPriv priv();
104
114
  const GrRecordingContextPriv priv() const; // NOLINT(readability-const-return-type)
@@ -269,6 +279,8 @@ private:
269
279
 
270
280
  std::unique_ptr<GrDrawingManager> fDrawingManager;
271
281
  std::unique_ptr<GrProxyProvider> fProxyProvider;
282
+ std::unique_ptr<const skcpu::ContextImpl> fCPUContext;
283
+ std::unique_ptr<SkGaneshRecorder> fRecorder;
272
284
 
273
285
  #if defined(GPU_TEST_UTILS)
274
286
  int fSuppressWarningMessages = 0;