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

Unified Diff: sky/examples/display_list/full_screen_circle.dart

Issue 1122423009: Make it possible to custom-paint without an Element. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Comment tweak 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
Index: sky/examples/display_list/full_screen_circle.dart
diff --git a/sky/examples/display_list/full_screen_circle.dart b/sky/examples/display_list/full_screen_circle.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c1c3e9275ab09231982350f6b8971973ff274ebd
--- /dev/null
+++ b/sky/examples/display_list/full_screen_circle.dart
@@ -0,0 +1,16 @@
+import "dart:sky";
+import "dart:math";
+
+void doIt() {
+ double width = window.innerWidth.toDouble();
+ double height = window.innerHeight.toDouble();
+
+ 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);
+
+ document.rootPicture = recorder.endRecording();
+}

Powered by Google App Engine
This is Rietveld 408576698