diff options
author | 2017-01-24 09:13:40 -0500 | |
---|---|---|
committer | 2017-01-24 14:51:24 +0000 | |
commit | 6f4a9b294868a94e5b1e06a8e855833614355bcc (patch) | |
tree | 63ee9658f09451469131a0486b9314f2746d9cf8 /tests | |
parent | eb5061baac840e5aa9849985394654b70430fd41 (diff) |
restore bool version of clip-bounds
BUG=skia:
Change-Id: I94e35566cf5bcd250515c71a566dd79030e2acb4
Reviewed-on: https://skia-review.googlesource.com/7430
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CanvasTest.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 6229e849fb..c947ce42ad 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -68,21 +68,31 @@ DEF_TEST(canvas_clipbounds, reporter) { SkCanvas canvas(10, 10); - SkIRect irect; - SkRect rect; + SkIRect irect, irect2; + SkRect rect, rect2; irect = canvas.getDeviceClipBounds(); REPORTER_ASSERT(reporter, irect == SkIRect::MakeWH(10, 10)); + REPORTER_ASSERT(reporter, canvas.getDeviceClipBounds(&irect2)); + REPORTER_ASSERT(reporter, irect == irect2); + // local bounds are always too big today -- can we trim them? rect = canvas.getLocalClipBounds(); REPORTER_ASSERT(reporter, rect.contains(SkRect::MakeWH(10, 10))); + REPORTER_ASSERT(reporter, canvas.getLocalClipBounds(&rect2)); + REPORTER_ASSERT(reporter, rect == rect2); canvas.clipRect(SkRect::MakeEmpty()); irect = canvas.getDeviceClipBounds(); REPORTER_ASSERT(reporter, irect == SkIRect::MakeEmpty()); + REPORTER_ASSERT(reporter, !canvas.getDeviceClipBounds(&irect2)); + REPORTER_ASSERT(reporter, irect == irect2); + rect = canvas.getLocalClipBounds(); REPORTER_ASSERT(reporter, rect == SkRect::MakeEmpty()); + REPORTER_ASSERT(reporter, !canvas.getLocalClipBounds(&rect2)); + REPORTER_ASSERT(reporter, rect == rect2); } static const int kWidth = 2, kHeight = 2; |