aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkPictureRecorder.cpp6
-rw-r--r--tests/CanvasTest.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index 0c81632eb8..aaf1d0d0de 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -18,14 +18,16 @@
SkPictureRecorder::SkPictureRecorder() {
fActivelyRecording = false;
- fRecorder.reset(new SkRecorder(nullptr, SkRect::MakeWH(0, 0), &fMiniRecorder));
+ fRecorder.reset(new SkRecorder(nullptr, SkRect::MakeEmpty(), &fMiniRecorder));
}
SkPictureRecorder::~SkPictureRecorder() {}
-SkCanvas* SkPictureRecorder::beginRecording(const SkRect& cullRect,
+SkCanvas* SkPictureRecorder::beginRecording(const SkRect& userCullRect,
SkBBHFactory* bbhFactory /* = nullptr */,
uint32_t recordFlags /* = 0 */) {
+ const SkRect cullRect = userCullRect.isEmpty() ? SkRect::MakeEmpty() : userCullRect;
+
fCullRect = cullRect;
fFlags = recordFlags;
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index c35e7b0522..f6b275fccc 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -98,6 +98,8 @@ DEF_TEST(canvas_clipbounds, reporter) {
{
SkCanvas c(-10, -20);
REPORTER_ASSERT(reporter, c.getBaseLayerSize() == SkISize::MakeEmpty());
+
+ SkPictureRecorder().beginRecording({ 5, 5, 4, 4 });
}
}