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

Unified Diff: sky/sdk/lib/rendering/object.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: Rework the API a bit 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/sdk/lib/rendering/object.dart
diff --git a/sky/sdk/lib/rendering/object.dart b/sky/sdk/lib/rendering/object.dart
index 75edf32f4e3cf35634087c08f7a112f0563eeeff..4e9b64b17e975f332b2f7c1a9c711e5432dad7c9 100644
--- a/sky/sdk/lib/rendering/object.dart
+++ b/sky/sdk/lib/rendering/object.dart
@@ -26,10 +26,18 @@ class ParentData {
String toString() => '<none>';
}
-const kLayoutDirections = 4;
+class RenderPictureRecorder extends sky.PictureRecorder {
+ RenderCanvas beginRecording(double width, double height) {
+ sky.Canvas originalCanvas = super.beginRecording(width, height);
+ RenderCanvas realCanvas = new RenderCanvas(originalCanvas);
+ setCanvas(realCanvas);
abarth-chromium 2015/06/20 00:50:29 I see, you're using this to solve the dangling SkC
+ return realCanvas;
+ }
+}
+
+class RenderCanvas extends sky.Canvas {
+ RenderCanvas(sky.Canvas canvas) : super(canvas);
Hixie 2015/06/20 00:44:52 We probably want to avoid making two instances of
abarth-chromium 2015/06/20 00:50:29 I don't understand why we can't just pass a sky.Pi
-class RenderObjectDisplayList extends sky.PictureRecorder {
- RenderObjectDisplayList(double width, double height) : super(width, height);
void paintChild(RenderObject child, Point position) {
translate(position.x, position.y);
child.paint(this);
@@ -214,7 +222,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert(!debugDoingPaint);
scheduler.ensureVisualUpdate();
}
- void paint(RenderObjectDisplayList canvas) { }
+ void paint(RenderCanvas canvas) { }
// EVENTS

Powered by Google App Engine
This is Rietveld 408576698