aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurfaceProxy.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-06-26 10:20:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-26 14:48:12 +0000
commitc1b6066263b1a1dd19f5dedd38e20cf0b142f271 (patch)
tree6f9f903abc1ae9acde5a14c3fda3a97834385e13 /src/gpu/GrSurfaceProxy.cpp
parentd4b2adeaa929edd1664754ac6621ec524992ef03 (diff)
Fix instantiation of partially lazy proxies
Change-Id: I941333711966da109583a3a72ab3464363285b84 Reviewed-on: https://skia-review.googlesource.com/137580 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r--src/gpu/GrSurfaceProxy.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index fe8641a04f..81ad5840ed 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -400,8 +400,14 @@ bool GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide
return false;
}
- fProxy->fWidth = surface->width();
- fProxy->fHeight = surface->height();
+ if (fProxy->fWidth <= 0 || fProxy->fHeight <= 0) {
+ // This was a fully lazy proxy. We need to fill in the width & height. For partially
+ // lazy proxies we must preserve the original width & height since that indicates
+ // the content area.
+ SkASSERT(fProxy->fWidth <= 0 && fProxy->fHeight <= 0);
+ fProxy->fWidth = surface->width();
+ fProxy->fHeight = surface->height();
+ }
bool needsStencil = fProxy->asRenderTargetProxy()
? fProxy->asRenderTargetProxy()->needsStencil()