diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-04 14:33:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-04 20:01:28 +0000 |
commit | e8fabb2665d12ee289bc3af5b7e93c5b12396e2d (patch) | |
tree | 3f7cde3336c04ae74c09b102d3fefd7f8c7fb5cd /src/gpu/GrSurfaceProxy.cpp | |
parent | d2807d5115ad0f6954fa0d77e761db5afdb38d68 (diff) |
Update LazyProxy creation to allow for a non-textureable result
Change-Id: Ic284b4f4220afa714159e07f57798a94fd40d63a
Reviewed-on: https://skia-review.googlesource.com/102484
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 4020758259..c9cf535879 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -360,21 +360,20 @@ bool GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide outOrigin = &fProxy->fOrigin; } - sk_sp<GrTexture> texture = fProxy->fLazyInstantiateCallback(resourceProvider, outOrigin); - - if (!texture) { + sk_sp<GrSurface> surface = fProxy->fLazyInstantiateCallback(resourceProvider, outOrigin); + if (!surface) { fProxy->fWidth = 0; fProxy->fHeight = 0; fProxy->fOrigin = kTopLeft_GrSurfaceOrigin; return false; } - fProxy->fWidth = texture->width(); - fProxy->fHeight = texture->height(); + fProxy->fWidth = surface->width(); + fProxy->fHeight = surface->height(); - SkASSERT(texture->config() == fProxy->fConfig); - SkDEBUGCODE(fProxy->validateLazyTexture(texture.get());) - this->assign(std::move(texture)); + SkASSERT(surface->config() == fProxy->fConfig); + SkDEBUGCODE(fProxy->validateLazySurface(surface.get());) + this->assign(std::move(surface)); return true; } |