Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1913)

Unified Diff: tests/BlurTest.cpp

Issue 1552303002: Add unit test for crbug.com/570232 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix overlength line Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BlurTest.cpp
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index 556930e6e936c1af0145e011e4274d09e7779f8e..9806611cfbeb9d52f9ededc1651844f70868a739 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
+
///////////////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698