diff options
author | Eric Karl <ericrk@chromium.org> | 2017-04-04 13:42:10 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-04 22:51:53 +0000 |
commit | 72e551e637c5f3047a963f9c5bd873d7f04f8b5a (patch) | |
tree | 9494639fd4fc61754ac2eb977cde7df2cd67994d /tests/BlendTest.cpp | |
parent | fc0e96e35f4d63b10a753ef4a7538d653592f976 (diff) |
Support Canvas Clip on Blit Framebuffer
The previous fix to blit framebuffer didn't take cases where
the canvas had a clip applied into account. Fix and update
the unit test to add this case.
Bug: 658277
Change-Id: If3a9d2c8ddf955164cf529c9d6036618f957e426
Reviewed-on: https://skia-review.googlesource.com/11300
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/BlendTest.cpp')
-rw-r--r-- | tests/BlendTest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp index 2a96f860c6..193c37dd4a 100644 --- a/tests/BlendTest.cpp +++ b/tests/BlendTest.cpp @@ -123,19 +123,22 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo) SkIPoint inPoint; } allRectsAndPoints[3] = { {SkRect::MakeXYWH(0, 0, 5, 5), SkIPoint::Make(7, 7), SkIPoint::Make(2, 2)}, - {SkRect::MakeXYWH(2, 2, 5, 5), SkIPoint::Make(0, 0), SkIPoint::Make(4, 4)}, + {SkRect::MakeXYWH(2, 2, 5, 5), SkIPoint::Make(1, 1), SkIPoint::Make(4, 4)}, {SkRect::MakeXYWH(5, 5, 5, 5), SkIPoint::Make(2, 2), SkIPoint::Make(7, 7)}, }; struct TestCase { RectAndSamplePoint rectAndPoints; + SkRect clip; int sampleCnt; }; std::vector<TestCase> testCases; for (int sampleCnt : {0, 4}) { for (auto rectAndPoints : allRectsAndPoints) { - testCases.push_back({rectAndPoints, sampleCnt}); + for (auto clip : {SkRect::MakeXYWH(0, 0, 10, 10), SkRect::MakeXYWH(1, 1, 8, 8)}) { + testCases.push_back({rectAndPoints, clip, sampleCnt}); + } } } @@ -159,6 +162,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo) // Fill our canvas with 0xFFFF80 SkCanvas* canvas = surface->getCanvas(); + canvas->clipRect(testCase.clip, false); SkPaint black_paint; black_paint.setColor(SkColorSetRGB(0xFF, 0xFF, 0x80)); canvas->drawRect(SkRect::MakeXYWH(0, 0, kWidth, kHeight), black_paint); |