don't quickReject bitmaps if there is a looper or other possible bounds-modifier
add unittest for the above change
git-svn-id: http://skia.googlecode.com/svn/trunk@2722 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index cd835ac..13ca462 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1313,7 +1313,7 @@
const SkPaint* paint) {
SkDEBUGCODE(bitmap.validate();)
- if (NULL == paint || (paint->getMaskFilter() == NULL)) {
+ if (NULL == paint || paint->canComputeFastBounds()) {
SkRect fastBounds;
fastBounds.set(x, y,
x + SkIntToScalar(bitmap.width()),
@@ -1336,10 +1336,12 @@
}
// do this now, to avoid the cost of calling extract for RLE bitmaps
- if (this->quickReject(dst, paint2EdgeType(paint))) {
- return;
+ if (NULL == paint || paint->canComputeFastBounds()) {
+ if (this->quickReject(dst, paint2EdgeType(paint))) {
+ return;
+ }
}
-
+
const SkBitmap* bitmapPtr = &bitmap;
SkMatrix matrix;
@@ -1403,6 +1405,12 @@
void SkCanvas::internalDrawBitmapNine(const SkBitmap& bitmap,
const SkIRect& center, const SkRect& dst,
const SkPaint* paint) {
+ if (NULL == paint || paint->canComputeFastBounds()) {
+ if (this->quickReject(dst, paint2EdgeType(paint))) {
+ return;
+ }
+ }
+
const int32_t w = bitmap.width();
const int32_t h = bitmap.height();