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

Unified Diff: src/core/SkBBoxRecord.cpp

Issue 448793004: add drawPicture variant that takes a matrix and paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more dummies so we can land Created 6 years, 4 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/SkBBoxRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBBoxRecord.cpp
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 802eb669bf3effeca9de693b8c14ad9197c74a40..96e650088839025100d2571d2a1d702dbffed170 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -293,10 +293,17 @@ void SkBBoxRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) {
}
}
-void SkBBoxRecord::onDrawPicture(const SkPicture* picture) {
- if (picture->width() > 0 && picture->height() > 0 &&
- this->transformBounds(SkRect::MakeWH(picture->width(), picture->height()), NULL)) {
- this->INHERITED::onDrawPicture(picture);
+void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
+ const SkPaint* paint) {
+ SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()),
+ SkIntToScalar(picture->height()));
+ // todo: wonder if we should allow passing an optional matrix to transformBounds so we don't
+ // end up transforming the rect twice.
+ if (matrix) {
+ matrix->mapRect(&bounds);
+ }
+ if (this->transformBounds(bounds, paint)) {
+ this->INHERITED::onDrawPicture(picture, matrix, paint);
}
}
« no previous file with comments | « src/core/SkBBoxRecord.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698