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

Side by Side Diff: sky/sdk/lib/widgets/scaffold.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import '../rendering/box.dart'; 5 import '../rendering/box.dart';
6 import '../rendering/object.dart'; 6 import '../rendering/object.dart';
7 import '../theme/view_configuration.dart'; 7 import '../theme/view_configuration.dart';
8 import 'widget.dart'; 8 import 'widget.dart';
9 9
10 enum ScaffoldSlots { 10 enum ScaffoldSlots {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 if (_slots[ScaffoldSlots.floatingActionButton] != null) { 118 if (_slots[ScaffoldSlots.floatingActionButton] != null) {
119 RenderBox floatingActionButton = _slots[ScaffoldSlots.floatingActionButton ]; 119 RenderBox floatingActionButton = _slots[ScaffoldSlots.floatingActionButton ];
120 Size area = new Size(size.width - kButtonX, size.height - kButtonY); 120 Size area = new Size(size.width - kButtonX, size.height - kButtonY);
121 floatingActionButton.layout(new BoxConstraints.loose(area)); 121 floatingActionButton.layout(new BoxConstraints.loose(area));
122 assert(floatingActionButton.parentData is BoxParentData); 122 assert(floatingActionButton.parentData is BoxParentData);
123 floatingActionButton.parentData.position = (area - floatingActionButton.si ze).toPoint(); 123 floatingActionButton.parentData.position = (area - floatingActionButton.si ze).toPoint();
124 } 124 }
125 } 125 }
126 126
127 void paint(RenderObjectDisplayList canvas) { 127 void paint(RenderCanvas canvas) {
128 for (ScaffoldSlots slot in [ScaffoldSlots.body, ScaffoldSlots.statusBar, Sca ffoldSlots.toolbar, ScaffoldSlots.floatingActionButton, ScaffoldSlots.drawer]) { 128 for (ScaffoldSlots slot in [ScaffoldSlots.body, ScaffoldSlots.statusBar, Sca ffoldSlots.toolbar, ScaffoldSlots.floatingActionButton, ScaffoldSlots.drawer]) {
129 RenderBox box = _slots[slot]; 129 RenderBox box = _slots[slot];
130 if (box != null) { 130 if (box != null) {
131 assert(box.parentData is BoxParentData); 131 assert(box.parentData is BoxParentData);
132 canvas.paintChild(box, box.parentData.position); 132 canvas.paintChild(box, box.parentData.position);
133 } 133 }
134 } 134 }
135 } 135 }
136 136
137 void hitTestChildren(HitTestResult result, { Point position }) { 137 void hitTestChildren(HitTestResult result, { Point position }) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void syncRenderObject(Widget old) { 214 void syncRenderObject(Widget old) {
215 super.syncRenderObject(old); 215 super.syncRenderObject(old);
216 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo ldSlots.toolbar); 216 _toolbar = syncChild(_toolbar, old is Scaffold ? old._toolbar : null, Scaffo ldSlots.toolbar);
217 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b ody); 217 _body = syncChild(_body, old is Scaffold ? old._body : null, ScaffoldSlots.b ody);
218 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null, ScaffoldSlots.statusBar); 218 _statusBar = syncChild(_statusBar, old is Scaffold ? old._statusBar : null, ScaffoldSlots.statusBar);
219 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS lots.drawer); 219 _drawer = syncChild(_drawer, old is Scaffold ? old._drawer : null, ScaffoldS lots.drawer);
220 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton); 220 _floatingActionButton = syncChild(_floatingActionButton, old is Scaffold ? o ld._floatingActionButton : null, ScaffoldSlots.floatingActionButton);
221 } 221 }
222 222
223 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698