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) { |