Sixth small fragment from "Reduce dependence on GrSurface's origin field"

TBR=bsalomon@google.com
Change-Id: I585ab16767c2276974763213916f25755c1a8a45
Reviewed-on: https://skia-review.googlesource.com/25743
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp
index 44212fe..96bcea4 100644
--- a/src/gpu/GrTextureMaker.cpp
+++ b/src/gpu/GrTextureMaker.cpp
@@ -41,9 +41,17 @@
         }
     }
 
+    SkDEBUGCODE(GrSurfaceOrigin origOrigin);
     GrUniqueKey copyKey;
     this->makeCopyKey(copyParams, &copyKey, dstColorSpace);
     if (copyKey.isValid()) {
+#ifdef SK_DEBUG
+        if (original) {
+            origOrigin = original->origin();
+        } else {
+            origOrigin = kTopLeft_GrSurfaceOrigin;
+        }
+#endif
         sk_sp<GrTextureProxy> result(fContext->resourceProvider()->findProxyByUniqueKey(copyKey));
         if (result) {
             return result;
@@ -62,6 +70,7 @@
     }
 
     if (copyKey.isValid()) {
+        SkASSERT(result->origin() == origOrigin);
         fContext->resourceProvider()->assignUniqueKeyToProxy(copyKey, result.get());
         this->didCacheCopy(copyKey);
     }