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

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

Issue 1134913003: Teach SkyView path to draw a circle (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 | « sky/engine/public/sky/sky_view_client.cc ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/hello_world.dart
diff --git a/sky/examples/raw/hello_world.dart b/sky/examples/raw/hello_world.dart
index cbf03f07841d22f07a6e6b99d25f11bd85e5de7c..52cfc50c4f3d719f980a037dc1f12ab03c2e53f4 100644
--- a/sky/examples/raw/hello_world.dart
+++ b/sky/examples/raw/hello_world.dart
@@ -2,6 +2,25 @@
// 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';
+
void main() {
- print("Hello, world");
+ print("Hello, world");
+
+ double width = 500.0;
+ double height = 500.0;
+
+ PictureRecorder recorder = new PictureRecorder(width, height);
+ double radius = min(width, height) * 0.45;
+
+ Paint paint = new Paint()..setARGB(255, 0, 255, 0);
+
+ recorder.drawCircle(width / 2, height / 2, radius, paint);
+
+ print("Storing picture");
+ view.picture = recorder.endRecording();
+
+ print("Scheduling paint");
+ view.schedulePaint();
}
« no previous file with comments | « sky/engine/public/sky/sky_view_client.cc ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698