diff options
-rw-r--r-- | src/gpu/GrProxyProvider.cpp | 3 | ||||
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 10 | ||||
-rw-r--r-- | src/gpu/GrYUVProvider.cpp | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp index 5814c7627a..e259e34e28 100644 --- a/src/gpu/GrProxyProvider.cpp +++ b/src/gpu/GrProxyProvider.cpp @@ -267,6 +267,9 @@ sk_sp<GrTextureProxy> GrProxyProvider::createTextureProxy(sk_sp<SkImage> srcImag return nullptr; } } + + SkASSERT(proxy->width() == desc.fWidth); + SkASSERT(proxy->height() == desc.fHeight); return proxy; } 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() diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp index f235684f88..82e031c450 100644 --- a/src/gpu/GrYUVProvider.cpp +++ b/src/gpu/GrYUVProvider.cpp @@ -106,6 +106,9 @@ sk_sp<GrTextureProxy> GrYUVProvider::refAsTextureProxy(GrContext* ctx, const GrS auto proxyProvider = ctx->contextPriv().proxyProvider(); yuvTextureProxies[i] = proxyProvider->createTextureProxy(yuvImage, kNone_GrSurfaceFlags, 1, SkBudgeted::kYes, fit); + + SkASSERT(yuvTextureProxies[i]->width() == yuvInfo.fSizeInfo.fSizes[i].fWidth); + SkASSERT(yuvTextureProxies[i]->height() == yuvInfo.fSizeInfo.fSizes[i].fHeight); } // TODO: investigate preallocating mip maps here |