aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureRenderTargetProxy.cpp
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/GrTextureRenderTargetProxy.cpp
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/GrTextureRenderTargetProxy.cpp')
-rw-r--r--src/gpu/GrTextureRenderTargetProxy.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 7058c83afc..3981f17e30 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -44,16 +44,15 @@ size_t GrTextureRenderTargetProxy::onUninstantiatedGpuMemorySize() const {
SkBackingFit::kApprox == fFit);
}
-GrSurface* GrTextureRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) {
+bool GrTextureRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) {
static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag;
- GrSurface* surf = this->instantiateImpl(resourceProvider, this->numStencilSamples(), kFlags,
- this->isMipMapped(), this->mipColorMode());
- if (!surf) {
- return nullptr;
+ if (!this->instantiateImpl(resourceProvider, this->numStencilSamples(), kFlags,
+ this->isMipMapped(), this->mipColorMode())) {
+ return false;
}
- SkASSERT(surf->asRenderTarget());
- SkASSERT(surf->asTexture());
+ SkASSERT(fTarget->asRenderTarget());
+ SkASSERT(fTarget->asTexture());
- return surf;
+ return true;
}