aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxy.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-01-24 13:22:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-24 19:02:10 +0000
commitbddcc95383250940fce5491576a1636f3087cba9 (patch)
treea11eb20435b05a4092bbf9a30a668ee036333335 /src/gpu/GrSurfaceProxy.cpp
parent5373aa2a6688d144803e175b72829d932e752fc6 (diff)
Add return value to doLazyInstantiation to know if it succeedes.
This allows us to return nullptr in places where we try to instantiate immediately and it fails. Bug: skia: Change-Id: Ic3da26b0e6270b3de114d80533f0580b4d6bf0e7 Reviewed-on: https://skia-review.googlesource.com/99381 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 08e4dd3128..2ad28f8ac4 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -347,7 +347,7 @@ void GrSurfaceProxyPriv::exactify() {
// exact amount.
}
-void GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvider) {
+bool GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvider) {
SkASSERT(fProxy->fLazyInstantiateCallback);
SkASSERT(!fProxy->fTarget);
@@ -372,7 +372,7 @@ void GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide
fProxy->fWidth = 0;
fProxy->fHeight = 0;
fProxy->fOrigin = kTopLeft_GrSurfaceOrigin;
- return;
+ return false;
}
fProxy->fWidth = texture->width();
@@ -381,5 +381,6 @@ void GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide
SkASSERT(texture->config() == fProxy->fConfig);
SkDEBUGCODE(fProxy->validateLazyTexture(texture.get());)
this->assign(std::move(texture));
+ return true;
}