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

Unified Diff: gm/blurroundrect.cpp

Issue 248613004: Fast path for blurred round rects -- blur a small 9patch rect on the CPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: merge fully with Mike's new reorg" Created 6 years, 8 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 | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkBlurMask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurroundrect.cpp
diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp
index 15f3efc4a43aa14ba928955deaf1f5bf94bdc027..6221480d55e5867ade1c25a23309d040b11f08c3 100644
--- a/gm/blurroundrect.cpp
+++ b/gm/blurroundrect.cpp
@@ -106,30 +106,32 @@ protected:
}
virtual SkISize onISize() SK_OVERRIDE {
- return SkISize::Make(750, 750);
+ return SkISize::Make(950, 950);
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
canvas->scale(1.5f, 1.5f);
+ canvas->translate(50,50);
- const int blurRadii[] = { 1, 3, 6, 10 };
- const int cornerRadii[] = { 1, 3, 6, 10 };
+ const float blurRadii[] = { 1,5,10,20 };
+ const int cornerRadii[] = { 1,5,10,20 };
const SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
for (size_t i = 0; i < SK_ARRAY_COUNT(blurRadii); ++i) {
SkAutoCanvasRestore autoRestore(canvas, true);
- canvas->translate(0, (r.height() + SkIntToScalar(20)) * i);
+ canvas->translate(0, (r.height() + SkIntToScalar(50)) * i);
for (size_t j = 0; j < SK_ARRAY_COUNT(cornerRadii); ++j) {
SkMaskFilter* filter = SkBlurMaskFilter::Create(
kNormal_SkBlurStyle,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(blurRadii[i])));
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(blurRadii[i])),
+ SkBlurMaskFilter::kHighQuality_BlurFlag);
SkPaint paint;
- paint.setColor(SK_ColorBLUE);
+ paint.setColor(SK_ColorBLACK);
paint.setMaskFilter(filter)->unref();
SkRRect rrect;
rrect.setRectXY(r, SkIntToScalar(cornerRadii[j]), SkIntToScalar(cornerRadii[j]));
canvas->drawRRect(rrect, paint);
- canvas->translate(r.width() + SkIntToScalar(10), 0);
+ canvas->translate(r.width() + SkIntToScalar(50), 0);
}
}
}
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/effects/SkBlurMask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698