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

Unified Diff: sky/sdk/lib/rendering/box.dart

Issue 1195113002: Improve stocks2 performance (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « sky/sdk/lib/rendering/block.dart ('k') | sky/sdk/lib/rendering/object.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/rendering/box.dart
diff --git a/sky/sdk/lib/rendering/box.dart b/sky/sdk/lib/rendering/box.dart
index b72fef482a3962f49bf1f67abca83a971020e514..bd71c167823c3059fc7e0ea2990ee9ed004fb9a2 100644
--- a/sky/sdk/lib/rendering/box.dart
+++ b/sky/sdk/lib/rendering/box.dart
@@ -42,10 +42,15 @@ class EdgeDims {
final double bottom;
final double left;
- operator ==(EdgeDims other) => (top == other.top) ||
- (right == other.right) ||
- (bottom == other.bottom) ||
- (left == other.left);
+ bool operator ==(other) {
+ if (identical(this, other))
+ return true;
+ return other is EdgeDims
+ && top == other.top
+ && right == other.right
+ && bottom == other.bottom
+ && left == other.left;
+ }
int get hashCode {
int value = 373;
@@ -180,6 +185,19 @@ class BoxConstraints {
bool get isInfinite => maxWidth >= double.INFINITY && maxHeight >= double.INFINITY;
+ bool get hasTightWidth => minWidth == maxWidth;
+ bool get hasTightHeight => minHeight == maxHeight;
+ bool get isTight => hasTightWidth && hasTightHeight;
+
+ bool operator ==(other) {
+ if (identical(this, other))
+ return true;
+ return other is BoxConstraints &&
+ minWidth == other.minWidth &&
+ maxWidth == other.maxWidth &&
+ minHeight == other.minHeight &&
+ maxHeight == other.maxHeight;
+ }
int get hashCode {
int value = 373;
value = 37 * value + minWidth.hashCode;
@@ -188,6 +206,7 @@ class BoxConstraints {
value = 37 * value + maxHeight.hashCode;
return value;
}
+
String toString() => "BoxConstraints($minWidth<=w<$maxWidth, $minHeight<=h<$maxHeight)";
}
@@ -1052,11 +1071,16 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
}
void paintFrame() {
+ sky.tracing.begin('RenderView.paintFrame');
RenderObject.debugDoingPaint = true;
- RenderObjectDisplayList canvas = new RenderObjectDisplayList(sky.view.width, sky.view.height);
- paint(canvas);
- sky.view.picture = canvas.endRecording();
- RenderObject.debugDoingPaint = false;
+ try {
+ RenderObjectDisplayList canvas = new RenderObjectDisplayList(sky.view.width, sky.view.height);
+ paint(canvas);
+ sky.view.picture = canvas.endRecording();
+ } finally {
+ RenderObject.debugDoingPaint = false;
+ sky.tracing.end('RenderView.paintFrame');
+ }
}
}
« no previous file with comments | « sky/sdk/lib/rendering/block.dart ('k') | sky/sdk/lib/rendering/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698