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

Unified Diff: sky/examples/raw/simple_render_tree.dart

Issue 1144193004: Add a simple_render_tree example (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | sky/sdk/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/simple_render_tree.dart
diff --git a/sky/examples/raw/simple_render_tree.dart b/sky/examples/raw/simple_render_tree.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f5ae7e7dc0e52f106ec8a1c8cafc68ef4efb3371
--- /dev/null
+++ b/sky/examples/raw/simple_render_tree.dart
@@ -0,0 +1,21 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'dart:math';
+import 'dart:sky';
+import 'package:sky/framework/layout2.dart';
+
+class RenderBlueCircle extends RenderBox {
+ void paint(RenderNodeDisplayList canvas) {
+ double radius = min(width, height) * 0.45;
+ Paint paint = new Paint()..setARGB(255, 0, 255, 255);
+ canvas.drawCircle(width / 2, height / 2, radius, paint);
+ }
+}
+
+void main() {
+ RenderView renderView = new RenderView(root: new RenderBlueCircle());
+ renderView.layout(newWidth: view.width, newHeight: view.height);
+ renderView.paintFrame();
+}
« no previous file with comments | « no previous file | sky/sdk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698