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

Unified Diff: sky/sdk/lib/rendering/box.dart

Issue 1206373002: Implement ClipRRect (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
Index: sky/sdk/lib/rendering/box.dart
diff --git a/sky/sdk/lib/rendering/box.dart b/sky/sdk/lib/rendering/box.dart
index 36d700aee1fdbfdd35f625c4cb84e58403955d24..13394da5d5fb80525dd52e36fdf069c7e89a844f 100644
--- a/sky/sdk/lib/rendering/box.dart
+++ b/sky/sdk/lib/rendering/box.dart
@@ -556,6 +556,26 @@ class RenderClipRect extends RenderProxyBox {
}
}
+class RenderClipRRect extends RenderProxyBox {
+ final double xRad;
+ final double yRad;
abarth-chromium 2015/06/25 17:11:21 xRadius and yRadius Please use complete words in
Hixie 2015/06/25 17:16:58 also, constructors first. fields second or with th
+ RenderClipRRect({ RenderBox child, this.xRad, this.yRad }) : super(child) {
+ assert(xRad != null);
+ assert(yRad != null);
+ }
+
+ void paint(RenderCanvas canvas) {
+ if (child != null) {
+ Rect rect = new Rect.fromSize(size);
+ canvas.saveLayer(rect, new Paint());
+ sky.RRect rrect = new sky.RRect()..setRectXY(rect, xRad, yRad);
Hixie 2015/06/25 17:16:59 Doesn't RRect() have a suitable constructor? Inde
+ canvas.clipRRect(rrect);
Hixie 2015/06/25 17:16:59 What's the anti-aliasing story here? (ok, trick q
+ child.paint(canvas);
+ canvas.restore();
+ }
+ }
+}
+
class RenderClipOval extends RenderProxyBox {
RenderClipOval({ RenderBox child }) : super(child);

Powered by Google App Engine
This is Rietveld 408576698