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

Unified Diff: src/core/SkCanvas.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 | « include/pdf/SkPDFDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
===================================================================
--- src/core/SkCanvas.cpp (revision 10315)
+++ src/core/SkCanvas.cpp (working copy)
@@ -955,7 +955,7 @@
return bitmap.width() <= 0 || bitmap.height() <= 0;
}
-void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap, const SkIRect* srcRect,
+void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap,
const SkMatrix& matrix, const SkPaint* paint) {
if (reject_bitmap(bitmap)) {
return;
@@ -965,7 +965,17 @@
if (NULL == paint) {
paint = lazy.init();
}
- this->commonDrawBitmap(bitmap, srcRect, matrix, *paint);
+
+ SkDEBUGCODE(bitmap.validate();)
+ CHECK_LOCKCOUNT_BALANCE(bitmap);
+
+ LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type)
+
+ while (iter.next()) {
+ iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint());
+ }
+
+ LOOPER_END
}
void SkCanvas::internalDrawDevice(SkDevice* srcDev, int x, int y,
@@ -1733,7 +1743,7 @@
SkMatrix matrix;
matrix.setTranslate(x, y);
- this->internalDrawBitmap(bitmap, NULL, matrix, paint);
+ this->internalDrawBitmap(bitmap, matrix, paint);
}
// this one is non-virtual, so it can be called safely by other canvas apis
@@ -1779,23 +1789,9 @@
void SkCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& matrix,
const SkPaint* paint) {
SkDEBUGCODE(bitmap.validate();)
- this->internalDrawBitmap(bitmap, NULL, matrix, paint);
+ this->internalDrawBitmap(bitmap, matrix, paint);
}
-void SkCanvas::commonDrawBitmap(const SkBitmap& bitmap, const SkIRect* srcRect,
- const SkMatrix& matrix, const SkPaint& paint) {
- SkDEBUGCODE(bitmap.validate();)
- CHECK_LOCKCOUNT_BALANCE(bitmap);
-
- LOOPER_BEGIN(paint, SkDrawFilter::kBitmap_Type)
-
- while (iter.next()) {
- iter.fDevice->drawBitmap(iter, bitmap, srcRect, matrix, looper.paint());
- }
-
- LOOPER_END
-}
-
void SkCanvas::internalDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
« no previous file with comments | « include/pdf/SkPDFDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698