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

Unified Diff: gm/blurs.cpp

Issue 791943002: Add GM for 2-rects blur which cannot break into nine-patch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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: gm/blurs.cpp
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index 69c7210d472cf09590807b4f72a44449fb491af7..74189330a3f3be3150ecd5b6cf7ecdeca0a6e2ca 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -133,3 +133,37 @@ public:
}
};
DEF_GM( return new Blur2RectsGM; )
+
+class Blur2RectsNonNinePatchGM : public skiagm::GM {
+public:
+ SkString onShortName() SK_OVERRIDE {
+ return SkString("blur2rectsnonninepatch");
+ }
+
+ SkISize onISize() SK_OVERRIDE {
+ return SkISize::Make(700, 500);
+ }
+
+ void onDraw(SkCanvas* canvas) SK_OVERRIDE {
+ SkPaint paint;
+ paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
+ 4.3f))->unref();
+
+ SkRect outer = SkRect::MakeXYWH(10, 110, 100, 100);
+ SkRect inner = SkRect::MakeXYWH(50, 150, 10, 10);
+ SkPath path;
+ path.addRect(outer, SkPath::kCW_Direction);
+ path.addRect(inner, SkPath::kCW_Direction);
+ canvas->drawPath(path, paint);
+
+ SkScalar dx = SkScalarRoundToScalar(path.getBounds().width()) + 40 + 0.25f;
+ canvas->translate(dx, 0);
+ canvas->drawPath(path, paint);
+
+ // Translate to outside of clip bounds.
+ canvas->translate(-dx, 0);
+ canvas->translate(-30, -150);
+ canvas->drawPath(path, paint);
+ }
+};
+DEF_GM( return new Blur2RectsNonNinePatchGM; )
« 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