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/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 9822462..bfb0344 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -426,7 +426,7 @@
} else {
SkIRect srcRect = SkIRect::MakeWH(srcInfo.width(), srcInfo.height());
SkIPoint dstPoint = SkIPoint::Make(pt.fX, pt.fY);
- if (!this->copy(tempProxy.get(), srcRect, dstPoint)) {
+ if (!this->copy(tempProxy.get(), tempOrigin, srcRect, dstPoint)) {
return false;
}
}
@@ -470,7 +470,8 @@
srcColorType, src, rowBytes);
}
-bool GrSurfaceContext::copy(GrSurfaceProxy* src, const SkIRect& srcRect, const SkIPoint& dstPoint) {
+bool GrSurfaceContext::copy(GrSurfaceProxy* src, GrSurfaceOrigin origin, const SkIRect& srcRect,
+ const SkIPoint& dstPoint) {
ASSERT_SINGLE_OWNER
RETURN_FALSE_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -479,9 +480,8 @@
const GrCaps* caps = fContext->priv().caps();
SkASSERT(src->backendFormat().textureType() != GrTextureType::kExternal);
- SkASSERT(src->origin() == this->asSurfaceProxy()->origin());
- SkASSERT(src->textureSwizzle() == this->asSurfaceProxy()->textureSwizzle());
SkASSERT(src->backendFormat() == this->asSurfaceProxy()->backendFormat());
+ SkASSERT(origin == this->origin());
if (this->asSurfaceProxy()->framebufferOnly()) {
return false;
@@ -493,7 +493,7 @@
// The swizzle doesn't matter for copies and it is not used.
return this->drawingManager()->newCopyRenderTask(
- GrSurfaceProxyView(sk_ref_sp(src), src->origin(), GrSwizzle()), srcRect,
+ GrSurfaceProxyView(sk_ref_sp(src), origin, GrSwizzle()), srcRect,
this->readSurfaceView(), dstPoint);
}