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

Unified Diff: src/core/SkDevice.cpp

Issue 19977003: drawBitmap* cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixed bugs Created 7 years, 5 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 | « src/core/SkCanvas.cpp ('k') | src/device/xps/SkXPSDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDevice.cpp
===================================================================
--- src/core/SkDevice.cpp (revision 10315)
+++ src/core/SkDevice.cpp (working copy)
@@ -371,18 +371,8 @@
}
void SkDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
- const SkIRect* srcRect,
const SkMatrix& matrix, const SkPaint& paint) {
- SkBitmap tmp; // storage if we need a subset of bitmap
- const SkBitmap* bitmapPtr = &bitmap;
-
- if (srcRect) {
- if (!bitmap.extractSubset(&tmp, *srcRect)) {
- return; // extraction failed
- }
- bitmapPtr = &tmp;
- }
- draw.drawBitmap(*bitmapPtr, matrix, paint);
+ draw.drawBitmap(bitmap, matrix, paint);
}
void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
@@ -449,7 +439,7 @@
// We can go faster by just calling drawBitmap, which will concat the
// matrix with the CTM, and try to call drawSprite if it can. If not,
// it will make a shader and call drawRect, as we do below.
- this->drawBitmap(draw, *bitmapPtr, NULL, matrix, paint);
+ this->drawBitmap(draw, *bitmapPtr, matrix, paint);
return;
}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/device/xps/SkXPSDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698