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

Unified Diff: src/core/SkPictureRecorder.cpp

Issue 736583004: allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use new roundOut Created 6 years, 1 month 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
Index: src/core/SkPictureRecorder.cpp
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index bc8bffb9b3616938cbee589b7ea370c5e39be066..aea9e389da14b2a4993a54b5609da4f69443fd90 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -18,20 +18,19 @@ SkPictureRecorder::SkPictureRecorder() {}
SkPictureRecorder::~SkPictureRecorder() {}
-SkCanvas* SkPictureRecorder::beginRecording(SkScalar width, SkScalar height,
+SkCanvas* SkPictureRecorder::beginRecording(const SkRect& cullRect,
SkBBHFactory* bbhFactory /* = NULL */,
uint32_t recordFlags /* = 0 */) {
+ fCullRect = cullRect;
fFlags = recordFlags;
- fCullWidth = width;
- fCullHeight = height;
if (bbhFactory) {
- fBBH.reset((*bbhFactory)(width, height));
+ fBBH.reset((*bbhFactory)(cullRect));
SkASSERT(fBBH.get());
}
fRecord.reset(SkNEW(SkRecord));
- fRecorder.reset(SkNEW_ARGS(SkRecorder, (fRecord.get(), width, height)));
+ fRecorder.reset(SkNEW_ARGS(SkRecorder, (fRecord.get(), cullRect)));
return this->getRecordingCanvas();
}
@@ -52,12 +51,10 @@ SkPicture* SkPictureRecorder::endRecording() {
}
if (fBBH.get()) {
- SkRect cullRect = SkRect::MakeWH(fCullWidth, fCullHeight);
-
if (saveLayerData) {
- SkRecordComputeLayers(cullRect, *fRecord, fBBH.get(), saveLayerData);
+ SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData);
} else {
- SkRecordFillBounds(cullRect, *fRecord, fBBH.get());
+ SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
}
}
@@ -65,7 +62,7 @@ SkPicture* SkPictureRecorder::endRecording() {
SkBBHFactory* factory = NULL;
uint32_t recordFlags = 0;
SkAutoDataUnref drawablePicts(fRecorder->newDrawableSnapshot(factory, recordFlags));
- SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, fRecord.detach(),
+ SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(),
drawablePicts, fBBH.get()));
if (saveLayerData) {

Powered by Google App Engine
This is Rietveld 408576698