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

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

Issue 1190123003: Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia co… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebased version of previous patch 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/examples/raw/hello_world.dart
diff --git a/sky/examples/raw/hello_world.dart b/sky/examples/raw/hello_world.dart
index 4264abf8990f0bee5c78ce2d5bad6f70456e9ee3..116ab1015e91330379bcb49645674ebf452d02f5 100644
--- a/sky/examples/raw/hello_world.dart
+++ b/sky/examples/raw/hello_world.dart
@@ -9,11 +9,12 @@ Picture draw(int a, int r, int g, int b) {
double width = view.width;
double height = view.height;
- PictureRecorder recorder = new PictureRecorder(width, height);
+ PictureRecorder recorder = new PictureRecorder();
+ Canvas canvas = new Canvas(recorder, width, height);
double radius = min(width, height) * 0.45;
Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b);
- recorder.drawCircle(width / 2, height / 2, radius, paint);
+ canvas.drawCircle(width / 2, height / 2, radius, paint);
return recorder.endRecording();
}

Powered by Google App Engine
This is Rietveld 408576698