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

Unified Diff: sky/examples/raw/spinning_square.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/spinning_square.dart
diff --git a/sky/examples/raw/spinning_square.dart b/sky/examples/raw/spinning_square.dart
index 24c3191f51f57ef787b45d0a20604368b4a03cc2..98325251b491d4f0fd222e66fecd0934ae70d365 100644
--- a/sky/examples/raw/spinning_square.dart
+++ b/sky/examples/raw/spinning_square.dart
@@ -12,12 +12,13 @@ void beginFrame(double timeStamp) {
if (timeBase == null)
timeBase = timeStamp;
double delta = timeStamp - timeBase;
- PictureRecorder canvas = new PictureRecorder(view.width, view.height);
+ PictureRecorder recorder = new PictureRecorder();
+ Canvas canvas = new Canvas(recorder, view.width, view.height);
canvas.translate(view.width / 2.0, view.height / 2.0);
canvas.rotate(math.PI * delta / 1800);
canvas.drawRect(new Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
new Paint()..color = const Color.fromARGB(255, 0, 255, 0));
- view.picture = canvas.endRecording();
+ view.picture = recorder.endRecording();
view.scheduleFrame();
tracing.end('beginFrame');
}

Powered by Google App Engine
This is Rietveld 408576698