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

Unified Diff: sky/examples/raw/spinning_arabic.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: j/k -- this one should actually be fully merged and testable 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_arabic.dart
diff --git a/sky/examples/raw/spinning_arabic.dart b/sky/examples/raw/spinning_arabic.dart
index 846aa2a4cb62d7e7295f4498105c7dd820ebc663..3a132c5e0e1f636cb5629d7ddc7c52377b7bcb65 100644
--- a/sky/examples/raw/spinning_arabic.dart
+++ b/sky/examples/raw/spinning_arabic.dart
@@ -5,6 +5,8 @@
import "dart:math" as math;
import 'dart:sky';
+import 'package:sky/rendering/object.dart';
abarth-chromium 2015/06/23 02:28:45 ditto
iansf 2015/06/23 22:46:09 Done.
+
double timeBase = null;
LayoutRoot layoutRoot = new LayoutRoot();
@@ -12,7 +14,8 @@ 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();
+ RenderCanvas canvas = new RenderCanvas(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),
@@ -25,7 +28,7 @@ void beginFrame(double timeStamp) {
canvas.translate(layoutRoot.maxWidth / -2.0, (layoutRoot.maxWidth / 2.0) - 125);
layoutRoot.paint(canvas);
- view.picture = canvas.endRecording();
+ view.picture = recorder.endRecording();
view.scheduleFrame();
}

Powered by Google App Engine
This is Rietveld 408576698