aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxyPriv.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-05 09:26:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-05 14:03:10 +0000
commiteee4d6e4e8cc5c4c79f065abcc3ce609f71238f9 (patch)
tree9a855a9892a8b3017370164355b88c2a4ac9c89c /src/gpu/GrSurfaceProxyPriv.h
parent9beafc41afa3c78ffa12649dcde73628c277da9c (diff)
Make instantiate return a Boolean
From an off-line conversation: The longer term idea will be to create a helper class isolates the ability to instantiate proxies until flush time. The peek* methods could then be moved to GrSurfaceProxy. Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd Reviewed-on: https://skia-review.googlesource.com/18076 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxyPriv.h')
-rw-r--r--src/gpu/GrSurfaceProxyPriv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrSurfaceProxyPriv.h b/src/gpu/GrSurfaceProxyPriv.h
index ea4d9b63a3..b10cb345f7 100644
--- a/src/gpu/GrSurfaceProxyPriv.h
+++ b/src/gpu/GrSurfaceProxyPriv.h
@@ -15,13 +15,21 @@
data members or virtual methods. */
class GrSurfaceProxyPriv {
public:
+ // This should only be called after a successful call to instantiate
+ GrSurface* peekSurface() const {
+ SkASSERT(fProxy->fTarget);
+ return fProxy->fTarget;
+ }
+
// If the proxy is already instantiated, return its backing GrTexture; if not,
// return null
GrTexture* peekTexture() const {
return fProxy->fTarget ? fProxy->fTarget->asTexture() : nullptr;
}
+ // This should only be called after a successful call to instantiate
GrRenderTarget* peekRenderTarget() const {
+ SkASSERT(fProxy->fTarget && fProxy->fTarget->asRenderTarget());
return fProxy->fTarget ? fProxy->fTarget->asRenderTarget() : nullptr;
}