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

Unified Diff: sky/tests/resources/display_list.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/tests/resources/display_list.dart
diff --git a/sky/tests/resources/display_list.dart b/sky/tests/resources/display_list.dart
index a83f34d0aa9878ed6cdda5111169934f4510891c..7c62fa1da2d1fd53be5221bc1b1e7127dcab4726 100644
--- a/sky/tests/resources/display_list.dart
+++ b/sky/tests/resources/display_list.dart
@@ -2,6 +2,7 @@
import 'dart:async';
import 'dart:sky' as sky;
import "dart:sky.internals" as internals;
+import 'dart:typed_data';
import 'package:sky/widgets/basic.dart';
import 'package:sky/rendering/box.dart';
@@ -9,12 +10,12 @@ import 'package:sky/rendering/object.dart';
typedef void Logger (String s);
-class TestDisplayList extends RenderObjectDisplayList {
- TestDisplayList(double width, double height, this.logger, { this.indent: '' }) :
- this.width = width,
- this.height = height,
- super(width, height) {
- log("TestDisplayList() constructor: $width x $height");
+class TestRenderCanvas extends RenderCanvas {
+ TestRenderCanvas(sky.PictureRecorder recorder, double width, double height, this.logger, { this.indent: '' })
+ : width = width,
+ height = height,
+ super(recorder, width, height) {
+ log("TestRenderCanvas() constructor: $width x $height");
}
final String indent;
@@ -54,8 +55,8 @@ class TestDisplayList extends RenderObjectDisplayList {
log("skew($sx, $sy)");
}
- void concat(List<double> matrix9) {
- log("concat($matrix9)");
+ void concat(Float32List matrix4) {
+ log("concat($matrix4)");
}
void clipRect(Rect rect) {
@@ -108,7 +109,7 @@ class TestDisplayList extends RenderObjectDisplayList {
void paintChild(RenderObject child, Point position) {
log("paintChild ${child.runtimeType} at $position");
- child.paint(new TestDisplayList(width, height, logger, indent: "$indent |"));
+ child.paint(new TestRenderCanvas(new sky.PictureRecorder(), width, height, logger, indent: "$indent |"));
}
}
@@ -134,8 +135,10 @@ class TestRenderView extends RenderView {
frame += 1;
lastPaint = '';
log("PAINT FOR FRAME #${frame} ----------------------------------------------");
- var canvas = new TestDisplayList(rootConstraints.width, rootConstraints.height, log, indent: "${frame} |");
+ var recorder = new sky.PictureRecorder();
+ var canvas = new TestRenderCanvas(recorder, rootConstraints.width, rootConstraints.height, log, indent: "${frame} |");
paint(canvas);
+ recorder.endRecording();
log("------------------------------------------------------------------------");
RenderObject.debugDoingPaint = false;
}

Powered by Google App Engine
This is Rietveld 408576698