Add GM to exercise some of the darker corners of SkMagnifierImageFilter

An upcoming CL (https://skia-review.googlesource.com/c/7995/ (Remove asTextureRef from SkSpecialImage & update effects accordingly)) modifies some untested portions of the SkMagnifierImageFilter.

This adds a test to prevents regressions.

Change-Id: I9fa406f699e39fa393212e7f63a457b015b36edb
Reviewed-on: https://skia-review.googlesource.com/8023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/effects/SkImageSource.cpp b/src/effects/SkImageSource.cpp
index 0f0160d..5769e67 100644
--- a/src/effects/SkImageSource.cpp
+++ b/src/effects/SkImageSource.cpp
@@ -83,12 +83,20 @@
     ctx.ctm().mapRect(&dstRect, fDstRect);
 
     SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height());
-    if (fSrcRect == bounds && dstRect == bounds) {
-        // No regions cropped out or resized; return entire image.
-        offset->fX = offset->fY = 0;
-        return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(fImage->width(), fImage->height()),
-                                             fImage, ctx.outputProperties().colorSpace(),
-                                             &source->props());
+    if (fSrcRect == bounds) {
+        int iLeft = dstRect.fLeft;
+        int iTop = dstRect.fTop;
+        // TODO: this seems to be a very noise-prone way to determine this (esp. the floating-point
+        // widths & heights).
+        if (dstRect.width() == bounds.width() && dstRect.height() == bounds.height() &&
+            iLeft == dstRect.fLeft && iTop == dstRect.fTop) {
+            // The dest is just an un-scaled integer translation of the entire image; return it
+            offset->fX = iLeft;
+            offset->fY = iTop;
+            return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(fImage->width(), fImage->height()),
+                                                 fImage, ctx.outputProperties().colorSpace(),
+                                                 &source->props());
+        }
     }
 
     const SkIRect dstIRect = dstRect.roundOut();