Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 2089583002: fix size check for drawBitmap fast-path in SkBitmapDevice::drawBitmapRect (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: guard new drawBitmapRect offset behavior with SK_DRAWBITMAPRECT_FAST_OFFSET ifdef Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 119a434cc9cde8a5077a18702ba2394e67a183f8..0215ab7642b7f6b23d2aca1401dc12947ad17e10 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -302,8 +302,13 @@ void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
matrix.preTranslate(dx, dy);
}
- SkRect extractedBitmapBounds;
- extractedBitmapBounds.isetWH(bitmapPtr->width(), bitmapPtr->height());
+#ifdef SK_DRAWBITMAPRECT_FAST_OFFSET
+ SkRect extractedBitmapBounds = SkRect::MakeXYWH(dx, dy,
+ SkIntToScalar(bitmapPtr->width()),
+ SkIntToScalar(bitmapPtr->height()));
+#else
+ SkRect extractedBitmapBounds = SkRect::MakeIWH(bitmapPtr->width(), bitmapPtr->height());
caryclark 2017/04/05 16:59:47 Can you change this back to SkRect extractedBitma
+#endif
if (extractedBitmapBounds == tmpSrc) {
// no fractional part in src, we can just call drawBitmap
goto USE_DRAWBITMAP;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698