diff options
author | reed <reed@google.com> | 2014-11-19 07:17:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-19 07:17:17 -0800 |
commit | 7c4cdd2c5b7b6c71fa0e7612594f7885f2dbf264 (patch) | |
tree | 06ea08866680ce7abe2fdc7cdca0eb0321684ace /src/core/SkPictureRecorder.cpp | |
parent | 7e76bff26e7c74902841ca4f607eb0b24a833a4a (diff) |
Revert of allow pictures to have a full bounds (patchset #3 id:40001 of https://codereview.chromium.org/736583004/)
Reason for revert:
needed to update legacy width() helpers
Original issue's description:
> allow pictures to have a full bounds
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7e76bff26e7c74902841ca4f607eb0b24a833a4a
TBR=fmalita@google.com,mtklein@google.com,robertphillips@google.com,fmalita@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/722043005
Diffstat (limited to 'src/core/SkPictureRecorder.cpp')
-rw-r--r-- | src/core/SkPictureRecorder.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp index aea9e389da..bc8bffb9b3 100644 --- a/src/core/SkPictureRecorder.cpp +++ b/src/core/SkPictureRecorder.cpp @@ -18,19 +18,20 @@ SkPictureRecorder::SkPictureRecorder() {} SkPictureRecorder::~SkPictureRecorder() {} -SkCanvas* SkPictureRecorder::beginRecording(const SkRect& cullRect, +SkCanvas* SkPictureRecorder::beginRecording(SkScalar width, SkScalar height, SkBBHFactory* bbhFactory /* = NULL */, uint32_t recordFlags /* = 0 */) { - fCullRect = cullRect; fFlags = recordFlags; + fCullWidth = width; + fCullHeight = height; if (bbhFactory) { - fBBH.reset((*bbhFactory)(cullRect)); + fBBH.reset((*bbhFactory)(width, height)); SkASSERT(fBBH.get()); } fRecord.reset(SkNEW(SkRecord)); - fRecorder.reset(SkNEW_ARGS(SkRecorder, (fRecord.get(), cullRect))); + fRecorder.reset(SkNEW_ARGS(SkRecorder, (fRecord.get(), width, height))); return this->getRecordingCanvas(); } @@ -51,10 +52,12 @@ SkPicture* SkPictureRecorder::endRecording() { } if (fBBH.get()) { + SkRect cullRect = SkRect::MakeWH(fCullWidth, fCullHeight); + if (saveLayerData) { - SkRecordComputeLayers(fCullRect, *fRecord, fBBH.get(), saveLayerData); + SkRecordComputeLayers(cullRect, *fRecord, fBBH.get(), saveLayerData); } else { - SkRecordFillBounds(fCullRect, *fRecord, fBBH.get()); + SkRecordFillBounds(cullRect, *fRecord, fBBH.get()); } } @@ -62,7 +65,7 @@ SkPicture* SkPictureRecorder::endRecording() { SkBBHFactory* factory = NULL; uint32_t recordFlags = 0; SkAutoDataUnref drawablePicts(fRecorder->newDrawableSnapshot(factory, recordFlags)); - SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullRect, fRecord.detach(), + SkPicture* pict = SkNEW_ARGS(SkPicture, (fCullWidth, fCullHeight, fRecord.detach(), drawablePicts, fBBH.get())); if (saveLayerData) { |