aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-04-05 09:30:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-05 14:21:07 +0000
commit8caf85f9f40f6bad38bf66bd02b87dcebe139a5c (patch)
tree46a2b1414601ca99f6c60bd3442e8075bc27173f /include/core
parent91749c82523c8b0b3f2b6f800d85893ca5386fbd (diff)
Add GrBackendTexture/RenderTarget accessors to SkSurface
Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a Reviewed-on: https://skia-review.googlesource.com/85220 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkSurface.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 55a34fc9fc..1950d36fea 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -20,6 +20,7 @@ class SkPaint;
class SkSurfaceCharacterization;
class GrBackendRenderTarget;
class GrBackendSemaphore;
+class GrBackendTexture;
class GrContext;
class GrRenderTarget;
@@ -458,6 +459,35 @@ public:
bool getRenderTargetHandle(GrBackendObject* backendObject,
BackendHandleAccess backendHandleAccess);
+#if GR_TEST_UTILS
+ /** Retrieves the backend texture. If Surface has no backend texture, an invalid
+ object is returned. Call GrBackendTexture::isValid to determine if the result
+ is valid.
+
+ The returned GrBackendTexture should be discarded if the Surface is drawn to or deleted.
+
+ @param backendHandleAccess one of: kFlushRead_BackendHandleAccess,
+ kFlushWrite_BackendHandleAccess,
+ kDiscardWrite_BackendHandleAccess
+ @return GPU texture reference; invalid on failure
+ */
+ GrBackendTexture getBackendTexture(BackendHandleAccess backendHandleAccess);
+
+ /** Retrieves the backend render target. If Surface has no backend render target, an invalid
+ object is returned. Call GrBackendRenderTarget::isValid to determine if the result
+ is valid.
+
+ The returned GrBackendRenderTarget should be discarded if the Surface is drawn to
+ or deleted.
+
+ @param backendHandleAccess one of: kFlushRead_BackendHandleAccess,
+ kFlushWrite_BackendHandleAccess,
+ kDiscardWrite_BackendHandleAccess
+ @return GPU render target reference; invalid on failure
+ */
+ GrBackendRenderTarget getBackendRenderTarget(BackendHandleAccess backendHandleAccess);
+#endif
+
/** Returns SkCanvas that draws into SkSurface. Subsequent calls return the same SkCanvas.
SkCanvas returned is managed and owned by SkSurface, and is deleted when SkSurface
is deleted.