Reduce dependence on GrSurface's origin field
Unfortunately, GrGPU and its ilk are still using the GrSurface's origin a lot. I will clean that up in a second CL.
Change-Id: Iba729440ce8ea8d24bb7f4e5de55ed576a0f176d
Reviewed-on: https://skia-review.googlesource.com/24700
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index be29857..166cb9d 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -46,7 +46,8 @@
GrUniqueKey key;
this->makeCopyKey(copyParams, &key, nullptr);
if (key.isValid()) {
- sk_sp<GrTextureProxy> cachedCopy = fContext->resourceProvider()->findProxyByUniqueKey(key);
+ sk_sp<GrTextureProxy> cachedCopy = fContext->resourceProvider()->findProxyByUniqueKey(
+ key, this->originalProxy()->origin());
if (cachedCopy) {
return cachedCopy;
}
@@ -58,6 +59,7 @@
sk_sp<GrTextureProxy> copy = CopyOnGpu(fContext, std::move(proxy), contentArea, copyParams);
if (copy) {
if (key.isValid()) {
+ SkASSERT(copy->origin() == this->originalProxy()->origin());
fContext->resourceProvider()->assignUniqueKeyToProxy(key, copy.get());
this->didCacheCopy(key);
}