[graphite] Expose capture methods through ContextPriv.
Allows the methods to be used to capture in tests and GMs.
Change-Id: I56c70bd18365607560013c8f6dcf0119c1802970
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/583778
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/graphite/ContextPriv.h b/src/gpu/graphite/ContextPriv.h
index 8b0da8f..d0d3350 100644
--- a/src/gpu/graphite/ContextPriv.h
+++ b/src/gpu/graphite/ContextPriv.h
@@ -9,6 +9,7 @@
#define skgpu_graphite_ContextPriv_DEFINED
#include "include/gpu/graphite/Context.h"
+#include "src/gpu/graphite/QueueManager.h"
#include "src/gpu/graphite/SharedContext.h"
class SkShaderCodeDictionary;
@@ -33,6 +34,13 @@
SkShaderCodeDictionary* shaderCodeDictionary() {
return fContext->fSharedContext->shaderCodeDictionary();
}
+
+ void startCapture() {
+ fContext->fQueueManager->startCapture();
+ }
+ void endCapture() {
+ fContext->fQueueManager->endCapture();
+ }
#endif
private:
diff --git a/src/gpu/graphite/QueueManager.h b/src/gpu/graphite/QueueManager.h
index fcb35de..0f552a0 100644
--- a/src/gpu/graphite/QueueManager.h
+++ b/src/gpu/graphite/QueueManager.h
@@ -31,8 +31,8 @@
void checkForFinishedWork(SyncToCpu);
#if GRAPHITE_TEST_UTILS
- virtual void testingOnly_startCapture() {}
- virtual void testingOnly_endCapture() {}
+ virtual void startCapture() {}
+ virtual void endCapture() {}
#endif
protected:
diff --git a/src/gpu/graphite/mtl/MtlQueueManager.h b/src/gpu/graphite/mtl/MtlQueueManager.h
index 4469942..d88c9b4 100644
--- a/src/gpu/graphite/mtl/MtlQueueManager.h
+++ b/src/gpu/graphite/mtl/MtlQueueManager.h
@@ -34,8 +34,8 @@
OutstandingSubmission onSubmitToGpu() override;
#if GRAPHITE_TEST_UTILS
- void testingOnly_startCapture() override;
- void testingOnly_endCapture() override;
+ void startCapture() override;
+ void endCapture() override;
#endif
sk_cfp<id<MTLCommandQueue>> fQueue;
diff --git a/src/gpu/graphite/mtl/MtlQueueManager.mm b/src/gpu/graphite/mtl/MtlQueueManager.mm
index d1b8296..351947e 100644
--- a/src/gpu/graphite/mtl/MtlQueueManager.mm
+++ b/src/gpu/graphite/mtl/MtlQueueManager.mm
@@ -68,7 +68,7 @@
}
#if GRAPHITE_TEST_UTILS
-void MtlQueueManager::testingOnly_startCapture() {
+void MtlQueueManager::startCapture() {
if (@available(macOS 10.13, iOS 11.0, *)) {
// TODO: add newer Metal interface as well
MTLCaptureManager* captureManager = [MTLCaptureManager sharedCaptureManager];
@@ -90,7 +90,7 @@
}
}
-void MtlQueueManager::testingOnly_endCapture() {
+void MtlQueueManager::endCapture() {
if (@available(macOS 10.13, iOS 11.0, *)) {
MTLCaptureManager* captureManager = [MTLCaptureManager sharedCaptureManager];
if (captureManager.isCapturing) {