diff options
author | robertphillips <robertphillips@google.com> | 2016-01-04 11:20:25 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-04 11:20:25 -0800 |
commit | 4abb0c11da669a40d126c6b7698e37732e052d84 (patch) | |
tree | 05834199161c9a8d15b7cf9eea89b840e9f2301d /tests/BlurTest.cpp | |
parent | 50850b152fce606f2015facf287f04224e647a9c (diff) |
Add unit test for crbug.com/570232
This is the promised followup to https://codereview.chromium.org/1539553002/ (Add default ctor to SkMask) and would've caught the bug before it got out into the wild.
BUG=570232
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1552303002
Review URL: https://codereview.chromium.org/1552303002
Diffstat (limited to 'tests/BlurTest.cpp')
-rw-r--r-- | tests/BlurTest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index 556930e6e9..9806611cfb 100644 --- a/tests/BlurTest.cpp +++ b/tests/BlurTest.cpp @@ -558,4 +558,25 @@ DEF_TEST(BlurAsABlur, reporter) { } } +#if SK_SUPPORT_GPU + +// This exercises the problem discovered in crbug.com/570232. The return value from +// SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlurEffect::Create +DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctx) { + + SkImageInfo info = SkImageInfo::MakeN32Premul(128, 128); + SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkSurface::kNo_Budgeted, info)); + SkCanvas* canvas = surface->getCanvas(); + + SkRect r = SkRect::MakeXYWH(10, 10, 100, 100); + SkRRect rr = SkRRect::MakeRectXY(r, 10, 10); + + SkPaint p; + p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 0.01f))->unref(); + + canvas->drawRRect(rr, p); +} + +#endif + /////////////////////////////////////////////////////////////////////////////////////////// |