Commit 33ab0ee6 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2504 from Hixie/scene-builder-arg

Drop the argument to SceneBuilder's constructor
parents f3e3b845 a16f07d9
...@@ -69,18 +69,12 @@ ui.Picture paint(ui.Rect paintBounds) { ...@@ -69,18 +69,12 @@ ui.Picture paint(ui.Rect paintBounds) {
ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) { ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
final double devicePixelRatio = ui.window.devicePixelRatio; final double devicePixelRatio = ui.window.devicePixelRatio;
ui.Rect sceneBounds = new ui.Rect.fromLTWH(
0.0,
0.0,
ui.window.size.width * devicePixelRatio,
ui.window.size.height * devicePixelRatio
);
Float64List deviceTransform = new Float64List(16) Float64List deviceTransform = new Float64List(16)
..[0] = devicePixelRatio ..[0] = devicePixelRatio
..[5] = devicePixelRatio ..[5] = devicePixelRatio
..[10] = 1.0 ..[10] = 1.0
..[15] = 1.0; ..[15] = 1.0;
ui.SceneBuilder sceneBuilder = new ui.SceneBuilder(sceneBounds) ui.SceneBuilder sceneBuilder = new ui.SceneBuilder()
..pushTransform(deviceTransform) ..pushTransform(deviceTransform)
..addPicture(ui.Offset.zero, picture) ..addPicture(ui.Offset.zero, picture)
..pop(); ..pop();
......
...@@ -28,7 +28,7 @@ void beginFrame(Duration timeStamp) { ...@@ -28,7 +28,7 @@ void beginFrame(Duration timeStamp) {
)); ));
final ui.Picture picture = recorder.endRecording(); final ui.Picture picture = recorder.endRecording();
final ui.SceneBuilder sceneBuilder = new ui.SceneBuilder(physicalBounds) final ui.SceneBuilder sceneBuilder = new ui.SceneBuilder()
// TODO(abarth): We should be able to add a picture without pushing a // TODO(abarth): We should be able to add a picture without pushing a
// container layer first. // container layer first.
..pushClipRect(physicalBounds) ..pushClipRect(physicalBounds)
......
...@@ -36,18 +36,12 @@ void beginFrame(Duration timeStamp) { ...@@ -36,18 +36,12 @@ void beginFrame(Duration timeStamp) {
// COMPOSITE // COMPOSITE
final double devicePixelRatio = ui.window.devicePixelRatio; final double devicePixelRatio = ui.window.devicePixelRatio;
ui.Rect sceneBounds = new ui.Rect.fromLTWH(
0.0,
0.0,
ui.window.size.width * devicePixelRatio,
ui.window.size.height * devicePixelRatio
);
Float64List deviceTransform = new Float64List(16) Float64List deviceTransform = new Float64List(16)
..[0] = devicePixelRatio ..[0] = devicePixelRatio
..[5] = devicePixelRatio ..[5] = devicePixelRatio
..[10] = 1.0 ..[10] = 1.0
..[15] = 1.0; ..[15] = 1.0;
ui.SceneBuilder sceneBuilder = new ui.SceneBuilder(sceneBounds) ui.SceneBuilder sceneBuilder = new ui.SceneBuilder()
..pushTransform(deviceTransform) ..pushTransform(deviceTransform)
..addPicture(ui.Offset.zero, picture) ..addPicture(ui.Offset.zero, picture)
..pop(); ..pop();
......
...@@ -28,18 +28,12 @@ ui.Picture paint(ui.Rect paintBounds) { ...@@ -28,18 +28,12 @@ ui.Picture paint(ui.Rect paintBounds) {
ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) { ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
final double devicePixelRatio = ui.window.devicePixelRatio; final double devicePixelRatio = ui.window.devicePixelRatio;
ui.Rect sceneBounds = new ui.Rect.fromLTWH(
0.0,
0.0,
ui.window.size.width * devicePixelRatio,
ui.window.size.height * devicePixelRatio
);
Float64List deviceTransform = new Float64List(16) Float64List deviceTransform = new Float64List(16)
..[0] = devicePixelRatio ..[0] = devicePixelRatio
..[5] = devicePixelRatio ..[5] = devicePixelRatio
..[10] = 1.0 ..[10] = 1.0
..[15] = 1.0; ..[15] = 1.0;
ui.SceneBuilder sceneBuilder = new ui.SceneBuilder(sceneBounds) ui.SceneBuilder sceneBuilder = new ui.SceneBuilder()
..pushTransform(deviceTransform) ..pushTransform(deviceTransform)
..addPicture(ui.Offset.zero, picture) ..addPicture(ui.Offset.zero, picture)
..pop(); ..pop();
......
...@@ -48,12 +48,6 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) { ...@@ -48,12 +48,6 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
// pixels, which are then scalled by the device pixel ratio before being drawn // pixels, which are then scalled by the device pixel ratio before being drawn
// on the screen. // on the screen.
final double devicePixelRatio = ui.window.devicePixelRatio; final double devicePixelRatio = ui.window.devicePixelRatio;
ui.Rect sceneBounds = new ui.Rect.fromLTWH(
0.0,
0.0,
ui.window.size.width * devicePixelRatio,
ui.window.size.height * devicePixelRatio
);
// This transform scales the x and y coordinates by the devicePixelRatio. // This transform scales the x and y coordinates by the devicePixelRatio.
Float64List deviceTransform = new Float64List(16) Float64List deviceTransform = new Float64List(16)
...@@ -66,7 +60,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) { ...@@ -66,7 +60,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
// transform that scale its children by the device pixel ratio. This transform // transform that scale its children by the device pixel ratio. This transform
// lets us paint in "logical" pixels which are converted to device pixels by // lets us paint in "logical" pixels which are converted to device pixels by
// this scaling operation. // this scaling operation.
ui.SceneBuilder sceneBuilder = new ui.SceneBuilder(sceneBounds) ui.SceneBuilder sceneBuilder = new ui.SceneBuilder()
..pushTransform(deviceTransform) ..pushTransform(deviceTransform)
..addPicture(ui.Offset.zero, picture) ..addPicture(ui.Offset.zero, picture)
..pop(); ..pop();
......
...@@ -122,8 +122,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox> ...@@ -122,8 +122,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
try { try {
final TransformLayer transformLayer = layer; final TransformLayer transformLayer = layer;
transformLayer.transform = _logicalToDeviceTransform; transformLayer.transform = _logicalToDeviceTransform;
Rect bounds = Point.origin & (size * ui.window.devicePixelRatio); ui.SceneBuilder builder = new ui.SceneBuilder();
ui.SceneBuilder builder = new ui.SceneBuilder(bounds);
transformLayer.addToScene(builder, Offset.zero); transformLayer.addToScene(builder, Offset.zero);
assert(layer == transformLayer); assert(layer == transformLayer);
ui.Scene scene = builder.build(); ui.Scene scene = builder.build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment