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

Side by Side Diff: sky/sdk/lib/rendering/paragraph.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 'dart:sky' as sky; 5 import 'dart:sky' as sky;
6 6
7 import 'box.dart'; 7 import 'box.dart';
8 import 'object.dart'; 8 import 'object.dart';
9 import '../painting/text_style.dart'; 9 import '../painting/text_style.dart';
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 void performLayout() { 153 void performLayout() {
154 _layout(constraints); 154 _layout(constraints);
155 sky.Element root = _layoutRoot.rootElement; 155 sky.Element root = _layoutRoot.rootElement;
156 // rootElement.width always expands to fill, use maxContentWidth instead. 156 // rootElement.width always expands to fill, use maxContentWidth instead.
157 size = constraints.constrain(new Size(_applyFloatingPointHack(root.maxConten tWidth), 157 size = constraints.constrain(new Size(_applyFloatingPointHack(root.maxConten tWidth),
158 _applyFloatingPointHack(root.height))) ; 158 _applyFloatingPointHack(root.height))) ;
159 } 159 }
160 160
161 void paint(RenderObjectDisplayList canvas) { 161 void paint(RenderCanvas canvas) {
162 // Ideally we could compute the min/max intrinsic width/height with a 162 // Ideally we could compute the min/max intrinsic width/height with a
163 // non-destructive operation. However, currently, computing these values 163 // non-destructive operation. However, currently, computing these values
164 // will destroy state inside the layout root. If that happens, we need to 164 // will destroy state inside the layout root. If that happens, we need to
165 // get back the correct state by calling _layout again. 165 // get back the correct state by calling _layout again.
166 // 166 //
167 // TODO(abarth): Make computing the min/max intrinsic width/height a 167 // TODO(abarth): Make computing the min/max intrinsic width/height a
168 // non-destructive operation. 168 // non-destructive operation.
169 if (_constraintsForCurrentLayout != constraints && constraints != null) 169 if (_constraintsForCurrentLayout != constraints && constraints != null)
170 _layout(constraints); 170 _layout(constraints);
171 171
172 _layoutRoot.paint(canvas); 172 _layoutRoot.paint(canvas);
173 } 173 }
174 174
175 // we should probably expose a way to do precise (inter-glpyh) hit testing 175 // we should probably expose a way to do precise (inter-glpyh) hit testing
176 176
177 String debugDescribeSettings(String prefix) { 177 String debugDescribeSettings(String prefix) {
178 String result = '${super.debugDescribeSettings(prefix)}'; 178 String result = '${super.debugDescribeSettings(prefix)}';
179 result += '${prefix}inline:\n${inline.toString("$prefix ")}\n'; 179 result += '${prefix}inline:\n${inline.toString("$prefix ")}\n';
180 return result; 180 return result;
181 } 181 }
182 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698