Fix the size check for the drawBitmap fast-path in SkBitmapDevice::drawBitmapRect. It would fail when the source rectangle had a non-zero offset, in which case it would compare the source rectangle with the offset to the extracted bitmap size, which always fails. The only thing that should matter is that the source rectangle and extract bitmap have the same size, since the offset gets added onto the matrix.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2089583002

Review-Url: https://codereview.chromium.org/2089583002
Committed: https://skia.googlesource.com/skia/+/ea9bc0c07b5dae78a9a449d7d7a07fc79262d41a
Review-Url: https://codereview.chromium.org/2089583002
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 95ea45c..fd387ac 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -315,8 +315,14 @@
             matrix.preTranslate(dx, dy);
         }
 
+#ifdef SK_DRAWBITMAPRECT_FAST_OFFSET
+        SkRect extractedBitmapBounds = SkRect::MakeXYWH(dx, dy,
+                                                        SkIntToScalar(bitmapPtr->width()),
+                                                        SkIntToScalar(bitmapPtr->height()));
+#else
         SkRect extractedBitmapBounds;
         extractedBitmapBounds.isetWH(bitmapPtr->width(), bitmapPtr->height());
+#endif
         if (extractedBitmapBounds == tmpSrc) {
             // no fractional part in src, we can just call drawBitmap
             goto USE_DRAWBITMAP;