Update copy and blitTexture calls to not query origin off of proxies.
Bug: skia:9556
Change-Id: I4042f1339844186b73b807e93b1a3701c32bf112
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269366
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 7391c01..26720aa 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -313,7 +313,7 @@
GrRenderable::kNo, 1, mipMapped,
src->isProtected(), origin, srcColorType,
kUnknown_SkAlphaType, nullptr, fit, budgeted);
- if (dstContext && dstContext->copy(src, srcRect, dstPoint)) {
+ if (dstContext && dstContext->copy(src, origin, srcRect, dstPoint)) {
return dstContext->readSurfaceView();
}
}
@@ -322,7 +322,10 @@
{width, height}, format, 1,
mipMapped, src->isProtected(), origin,
budgeted, nullptr);
- if (dstContext && dstContext->blitTexture(src->asTextureProxy(), srcRect, dstPoint)) {
+ GrSwizzle swizzle = context->priv().caps()->getReadSwizzle(src->backendFormat(),
+ srcColorType);
+ GrSurfaceProxyView view(sk_ref_sp(src), origin, swizzle);
+ if (dstContext && dstContext->blitTexture(std::move(view), srcRect, dstPoint)) {
return dstContext->readSurfaceView();
}
}