diff options
author | mtklein <mtklein@chromium.org> | 2014-11-20 08:58:02 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-20 08:58:02 -0800 |
commit | 378e70d8e561b72a904286ea231946f5c8345b9a (patch) | |
tree | 99bbb82eba56fd298e8bb9c9d7b562dd69308dbc /tests | |
parent | 072803144a623f1a59eb73ca5f3ddf45222b5e06 (diff) |
SkCanvas::clear() should call down to devices even when the clip is empty.
SkDrawIter had a lovely, completely unused, option for this. Oversight?
BUG=skia:
Review URL: https://codereview.chromium.org/735233003
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CanvasTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 5437d5b2da..58be9dadb2 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -795,3 +795,17 @@ DEF_TEST(Canvas, reporter) { test_newraster(reporter); } + +// Make sure SkCanvas passes clear() calls down to its devices even when they're clipped out. +DEF_TEST(Canvas_clear, reporter) { + SkBitmap bm; + bm.allocN32Pixels(1,1); + + SkCanvas canvas(bm); + canvas.clear(SK_ColorRED); + REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(0,0)); + + canvas.clipRect(SkRect::MakeEmpty()); + canvas.clear(SK_ColorGREEN); + REPORTER_ASSERT(reporter, SK_ColorGREEN == bm.getColor(0,0)); +} |