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

Unified Diff: sky/sdk/lib/framework/rendering/render_node.dart

Issue 1155043004: Improve RenderNode performance (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/render_node.dart
diff --git a/sky/sdk/lib/framework/rendering/render_node.dart b/sky/sdk/lib/framework/rendering/render_node.dart
index 29863a84ffac30f6160b87342fb8b636d466e716..1d68e356c28da8d78984c40441e16e168f6447e9 100644
--- a/sky/sdk/lib/framework/rendering/render_node.dart
+++ b/sky/sdk/lib/framework/rendering/render_node.dart
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import '../node.dart';
+import 'dart:math' as math;
import 'dart:sky' as sky;
class ParentData {
@@ -22,21 +23,15 @@ double clamp({double min: 0.0, double value: 0.0, double max: double.INFINITY})
assert(min != null);
assert(value != null);
assert(max != null);
-
- if (value > max)
- value = max;
- if (value < min)
- value = min;
- return value;
+ return math.max(min, math.min(max, value));
}
class RenderNodeDisplayList extends sky.PictureRecorder {
RenderNodeDisplayList(double width, double height) : super(width, height);
void paintChild(RenderNode child, sky.Point position) {
- save();
translate(position.x, position.y);
child.paint(this);
- restore();
+ translate(-position.x, -position.y);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698