Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 16459b0a0378c965dd39d6ec43e6bac245b4c048..2b08a94c85e603a434d35dece267c3ab96bb0498 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2445,7 +2445,7 @@ void SkCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, |
} |
} |
- SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), picture->height()); |
+ SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); |
picture->draw(this); |
} |
@@ -2549,16 +2549,16 @@ SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_ |
/////////////////////////////////////////////////////////////////////////////// |
SkAutoCanvasMatrixPaint::SkAutoCanvasMatrixPaint(SkCanvas* canvas, const SkMatrix* matrix, |
- const SkPaint* paint, int width, int height) |
+ const SkPaint* paint, const SkRect& bounds) |
: fCanvas(canvas) |
, fSaveCount(canvas->getSaveCount()) |
{ |
if (NULL != paint) { |
- SkRect bounds = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)); |
+ SkRect newBounds = bounds; |
if (matrix) { |
- matrix->mapRect(&bounds); |
+ matrix->mapRect(&newBounds); |
} |
- canvas->saveLayer(&bounds, paint); |
+ canvas->saveLayer(&newBounds, paint); |
} else if (NULL != matrix) { |
canvas->save(); |
} |