@shopify/react-native-skia 2.12.0-next.1 → 2.12.0
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.
- package/Package.swift +117 -0
- package/android/CMakeLists.txt +1 -2
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +0 -10
- package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +9 -12
- package/apple/RNSkApplePlatformContext.h +0 -3
- package/apple/RNSkApplePlatformContext.mm +0 -11
- package/cpp/api/JsiSkApi.h +0 -6
- package/cpp/api/JsiSkFont.h +5 -10
- package/cpp/api/JsiSkMatrix.h +4 -2
- package/cpp/api/JsiSkSVGFactory.h +4 -0
- package/cpp/api/recorder/Convertor.h +5 -2
- package/cpp/api/recorder/Drawings.h +13 -3
- package/cpp/api/recorder/ImageFilters.h +15 -1
- package/cpp/api/recorder/Paint.h +8 -1
- package/cpp/jsi/JSICache.cpp +99 -0
- package/cpp/jsi/JSICache.h +90 -0
- package/cpp/jsi/NativeObject.h +38 -87
- package/cpp/jsi/ViewProperty.h +0 -24
- package/cpp/rnskia/RNDawnContext.h +2 -1
- package/cpp/rnskia/RNDawnWindowContext.h +22 -0
- package/cpp/rnskia/RNSkManager.cpp +0 -6
- package/cpp/rnskia/RNSkPlatformContext.h +0 -3
- package/cpp/skia/include/core/RasterContext.h +25 -0
- package/cpp/skia/include/core/SkCanvas.h +0 -1
- package/cpp/skia/include/core/SkContext.h +62 -0
- package/cpp/skia/include/core/SkContextOptions.h +15 -0
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPicture.h +36 -18
- package/cpp/skia/include/core/SkRecorder.h +8 -0
- package/cpp/skia/include/core/SkSerialProcs.h +2 -6
- package/cpp/skia/include/effects/SkImageFilters.h +15 -2
- package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +73 -47
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +7 -4
- package/cpp/skia/include/gpu/ganesh/d3d/GrD3DDirectContext.h +12 -0
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +11 -0
- package/cpp/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h +11 -0
- package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +13 -0
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +6 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +5 -4
- package/cpp/skia/include/gpu/graphite/PrecompileContext.h +9 -1
- package/cpp/skia/include/gpu/graphite/Recorder.h +0 -2
- package/cpp/skia/include/gpu/graphite/Recording.h +3 -0
- package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +8 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +11 -0
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteContext.h +11 -0
- package/cpp/skia/include/private/SkLog.h +1 -19
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +2 -1
- package/cpp/skia/include/utils/SkLogHandler.h +53 -0
- package/cpp/skia/include/utils/SkNWayCanvas.h +1 -0
- package/cpp/skia/modules/skcms/src/Transform_inl.h +9 -10
- package/cpp/skia/modules/skcms/src/skcms_internals.h +8 -3
- package/cpp/skia/modules/skottie/include/SkottieProperty.h +2 -0
- package/cpp/skia/modules/skottie/include/TextShaper.h +1 -0
- package/cpp/skia/modules/skshaper/include/SkShaper.h +23 -1
- package/include/ReactNativeSkia.h +6 -0
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +5 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/external/reanimated/useVideo.js +8 -2
- package/lib/commonjs/external/reanimated/useVideo.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +3 -9
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +1 -0
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.js +7 -2
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +1 -6
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +4 -4
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -3
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js +2 -2
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextStyle.js +5 -5
- package/lib/commonjs/skia/web/JsiSkTextStyle.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +0 -3
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkottieAnimation.js +8 -8
- package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +1 -0
- package/lib/commonjs/sksg/Recorder/DrawingContext.js +15 -0
- package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Visitor.js +6 -1
- package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +12 -9
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +15 -1
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Shaders.js +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.web.js +247 -57
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +5 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/external/reanimated/useVideo.js +8 -2
- package/lib/module/external/reanimated/useVideo.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +3 -9
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +1 -0
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/Matrix4.js +7 -2
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +1 -6
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +4 -4
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -3
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathBuilder.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPathBuilder.js +2 -2
- package/lib/module/skia/web/JsiSkPathBuilder.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextStyle.js +5 -5
- package/lib/module/skia/web/JsiSkTextStyle.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +0 -3
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/JsiSkottieAnimation.js +8 -8
- package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -1
- package/lib/module/sksg/Recorder/DrawingContext.d.ts +1 -0
- package/lib/module/sksg/Recorder/DrawingContext.js +15 -0
- package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.js +1 -1
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/Visitor.js +6 -1
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.js +12 -9
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/ImageFilters.js +15 -1
- package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Shaders.js +1 -1
- package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.js +247 -57
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +0 -1
- package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +1 -0
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPathBuilder.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +1 -0
- package/lib/typescript/react-native.config.d.ts +3 -0
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +1 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +1 -6
- package/lib/typescript/src/skia/web/JsiSkPathBuilder.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +1 -0
- package/package.json +13 -10
- package/react-native.config.js +5 -0
- package/src/dom/nodes/datatypes/Rect.ts +6 -1
- package/src/external/reanimated/useVideo.ts +7 -2
- package/src/renderer/components/Mask.tsx +10 -3
- package/src/skia/types/JsiInstance.ts +2 -0
- package/src/skia/types/Matrix4.ts +6 -2
- package/src/skia/types/Skia.ts +1 -7
- package/src/skia/web/JsiSkCanvas.ts +11 -6
- package/src/skia/web/JsiSkImage.ts +6 -3
- package/src/skia/web/JsiSkPathBuilder.ts +2 -2
- package/src/skia/web/JsiSkTextStyle.ts +20 -15
- package/src/skia/web/JsiSkia.ts +0 -4
- package/src/skia/web/JsiSkottieAnimation.ts +8 -8
- package/src/sksg/Recorder/DrawingContext.ts +15 -0
- package/src/sksg/Recorder/Player.ts +1 -1
- package/src/sksg/Recorder/Visitor.ts +9 -6
- package/src/sksg/Recorder/commands/Drawing.ts +12 -9
- package/src/sksg/Recorder/commands/ImageFilters.ts +20 -1
- package/src/sksg/Recorder/commands/Shaders.ts +1 -1
- package/src/views/SkiaPictureView.web.tsx +245 -57
- package/cpp/api/JsiSkiaContext.h +0 -94
- package/cpp/dawn/include/dawn/dawn_proc.h +0 -53
- package/cpp/dawn/include/dawn/dawn_proc_table.h +0 -330
- package/cpp/dawn/include/dawn/dawn_thread_dispatch_proc.h +0 -47
- package/cpp/dawn/include/dawn/dawn_version.h +0 -41
- package/cpp/dawn/include/dawn/native/D3D11Backend.h +0 -65
- package/cpp/dawn/include/dawn/native/D3D12Backend.h +0 -103
- package/cpp/dawn/include/dawn/native/D3DBackend.h +0 -56
- package/cpp/dawn/include/dawn/native/DawnNative.h +0 -368
- package/cpp/dawn/include/dawn/native/MetalBackend.h +0 -56
- package/cpp/dawn/include/dawn/native/NullBackend.h +0 -39
- package/cpp/dawn/include/dawn/native/OpenGLBackend.h +0 -89
- package/cpp/dawn/include/dawn/native/VulkanBackend.h +0 -183
- package/cpp/dawn/include/dawn/native/WebGPUBackend.h +0 -49
- package/cpp/dawn/include/dawn/native/dawn_native_export.h +0 -49
- package/cpp/dawn/include/dawn/platform/DawnPlatform.h +0 -207
- package/cpp/dawn/include/dawn/platform/dawn_platform_export.h +0 -49
- package/cpp/dawn/include/dawn/replay/Replay.h +0 -99
- package/cpp/dawn/include/dawn/replay/dawn_replay_export.h +0 -49
- package/cpp/dawn/include/dawn/webgpu_cpp_print.h +0 -2856
- package/cpp/dawn/include/tint/tint.h +0 -91
- package/cpp/dawn/include/webgpu/webgpu.h +0 -5029
- package/cpp/dawn/include/webgpu/webgpu_cpp.h +0 -10353
- package/cpp/dawn/include/webgpu/webgpu_cpp_chained_struct.h +0 -57
- package/cpp/dawn/include/webgpu/webgpu_enum_class_bitmasks.h +0 -162
- package/cpp/dawn/include/webgpu/webgpu_glfw.h +0 -88
- package/cpp/jsi/RuntimeAwareCache.cpp +0 -7
- package/cpp/jsi/RuntimeAwareCache.h +0 -117
- package/cpp/jsi/RuntimeLifecycleMonitor.cpp +0 -72
- package/cpp/jsi/RuntimeLifecycleMonitor.h +0 -32
- package/cpp/skia/src/gpu/graphite/ContextOptionsPriv.h +0 -45
- package/cpp/skia/src/gpu/graphite/ResourceTypes.h +0 -360
- package/cpp/skia/src/gpu/graphite/TextureProxyView.h +0 -105
- package/libs/.graphite +0 -1
|
@@ -320,14 +320,34 @@ public:
|
|
|
320
320
|
bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores,
|
|
321
321
|
bool deleteSemaphoresAfterWait = true);
|
|
322
322
|
|
|
323
|
+
/*
|
|
324
|
+
* Result of a flush call. A flush can be successful w/ or w/o any semaphores being flushed.
|
|
325
|
+
* In some circumstances an unsuccessful flush can still have flushed the semaphores but
|
|
326
|
+
* the rendering results should be discarded.
|
|
327
|
+
*/
|
|
328
|
+
struct FlushResult {
|
|
329
|
+
// This implicit cast is temporary and recreates the success/semaphore-submission
|
|
330
|
+
// conflation of the old API. This can be removed when all clients have been
|
|
331
|
+
// updated to the new return value.
|
|
332
|
+
operator GrSemaphoresSubmitted() const {
|
|
333
|
+
return fSuccess ? GrSemaphoresSubmitted::kYes : GrSemaphoresSubmitted::kNo;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
bool fSuccess = false; // Did the flush succeed
|
|
337
|
+
// Were any semaphores submitted during the flush process. Will be kNo if no
|
|
338
|
+
// semaphores were specified.
|
|
339
|
+
GrSemaphoresSubmitted fSubmitted = GrSemaphoresSubmitted::kNo;
|
|
340
|
+
};
|
|
341
|
+
|
|
323
342
|
/**
|
|
324
343
|
* Call to ensure all drawing to the context has been flushed and submitted to the underlying 3D
|
|
325
344
|
* API. This is equivalent to calling GrContext::flush with a default GrFlushInfo followed by
|
|
326
345
|
* GrContext::submit(sync).
|
|
327
346
|
*/
|
|
328
|
-
|
|
329
|
-
this->flush(GrFlushInfo());
|
|
330
|
-
this->submit(sync);
|
|
347
|
+
FlushResult flushAndSubmit(GrSyncCpu sync = GrSyncCpu::kNo) {
|
|
348
|
+
FlushResult result = this->flush(GrFlushInfo());
|
|
349
|
+
result.fSuccess &= this->submit(sync);
|
|
350
|
+
return result;
|
|
331
351
|
}
|
|
332
352
|
|
|
333
353
|
/**
|
|
@@ -341,22 +361,22 @@ public:
|
|
|
341
361
|
* buffer or encoder objects. However, these objects are not sent to the gpu until a
|
|
342
362
|
* submission occurs.
|
|
343
363
|
*
|
|
344
|
-
* If
|
|
345
|
-
* submitted to the gpu during the next submit call (it is possible
|
|
346
|
-
* subset of the semaphores). The client should not wait on these
|
|
347
|
-
* has been called, and must keep them alive until then. If
|
|
348
|
-
* GrSemaphoresSubmitted::kNo, the GPU backend will not submit any semaphores
|
|
349
|
-
* the GPU. Thus the client should not have the GPU wait on any of the
|
|
350
|
-
* the GrFlushInfo. Regardless of whether semaphores were submitted
|
|
351
|
-
* client is still responsible for deleting any initialized semaphores.
|
|
364
|
+
* If FlushResult.fSubmitted is GrSemaphoresSubmitted::kYes, only initialized
|
|
365
|
+
* GrBackendSemaphores will be submitted to the gpu during the next submit call (it is possible
|
|
366
|
+
* Skia failed to create a subset of the semaphores). The client should not wait on these
|
|
367
|
+
* semaphores until after submit has been called, and must keep them alive until then. If
|
|
368
|
+
* fSubmitted is GrSemaphoresSubmitted::kNo, the GPU backend will not submit any semaphores
|
|
369
|
+
* to be signaled on the GPU. Thus the client should not have the GPU wait on any of the
|
|
370
|
+
* semaphores passed in with the GrFlushInfo. Regardless of whether semaphores were submitted
|
|
371
|
+
* to the GPU or not, the client is still responsible for deleting any initialized semaphores.
|
|
352
372
|
* Regardless of semaphore submission the context will still be flushed. It should be
|
|
353
|
-
* emphasized that a
|
|
354
|
-
* happen. It simply means there were no semaphores submitted to the GPU. A caller
|
|
355
|
-
* take this as a failure if they passed in semaphores to be submitted.
|
|
373
|
+
* emphasized that a fSubmitted value of GrSemaphoresSubmitted::kNo does not mean the flush
|
|
374
|
+
* did not happen. It simply means there were no semaphores submitted to the GPU. A caller
|
|
375
|
+
* should only take this as a failure if they passed in semaphores to be submitted.
|
|
356
376
|
*/
|
|
357
|
-
|
|
377
|
+
FlushResult flush(const GrFlushInfo& info);
|
|
358
378
|
|
|
359
|
-
void flush() { this->flush(GrFlushInfo()); }
|
|
379
|
+
void flush() { (void) this->flush(GrFlushInfo()); }
|
|
360
380
|
|
|
361
381
|
/** Flushes any pending uses of texture-backed images in the GPU backend. If the image is not
|
|
362
382
|
* texture-backed (including promise texture images) or if the GrDirectContext does not
|
|
@@ -367,13 +387,18 @@ public:
|
|
|
367
387
|
* @param image the non-null image to flush.
|
|
368
388
|
* @param info flush options
|
|
369
389
|
*/
|
|
370
|
-
|
|
371
|
-
|
|
390
|
+
FlushResult flush(const sk_sp<const SkImage>& image, const GrFlushInfo& info);
|
|
391
|
+
|
|
392
|
+
void flush(const sk_sp<const SkImage>& image) { (void) this->flush(image, {}); }
|
|
372
393
|
|
|
373
394
|
/** Version of flush() that uses a default GrFlushInfo. Also submits the flushed work to the
|
|
374
|
-
*
|
|
395
|
+
* GPU.
|
|
375
396
|
*/
|
|
376
|
-
|
|
397
|
+
FlushResult flushAndSubmit(const sk_sp<const SkImage>& image) {
|
|
398
|
+
FlushResult result = this->flush(image, {});
|
|
399
|
+
result.fSuccess &= this->submit();
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
377
402
|
|
|
378
403
|
/** Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface
|
|
379
404
|
* MSAA. A call to GrDirectContext::submit is always required to ensure work is actually sent
|
|
@@ -400,19 +425,20 @@ public:
|
|
|
400
425
|
* The GrFlushInfo describes additional options to flush. Please see documentation at
|
|
401
426
|
* GrFlushInfo for more info.
|
|
402
427
|
*
|
|
403
|
-
* If
|
|
404
|
-
* submitted to the gpu during the next submit call (it is
|
|
405
|
-
* subset of the semaphores). The client should not wait on
|
|
406
|
-
* has been called, but must keep them alive until then.
|
|
407
|
-
* the flush these valid semaphores can we waited on
|
|
408
|
-
* GrSemaphoresSubmitted::kNo, the GPU backend will not
|
|
409
|
-
* the GPU. Thus the client should not have the GPU
|
|
410
|
-
*
|
|
411
|
-
* client is still responsible for deleting
|
|
412
|
-
* Regardless of semaphore submission the context will still be
|
|
413
|
-
* emphasized that a
|
|
414
|
-
* happen. It simply means there were no semaphores submitted
|
|
415
|
-
* take this as a failure if they passed in semaphores to
|
|
428
|
+
* If FlushResult.fSubmitted is GrSemaphoresSubmitted::kYes, only initialized
|
|
429
|
+
* GrBackendSemaphores will be submitted to the gpu during the next submit call (it is
|
|
430
|
+
* possible Skia failed to create a subset of the semaphores). The client should not wait on
|
|
431
|
+
* these semaphores until after submit has been called, but must keep them alive until then.
|
|
432
|
+
* If a submit flag was passed in with the flush these valid semaphores can we waited on
|
|
433
|
+
* immediately. If this fSubmitted is GrSemaphoresSubmitted::kNo, the GPU backend will not
|
|
434
|
+
* submit any semaphores to be signaled on the GPU. Thus the client should not have the GPU
|
|
435
|
+
* wait on any of the semaphores passed in with the GrFlushInfo. Regardless of whether
|
|
436
|
+
* semaphores were submitted to the GPU or not, the client is still responsible for deleting
|
|
437
|
+
* any initialized semaphores. Regardless of semaphore submission the context will still be
|
|
438
|
+
* flushed. It should be emphasized that a fSubmitted value of GrSemaphoresSubmitted::kNo
|
|
439
|
+
* does not mean the flush did not happen. It simply means there were no semaphores submitted
|
|
440
|
+
* to the GPU. A caller should only take this as a failure if they passed in semaphores to
|
|
441
|
+
* be submitted.
|
|
416
442
|
*
|
|
417
443
|
* Pending surface commands are flushed regardless of the return result.
|
|
418
444
|
*
|
|
@@ -420,9 +446,9 @@ public:
|
|
|
420
446
|
* @param access type of access the call will do on the backend object after flush
|
|
421
447
|
* @param info flush options
|
|
422
448
|
*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
449
|
+
FlushResult flush(SkSurface* surface,
|
|
450
|
+
SkSurfaces::BackendSurfaceAccess access,
|
|
451
|
+
const GrFlushInfo& info);
|
|
426
452
|
|
|
427
453
|
/**
|
|
428
454
|
* Same as above except:
|
|
@@ -443,9 +469,16 @@ public:
|
|
|
443
469
|
* @param info flush options
|
|
444
470
|
* @param newState optional state change request after flush
|
|
445
471
|
*/
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
472
|
+
FlushResult flush(SkSurface* surface,
|
|
473
|
+
const GrFlushInfo& info,
|
|
474
|
+
const skgpu::MutableTextureState* newState = nullptr);
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Flushes the given surface with the default GrFlushInfo.
|
|
478
|
+
*
|
|
479
|
+
* Has no effect on a CPU-backed surface.
|
|
480
|
+
*/
|
|
481
|
+
void flush(SkSurface* surface) { (void) this->flush(surface, GrFlushInfo(), nullptr); }
|
|
449
482
|
|
|
450
483
|
/** Call to ensure all reads/writes of the surface have been issued to the underlying 3D API.
|
|
451
484
|
* Skia will correctly order its own draws and pixel operations. This must to be used to ensure
|
|
@@ -455,14 +488,7 @@ public:
|
|
|
455
488
|
*
|
|
456
489
|
* Has no effect on a CPU-backed surface.
|
|
457
490
|
*/
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Flushes the given surface with the default GrFlushInfo.
|
|
462
|
-
*
|
|
463
|
-
* Has no effect on a CPU-backed surface.
|
|
464
|
-
*/
|
|
465
|
-
void flush(SkSurface* surface);
|
|
491
|
+
FlushResult flushAndSubmit(SkSurface* surface, GrSyncCpu sync = GrSyncCpu::kNo);
|
|
466
492
|
|
|
467
493
|
/**
|
|
468
494
|
* Submit outstanding work to the gpu from all previously un-submitted flushes. The return
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include "include/core/SkImageInfo.h"
|
|
12
12
|
#include "include/core/SkRefCnt.h"
|
|
13
13
|
#include "include/core/SkSurface.h"
|
|
14
|
+
#include "include/gpu/ganesh/GrDirectContext.h"
|
|
14
15
|
#include "include/gpu/ganesh/GrTypes.h"
|
|
15
16
|
#include "include/private/SkAPI.h"
|
|
16
17
|
|
|
@@ -209,10 +210,12 @@ namespace skgpu::ganesh {
|
|
|
209
210
|
// Clients should strive to call GrDirectContext::flush directly. However, there exist some
|
|
210
211
|
// places where the GrDirectContext is hard to find, these helpers allow for the flushing of the
|
|
211
212
|
// provided surface. This is a no-op if the surface is nullptr or not GPU backed.
|
|
212
|
-
SK_API
|
|
213
|
-
SK_API
|
|
214
|
-
|
|
215
|
-
SK_API
|
|
213
|
+
SK_API GrDirectContext::FlushResult Flush(sk_sp<SkSurface>);
|
|
214
|
+
SK_API GrDirectContext::FlushResult Flush(SkSurface*);
|
|
215
|
+
|
|
216
|
+
SK_API GrDirectContext::FlushResult FlushAndSubmit(sk_sp<SkSurface>);
|
|
217
|
+
SK_API GrDirectContext::FlushResult FlushAndSubmit(SkSurface*);
|
|
218
|
+
|
|
216
219
|
} // namespace skgpu::ganesh
|
|
217
220
|
|
|
218
221
|
#endif
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
12
|
#include "include/private/SkAPI.h"
|
|
13
13
|
|
|
14
|
+
#include <memory>
|
|
15
|
+
|
|
14
16
|
class GrDirectContext;
|
|
17
|
+
class SkContext;
|
|
15
18
|
struct GrContextOptions;
|
|
16
19
|
struct GrD3DBackendContext;
|
|
20
|
+
struct SkContextOptions;
|
|
17
21
|
|
|
18
22
|
namespace GrDirectContexts {
|
|
19
23
|
/**
|
|
@@ -25,4 +29,12 @@ SK_API sk_sp<GrDirectContext> MakeD3D(const GrD3DBackendContext& backendContext,
|
|
|
25
29
|
SK_API sk_sp<GrDirectContext> MakeD3D(const GrD3DBackendContext& backendContext);
|
|
26
30
|
} // namespace GrDirectContexts
|
|
27
31
|
|
|
32
|
+
namespace SkContexts {
|
|
33
|
+
|
|
34
|
+
// Creates a context wrapping a Ganesh GPU backend with D3D
|
|
35
|
+
std::unique_ptr<SkContext> MakeGanesh(const GrD3DBackendContext& backendContext,
|
|
36
|
+
const SkContextOptions& options);
|
|
37
|
+
|
|
38
|
+
} // namespace SkContexts
|
|
39
|
+
|
|
28
40
|
#endif
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
12
|
#include "include/private/SkAPI.h"
|
|
13
13
|
|
|
14
|
+
#include <memory>
|
|
15
|
+
|
|
14
16
|
class GrDirectContext;
|
|
17
|
+
class SkContext;
|
|
15
18
|
struct GrContextOptions;
|
|
16
19
|
struct GrGLInterface;
|
|
20
|
+
struct SkContextOptions;
|
|
17
21
|
|
|
18
22
|
namespace GrDirectContexts {
|
|
19
23
|
/**
|
|
@@ -27,4 +31,11 @@ SK_API sk_sp<GrDirectContext> MakeGL();
|
|
|
27
31
|
#endif
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
namespace SkContexts {
|
|
35
|
+
|
|
36
|
+
// Creates a context wrapping a Ganesh GPU backend with OpenGL
|
|
37
|
+
std::unique_ptr<SkContext> MakeGanesh(sk_sp<const GrGLInterface>, const SkContextOptions& options);
|
|
38
|
+
|
|
39
|
+
} // namespace SkContexts
|
|
40
|
+
|
|
30
41
|
#endif
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
12
|
#include "include/private/SkAPI.h"
|
|
13
13
|
|
|
14
|
+
#include <memory>
|
|
15
|
+
|
|
14
16
|
class GrDirectContext;
|
|
17
|
+
class SkContext;
|
|
15
18
|
struct GrContextOptions;
|
|
16
19
|
struct GrMtlBackendContext;
|
|
20
|
+
struct SkContextOptions;
|
|
17
21
|
|
|
18
22
|
namespace GrDirectContexts {
|
|
19
23
|
/**
|
|
@@ -27,4 +31,11 @@ SK_API sk_sp<GrDirectContext> MakeMetal(const GrMtlBackendContext&, const GrCont
|
|
|
27
31
|
SK_API sk_sp<GrDirectContext> MakeMetal(const GrMtlBackendContext&);
|
|
28
32
|
} // namespace GrDirectContexts
|
|
29
33
|
|
|
34
|
+
namespace SkContexts {
|
|
35
|
+
|
|
36
|
+
// Creates a context wrapping a Ganesh GPU backend with Metal
|
|
37
|
+
std::unique_ptr<SkContext> MakeGanesh(const GrMtlBackendContext& mtlContext, const SkContextOptions& options);
|
|
38
|
+
|
|
39
|
+
} // namespace SkContexts
|
|
40
|
+
|
|
30
41
|
#endif
|
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
12
|
#include "include/private/SkAPI.h"
|
|
13
13
|
|
|
14
|
+
#include <memory>
|
|
15
|
+
|
|
14
16
|
class GrDirectContext;
|
|
17
|
+
class SkContext;
|
|
15
18
|
struct GrContextOptions;
|
|
19
|
+
struct SkContextOptions;
|
|
16
20
|
namespace skgpu {
|
|
17
21
|
struct VulkanBackendContext;
|
|
18
22
|
}
|
|
@@ -30,4 +34,13 @@ SK_API sk_sp<GrDirectContext> MakeVulkan(const skgpu::VulkanBackendContext&,
|
|
|
30
34
|
SK_API sk_sp<GrDirectContext> MakeVulkan(const skgpu::VulkanBackendContext&);
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
namespace SkContexts {
|
|
38
|
+
|
|
39
|
+
// Creates a context wrapping a Ganesh GPU backend with Vulkan
|
|
40
|
+
std::unique_ptr<SkContext> MakeGanesh(const skgpu::VulkanBackendContext& vkContext,
|
|
41
|
+
const SkContextOptions& options);
|
|
42
|
+
|
|
43
|
+
} // namespace SkContexts
|
|
44
|
+
|
|
45
|
+
|
|
33
46
|
#endif
|
|
@@ -135,6 +135,12 @@ struct SK_API ContextOptions {
|
|
|
135
135
|
bool fSetBackendLabels = false;
|
|
136
136
|
#endif
|
|
137
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Enabling switches Graphite from the existing sort-based draw ordering to the new layer-based
|
|
140
|
+
* system.
|
|
141
|
+
*/
|
|
142
|
+
bool fUseDrawListLayer = false;
|
|
143
|
+
|
|
138
144
|
/**
|
|
139
145
|
* Client-provided context that is passed to the client-provided PipelineCachingCallback
|
|
140
146
|
* and the (deprecated) PipelineCallback.
|
|
@@ -266,8 +266,7 @@ enum DrawTypeFlags : uint16_t {
|
|
|
266
266
|
|
|
267
267
|
// kDrawVertices should be used to generate Pipelines that use the following RenderSteps:
|
|
268
268
|
// VerticesRenderStep[*] for:
|
|
269
|
-
// [
|
|
270
|
-
// [Tristrips], [TristripsTexCoords], [TristripsColor], [TristripsColorTexCoords]
|
|
269
|
+
// [Pos], [PosTexCoords], [PosColor], [PosColorTexCoords],
|
|
271
270
|
kDrawVertices = 1 << 5,
|
|
272
271
|
|
|
273
272
|
// kCircularArc renders filled circular arcs, with or without the center included, and
|
|
@@ -297,7 +296,7 @@ enum DrawTypeFlags : uint16_t {
|
|
|
297
296
|
// This draw type covers all the methods Skia uses to draw drop shadows. It can be used to
|
|
298
297
|
// generate Pipelines which, as part of their labels, have:
|
|
299
298
|
// the AnalyticBlurRenderStep
|
|
300
|
-
// VerticesRenderStep[
|
|
299
|
+
// VerticesRenderStep[PosColor] with a GaussianColorFilter
|
|
301
300
|
// For this draw type the PaintOptions parameter to Precompile() will be ignored.
|
|
302
301
|
kDropShadows = 1 << 11,
|
|
303
302
|
|
|
@@ -307,7 +306,9 @@ enum DrawTypeFlags : uint16_t {
|
|
|
307
306
|
// AnalyticAndAtlasClip
|
|
308
307
|
kAnalyticClip = 1 << 12,
|
|
309
308
|
|
|
310
|
-
|
|
309
|
+
kDrawMesh = 1 << 13,
|
|
310
|
+
|
|
311
|
+
kLast = kDrawMesh,
|
|
311
312
|
};
|
|
312
313
|
|
|
313
314
|
} // namespace skgpu::graphite
|
|
@@ -24,6 +24,14 @@ class SharedContext;
|
|
|
24
24
|
class PrecompileContextPriv;
|
|
25
25
|
class ResourceProvider;
|
|
26
26
|
|
|
27
|
+
// The PrecompileContext is spawned from a generating Context via Context::makePrecompileContext.
|
|
28
|
+
// It should only be used on a single thread but that can be different from the main thread (i.e.,
|
|
29
|
+
// the one the Context is operating on). Many PrecompileContext's can be operating in parallel
|
|
30
|
+
// but the majority of the benefit will be from the threaded compilation within the
|
|
31
|
+
// PrecompileContext. As for that, the PipelineContext(s) borrow(s) the Executor from the
|
|
32
|
+
// generating Context. To make lifetime management of the Executor reasonable, if the
|
|
33
|
+
// Context is deleted before its PrecompileContexts, the PrecompileContexts will lose access
|
|
34
|
+
// to the Executor and revert to single threaded compilation.
|
|
27
35
|
class SK_API PrecompileContext {
|
|
28
36
|
public:
|
|
29
37
|
~PrecompileContext();
|
|
@@ -99,9 +107,9 @@ private:
|
|
|
99
107
|
|
|
100
108
|
explicit PrecompileContext(sk_sp<SharedContext>);
|
|
101
109
|
|
|
110
|
+
// The PrecompileContext should not be used on multiple threads
|
|
102
111
|
mutable SingleOwner fSingleOwner;
|
|
103
112
|
sk_sp<SharedContext> fSharedContext;
|
|
104
|
-
std::unique_ptr<ResourceProvider> fResourceProvider;
|
|
105
113
|
};
|
|
106
114
|
|
|
107
115
|
} // namespace skgpu::graphite
|
|
@@ -52,7 +52,6 @@ class BackendTexture;
|
|
|
52
52
|
class Context;
|
|
53
53
|
class Device;
|
|
54
54
|
class DrawBufferManager;
|
|
55
|
-
class StorageBufferManager;
|
|
56
55
|
class ImageProvider;
|
|
57
56
|
class PaintParamsKeyBuilder;
|
|
58
57
|
class PipelineDataGatherer;
|
|
@@ -299,7 +298,6 @@ private:
|
|
|
299
298
|
std::unique_ptr<UploadBufferManager> fUploadBufferManager;
|
|
300
299
|
// Depends on fUploadBufferManager (holds a pointer to it). Must be destroyed first.
|
|
301
300
|
std::unique_ptr<DrawBufferManager> fDrawBufferManager;
|
|
302
|
-
sk_sp<StorageBufferManager> fStorageBufferManager;
|
|
303
301
|
std::unique_ptr<ProxyReadCountMap> fProxyReadCounts;
|
|
304
302
|
|
|
305
303
|
skia_private::STArray<kMaxKeyAndDataBuilders, std::unique_ptr<KeyAndDataBuilder>>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#include <vector>
|
|
19
19
|
|
|
20
20
|
struct SkISize;
|
|
21
|
+
class SkPicture;
|
|
21
22
|
|
|
22
23
|
namespace skgpu {
|
|
23
24
|
class RefCntedCallback;
|
|
@@ -93,6 +94,8 @@ private:
|
|
|
93
94
|
std::unique_ptr<LazyProxyData> fTargetProxyData;
|
|
94
95
|
|
|
95
96
|
skia_private::TArray<sk_sp<RefCntedCallback>> fFinishedProcs;
|
|
97
|
+
|
|
98
|
+
skia_private::TArray<sk_sp<SkPicture>> fCapturedPictures;
|
|
96
99
|
};
|
|
97
100
|
|
|
98
101
|
} // namespace skgpu::graphite
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
#include <memory>
|
|
15
15
|
|
|
16
|
+
class SkContext;
|
|
17
|
+
struct SkContextOptions;
|
|
18
|
+
|
|
16
19
|
namespace skgpu::graphite {
|
|
17
20
|
|
|
18
21
|
class Context;
|
|
@@ -74,4 +77,9 @@ SK_API std::unique_ptr<Context> MakeDawn(const DawnBackendContext&, const Contex
|
|
|
74
77
|
|
|
75
78
|
} // namespace skgpu::graphite
|
|
76
79
|
|
|
80
|
+
namespace SkContexts {
|
|
81
|
+
std::unique_ptr<SkContext> MakeGraphite(const skgpu::graphite::DawnBackendContext& dawnContext,
|
|
82
|
+
const SkContextOptions& options);
|
|
83
|
+
} // namespace SkContexts
|
|
84
|
+
|
|
77
85
|
#endif // skgpu_graphite_DawnBackendContext_DEFINED
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
#import <CoreFoundation/CoreFoundation.h>
|
|
16
16
|
#include <memory>
|
|
17
17
|
|
|
18
|
+
class SkContext;
|
|
19
|
+
struct SkContextOptions;
|
|
20
|
+
|
|
18
21
|
namespace skgpu::graphite {
|
|
19
22
|
|
|
20
23
|
// The MtlBackendContext contains all of the base Metal objects needed by the graphite Metal
|
|
@@ -31,4 +34,12 @@ SK_API std::unique_ptr<Context> MakeMetal(const MtlBackendContext&, const Contex
|
|
|
31
34
|
|
|
32
35
|
} // namespace skgpu::graphite
|
|
33
36
|
|
|
37
|
+
namespace SkContexts {
|
|
38
|
+
|
|
39
|
+
// Creates a context wrapping a Graphite GPU backend using Metal
|
|
40
|
+
std::unique_ptr<SkContext> MakeGraphite(const skgpu::graphite::MtlBackendContext& mtlContext,
|
|
41
|
+
const SkContextOptions& options);
|
|
42
|
+
|
|
43
|
+
} // namespace SkContexts
|
|
44
|
+
|
|
34
45
|
#endif // skgpu_graphite_MtlBackendContext_DEFINED
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
#include "include/private/SkAPI.h"
|
|
14
14
|
|
|
15
|
+
struct SkContextOptions;
|
|
16
|
+
class SkContext;
|
|
17
|
+
|
|
15
18
|
// NOTE: Because there is already a VulkanBackendContext header shared between Ganesh and Graphite,
|
|
16
19
|
// this is named VulkanGraphiteContext.h to supply just the factory function (differing from the
|
|
17
20
|
// public headers exposed by other backends).
|
|
@@ -28,4 +31,12 @@ SK_API std::unique_ptr<Context> MakeVulkan(const VulkanBackendContext&, const Co
|
|
|
28
31
|
|
|
29
32
|
} // namespace skgpu::graphite
|
|
30
33
|
|
|
34
|
+
namespace SkContexts {
|
|
35
|
+
|
|
36
|
+
// Creates a context wrapping a Graphite GPU backend with Vulkan
|
|
37
|
+
std::unique_ptr<SkContext> MakeGraphite(const skgpu::VulkanBackendContext& vkContext,
|
|
38
|
+
const SkContextOptions& options);
|
|
39
|
+
|
|
40
|
+
} // namespace SkContexts
|
|
41
|
+
|
|
31
42
|
#endif // skgpu_graphite_VulkanGraphiteUtils_DEFINED
|
|
@@ -16,29 +16,11 @@
|
|
|
16
16
|
#include "include/private/SkLogPriority.h"
|
|
17
17
|
|
|
18
18
|
#if !defined(SkLog)
|
|
19
|
-
//
|
|
19
|
+
// Implemented per platform.
|
|
20
20
|
void SkLogVAList(SkLogPriority priority, const char format[], va_list args) SK_PRINTF_LIKE(2, 0);
|
|
21
21
|
void SK_SPI SkLog(SkLogPriority priority, const char format[], ...) SK_PRINTF_LIKE(2, 3);
|
|
22
22
|
#endif
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* TODO (b/469441457): SKGPU_GRAPHITE_LOWEST_ACTIVE_LOG_PRIORITY Was the config used to set the log
|
|
26
|
-
* priority, so we check for that define as well. Eventually, we should move clients using this
|
|
27
|
-
* define to the new one.
|
|
28
|
-
*/
|
|
29
|
-
#if defined(SKGPU_GRAPHITE_LOWEST_ACTIVE_LOG_PRIORITY)
|
|
30
|
-
static constexpr SkLogPriority MapGraphitePriority(skgpu::graphite::LogPriority priority) {
|
|
31
|
-
switch (priority) {
|
|
32
|
-
case skgpu::graphite::LogPriority::kError: return SkLogPriority::kError;
|
|
33
|
-
case skgpu::graphite::LogPriority::kWarning: return SkLogPriority::kWarning;
|
|
34
|
-
case skgpu::graphite::LogPriority::kInfo: return SkLogPriority::kInfo;
|
|
35
|
-
case skgpu::graphite::LogPriority::kDebug: return SkLogPriority::kDebug;
|
|
36
|
-
default: return SkLogPriority::kDebug;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
#define SKIA_LOWEST_ACTIVE_LOG_PRIORITY MapGraphitePriority(SKGPU_GRAPHITE_LOWEST_ACTIVE_LOG_PRIORITY)
|
|
40
|
-
#endif
|
|
41
|
-
|
|
42
24
|
#if !defined(SKIA_LOWEST_ACTIVE_LOG_PRIORITY)
|
|
43
25
|
#ifdef SK_DEBUG
|
|
44
26
|
#define SKIA_LOWEST_ACTIVE_LOG_PRIORITY SkLogPriority::kDebug
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
12
|
#include "include/core/SkSurfaceProps.h"
|
|
13
13
|
#include "include/core/SkTypes.h"
|
|
14
|
+
#include "include/gpu/ganesh/GrDirectContext.h"
|
|
14
15
|
|
|
15
16
|
#include <memory>
|
|
16
17
|
|
|
@@ -72,7 +73,7 @@ public:
|
|
|
72
73
|
|
|
73
74
|
// Records all the draws to the imported secondary command buffer and sets any dependent
|
|
74
75
|
// offscreen draws to the GPU.
|
|
75
|
-
|
|
76
|
+
GrDirectContext::FlushResult flush();
|
|
76
77
|
|
|
77
78
|
/** Inserts a list of GPU semaphores that Skia will have the driver wait on before executing
|
|
78
79
|
commands for this secondary CB. The wait semaphores will get added to the VkCommandBuffer
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 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 SkLogHandler_DEFINED
|
|
9
|
+
#define SkLogHandler_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkRefCnt.h"
|
|
12
|
+
#include "include/core/SkTypes.h"
|
|
13
|
+
#include "include/private/SkLogPriority.h"
|
|
14
|
+
|
|
15
|
+
#include <cstdarg>
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SkLogHandler defines an interface for receiving Skia log messages.
|
|
19
|
+
* Clients can implement this interface and install it via SetInstance.
|
|
20
|
+
*/
|
|
21
|
+
class SK_API SkLogHandler : public SkRefCnt {
|
|
22
|
+
public:
|
|
23
|
+
~SkLogHandler() override = default;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Called when a log message is generated (must pass compile-time priority).
|
|
27
|
+
* Must be thread-safe since multiple threads may be logging at the same time.
|
|
28
|
+
* @param priority The priority of the log message.
|
|
29
|
+
* @param format The format string of the log message.
|
|
30
|
+
* @param args The arguments for the format string.
|
|
31
|
+
*/
|
|
32
|
+
virtual void onLog(SkLogPriority priority, const char format[], va_list args) = 0;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Installs a custom log handler. Returns true if successful (i.e., it's the first call).
|
|
36
|
+
* Skia only allows one SkLogHandler to be set and it cannot change after being set.
|
|
37
|
+
*/
|
|
38
|
+
static bool SetInstance(sk_sp<SkLogHandler>);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns the current log handler. If none has been set, returns nullptr.
|
|
42
|
+
*/
|
|
43
|
+
static sk_sp<SkLogHandler> GetInstance();
|
|
44
|
+
|
|
45
|
+
protected:
|
|
46
|
+
SkLogHandler() = default;
|
|
47
|
+
|
|
48
|
+
private:
|
|
49
|
+
SkLogHandler(const SkLogHandler&) = delete;
|
|
50
|
+
SkLogHandler& operator=(const SkLogHandler&) = delete;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
#endif // SkLogHandler_DEFINED
|
|
@@ -95,6 +95,7 @@ protected:
|
|
|
95
95
|
const SkPaint*) override;
|
|
96
96
|
void onDrawAtlas2(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
|
|
97
97
|
SkBlendMode, const SkSamplingOptions&, const SkRect*, const SkPaint*) override;
|
|
98
|
+
void onDrawMesh(const SkMesh&, sk_sp<SkBlender>, const SkPaint&) override;
|
|
98
99
|
|
|
99
100
|
void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
|
|
100
101
|
void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
|
|
@@ -1113,11 +1113,9 @@ STAGE(unpremul, NoCtx) {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
|
|
1115
1115
|
STAGE(matrix_3x3, const skcms_Matrix3x3* matrix) {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
G = m[3]*r + m[4]*g + m[5]*b,
|
|
1120
|
-
B = m[6]*r + m[7]*g + m[8]*b;
|
|
1116
|
+
F R = matrix->vals[0][0]*r + matrix->vals[0][1]*g + matrix->vals[0][2]*b,
|
|
1117
|
+
G = matrix->vals[1][0]*r + matrix->vals[1][1]*g + matrix->vals[1][2]*b,
|
|
1118
|
+
B = matrix->vals[2][0]*r + matrix->vals[2][1]*g + matrix->vals[2][2]*b;
|
|
1121
1119
|
|
|
1122
1120
|
r = R;
|
|
1123
1121
|
g = G;
|
|
@@ -1125,11 +1123,12 @@ STAGE(matrix_3x3, const skcms_Matrix3x3* matrix) {
|
|
|
1125
1123
|
}
|
|
1126
1124
|
|
|
1127
1125
|
STAGE(matrix_3x4, const skcms_Matrix3x4* matrix) {
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
B =
|
|
1126
|
+
F R = matrix->vals[0][0]*r + matrix->vals[0][1]*g + matrix->vals[0][2]*b
|
|
1127
|
+
+ matrix->vals[0][3],
|
|
1128
|
+
G = matrix->vals[1][0]*r + matrix->vals[1][1]*g + matrix->vals[1][2]*b
|
|
1129
|
+
+ matrix->vals[1][3],
|
|
1130
|
+
B = matrix->vals[2][0]*r + matrix->vals[2][1]*g + matrix->vals[2][2]*b
|
|
1131
|
+
+ matrix->vals[2][3];
|
|
1133
1132
|
|
|
1134
1133
|
r = R;
|
|
1135
1134
|
g = G;
|
|
@@ -57,9 +57,14 @@ extern "C" {
|
|
|
57
57
|
#define SKCMS_HAS_MUSTTAIL 1
|
|
58
58
|
#endif
|
|
59
59
|
#elif defined(__GNUC__) && !defined(SKCMS_HAS_MUSTTAIL)
|
|
60
|
-
// GCC on
|
|
61
|
-
//
|
|
62
|
-
|
|
60
|
+
// GCC on RISCV, MIPS, PowerPC, LoongArch, and Windows (MinGW)
|
|
61
|
+
// does not support our tail call functions
|
|
62
|
+
// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121784).
|
|
63
|
+
#if __has_cpp_attribute(clang::musttail) && !defined(__riscv) \
|
|
64
|
+
&& !defined(__mips__) \
|
|
65
|
+
&& !defined(__powerpc__) \
|
|
66
|
+
&& !defined(__loongarch__) \
|
|
67
|
+
&& !defined(_WIN32)
|
|
63
68
|
#define SKCMS_HAS_MUSTTAIL 1
|
|
64
69
|
#else
|
|
65
70
|
#define SKCMS_HAS_MUSTTAIL 0
|