aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CanvasTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-10 10:49:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-10 16:29:32 +0000
commit566e53c7003920ff45c72498754060804b657c68 (patch)
tree01d1f0c6e65010b16f99b140eda9e724e4c8cae6 /tests/CanvasTest.cpp
parent8da9e940721168143d6296f578b6d7423de55d69 (diff)
re-guard against negative dimensions on no-draw canvas
We used to (incidentally) guard for this when we used bitmapdevice as our backnig. Now that we have a (faster) nodrawdevice, we need to explicitly guard for it. BUG=skia: Change-Id: I9cbbf064cbfced78f0004a2e5aff60aa3ded6215 Reviewed-on: https://skia-review.googlesource.com/9530 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/CanvasTest.cpp')
-rw-r--r--tests/CanvasTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index e84b7ba374..c35e7b0522 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -93,6 +93,12 @@ DEF_TEST(canvas_clipbounds, reporter) {
REPORTER_ASSERT(reporter, rect == SkRect::MakeEmpty());
REPORTER_ASSERT(reporter, !canvas.getLocalClipBounds(&rect2));
REPORTER_ASSERT(reporter, rect == rect2);
+
+ // Test for wacky sizes that we (historically) have guarded against
+ {
+ SkCanvas c(-10, -20);
+ REPORTER_ASSERT(reporter, c.getBaseLayerSize() == SkISize::MakeEmpty());
+ }
}
static const int kWidth = 2, kHeight = 2;