Fix the size check for the drawBitmap fast-path in SkBitmapDevice::drawBitmapRect...
authorlsalzman <lsalzman@mozilla.com>
Fri, 31 Mar 2017 20:46:47 +0000 (13:46 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 31 Mar 2017 20:46:47 +0000 (13:46 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2089583002

Review-Url: https://codereview.chromium.org/2089583002

src/core/SkBitmapDevice.cpp

index 3be63ba..de0cc7d 100644 (file)
@@ -316,8 +316,9 @@ void SkBitmapDevice::drawBitmapRect(const SkBitmap& bitmap,
             matrix.preTranslate(dx, dy);
         }
 
-        SkRect extractedBitmapBounds;
-        extractedBitmapBounds.isetWH(bitmapPtr->width(), bitmapPtr->height());
+        SkRect extractedBitmapBounds = SkRect::MakeXYWH(dx, dy,
+                                                        SkIntToScalar(bitmapPtr->width()),
+                                                        SkIntToScalar(bitmapPtr->height()));
         if (extractedBitmapBounds == tmpSrc) {
             // no fractional part in src, we can just call drawBitmap
             goto USE_DRAWBITMAP;