aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-08 09:49:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-08 15:36:11 +0000
commit26b50a4cda53661c59ae37c7fd1c873d099f2236 (patch)
tree5b58a81e93e49fc189641eb66022381b7eda7430 /src/gpu/GrGpu.h
parentf7778979343998e4c10df8ebe43f02e60c700f0d (diff)
Add testing only helper to flush and sync gpu.
The use case for this is mostly for Vulkan where we need to make sure the gpu is done with resources before we delete or use them in some way. Previously we used readPixels to do this which was just an ugly hack. Bug: skia: Change-Id: I7949ebc695032533675133aabca0e32840b417ba Reviewed-on: https://skia-review.googlesource.com/113122 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index b06b0d7481..0c794e2eff 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -468,6 +468,12 @@ public:
*/
virtual void deleteTestingOnlyBackendTexture(GrBackendTexture*) = 0;
+ /**
+ * Flushes all work to the gpu and forces the GPU to wait until all the gpu work has completed.
+ * This is for testing purposes only.
+ */
+ virtual void testingOnly_flushGpuAndSync() = 0;
+
// width and height may be larger than rt (if underlying API allows it).
// Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on
// the GrStencilAttachment.