aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecorder.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-04-10 10:07:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-11 01:24:06 +0000
commit5bd984892db1b5a2c3f76d51d8d77499afd853c5 (patch)
tree86ead758c52182bbd5c806d7932ad8983d19f329 /src/core/SkPictureRecorder.cpp
parent6d72ed918d8763e65899183c2d12b06958c791f4 (diff)
remove kReturnNullForEmpty_FinishFlag feature
It's unused, and doesn't appear to be correct, returning nullptr too early when we should return a non-empty SkMiniPicture. The mini-recorder path will return a zero-allocation SkEmptyPicture anyway. Change-Id: I1be538049e731acfc2b0f8b4f30cafee434a91dc Reviewed-on: https://skia-review.googlesource.com/12626 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkPictureRecorder.cpp')
-rw-r--r--src/core/SkPictureRecorder.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index aaf1d0d0de..701df7d44f 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -56,21 +56,12 @@ sk_sp<SkPicture> SkPictureRecorder::finishRecordingAsPicture(uint32_t finishFlag
fRecorder->restoreToCount(1); // If we were missing any restores, add them now.
if (fRecord->count() == 0) {
- if (finishFlags & kReturnNullForEmpty_FinishFlag) {
- return nullptr;
- }
return fMiniRecorder.detachAsPicture(fCullRect);
}
// TODO: delay as much of this work until just before first playback?
SkRecordOptimize(fRecord.get());
- if (fRecord->count() == 0) {
- if (finishFlags & kReturnNullForEmpty_FinishFlag) {
- return nullptr;
- }
- }
-
SkDrawableList* drawableList = fRecorder->getDrawableList();
SkBigPicture::SnapshotArray* pictList =
drawableList ? drawableList->newDrawableSnapshot() : nullptr;
@@ -125,12 +116,6 @@ sk_sp<SkDrawable> SkPictureRecorder::finishRecordingAsDrawable(uint32_t finishFl
SkRecordOptimize(fRecord.get());
- if (fRecord->count() == 0) {
- if (finishFlags & kReturnNullForEmpty_FinishFlag) {
- return nullptr;
- }
- }
-
if (fBBH.get()) {
SkAutoTMalloc<SkRect> bounds(fRecord->count());
SkRecordFillBounds(fCullRect, *fRecord, bounds);