Commit 395102d5 authored by Hixie's avatar Hixie

Rename RenderNode to RenderObject.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1165013003
parent e99c880b
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'dart:sky' as sky; import 'dart:sky' as sky;
import 'package:sky/framework/app.dart'; import 'package:sky/framework/app.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/node.dart'; import 'package:sky/framework/rendering/object.dart';
import 'package:sky/framework/animation/animated_value.dart'; import 'package:sky/framework/animation/animated_value.dart';
import 'package:sky/framework/animation/curves.dart'; import 'package:sky/framework/animation/curves.dart';
...@@ -31,7 +31,7 @@ class InkSplash { ...@@ -31,7 +31,7 @@ class InkSplash {
inkWell.markNeedsPaint(); inkWell.markNeedsPaint();
} }
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
int opacity = (_kInitialOpacity * (1.0 - (radius.value / _kTargetSize))).floor(); int opacity = (_kInitialOpacity * (1.0 - (radius.value / _kTargetSize))).floor();
_paint.color = new sky.Color(opacity << 24); _paint.color = new sky.Color(opacity << 24);
canvas.drawCircle(position.x, position.y, radius.value, _paint); canvas.drawCircle(position.x, position.y, radius.value, _paint);
...@@ -55,7 +55,7 @@ class InkWell extends RenderBox { ...@@ -55,7 +55,7 @@ class InkWell extends RenderBox {
size = constraints.constrain(new sky.Size.infinite()); size = constraints.constrain(new sky.Size.infinite());
} }
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
canvas.drawRect(new sky.Rect.fromLTRB(0.0, 0.0, size.width, size.height), canvas.drawRect(new sky.Rect.fromLTRB(0.0, 0.0, size.width, size.height),
new sky.Paint()..color = const sky.Color(0xFFCCCCCC)); new sky.Paint()..color = const sky.Color(0xFFCCCCCC));
for (InkSplash splash in _splashes) for (InkSplash splash in _splashes)
......
...@@ -9,7 +9,7 @@ import 'package:sky/framework/app.dart'; ...@@ -9,7 +9,7 @@ import 'package:sky/framework/app.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/block.dart'; import 'package:sky/framework/rendering/block.dart';
import 'package:sky/framework/rendering/flex.dart'; import 'package:sky/framework/rendering/flex.dart';
import 'package:sky/framework/rendering/node.dart'; import 'package:sky/framework/rendering/object.dart';
import 'package:sky/framework/rendering/paragraph.dart'; import 'package:sky/framework/rendering/paragraph.dart';
import '../lib/solid_color_box.dart'; import '../lib/solid_color_box.dart';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'dart:sky'; import 'dart:sky';
import 'package:sky/framework/app.dart'; import 'package:sky/framework/app.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/node.dart'; import 'package:sky/framework/rendering/object.dart';
import 'package:sky/framework/rendering/flex.dart'; import 'package:sky/framework/rendering/flex.dart';
import 'package:sky/framework/rendering/paragraph.dart'; import 'package:sky/framework/rendering/paragraph.dart';
import '../lib/solid_color_box.dart'; import '../lib/solid_color_box.dart';
...@@ -15,12 +15,12 @@ AppView app; ...@@ -15,12 +15,12 @@ AppView app;
void main() { void main() {
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.Vertical); RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.Vertical);
RenderNode root = new RenderDecoratedBox( RenderObject root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)), decoration: new BoxDecoration(backgroundColor: const Color(0xFF606060)),
child: flexRoot child: flexRoot
); );
RenderNode child = new RenderSolidColorBox(const Color(0xFFFFFF00)); RenderObject child = new RenderSolidColorBox(const Color(0xFFFFFF00));
flexRoot.add(child); flexRoot.add(child);
child.parentData.flex = 2; child.parentData.flex = 2;
......
...@@ -6,7 +6,7 @@ import 'dart:math' as math; ...@@ -6,7 +6,7 @@ import 'dart:math' as math;
import 'dart:sky' as sky; import 'dart:sky' as sky;
import 'package:sky/framework/app.dart'; import 'package:sky/framework/app.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/node.dart'; import 'package:sky/framework/rendering/object.dart';
const double kTwoPi = 2 * math.PI; const double kTwoPi = 2 * math.PI;
...@@ -62,9 +62,9 @@ class SectorParentData extends ParentData { ...@@ -62,9 +62,9 @@ class SectorParentData extends ParentData {
double theta = 0.0; double theta = 0.0;
} }
abstract class RenderSector extends RenderNode { abstract class RenderSector extends RenderObject {
void setParentData(RenderNode child) { void setParentData(RenderObject child) {
if (child.parentData is! SectorParentData) if (child.parentData is! SectorParentData)
child.parentData = new SectorParentData(); child.parentData = new SectorParentData();
} }
...@@ -115,7 +115,7 @@ class RenderDecoratedSector extends RenderSector { ...@@ -115,7 +115,7 @@ class RenderDecoratedSector extends RenderSector {
} }
// origin must be set to the center of the circle // origin must be set to the center of the circle
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
assert(deltaRadius != null); assert(deltaRadius != null);
assert(deltaTheta != null); assert(deltaTheta != null);
assert(parentData is SectorParentData); assert(parentData is SectorParentData);
...@@ -140,7 +140,7 @@ class RenderDecoratedSector extends RenderSector { ...@@ -140,7 +140,7 @@ class RenderDecoratedSector extends RenderSector {
class SectorChildListParentData extends SectorParentData with ContainerParentDataMixin<RenderSector> { } class SectorChildListParentData extends SectorParentData with ContainerParentDataMixin<RenderSector> { }
class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRenderNodeMixin<RenderSector, SectorChildListParentData> { class RenderSectorWithChildren extends RenderDecoratedSector with ContainerRenderObjectMixin<RenderSector, SectorChildListParentData> {
RenderSectorWithChildren(BoxDecoration decoration) : super(decoration); RenderSectorWithChildren(BoxDecoration decoration) : super(decoration);
void hitTestChildren(HitTestResult result, { double radius, double theta }) { void hitTestChildren(HitTestResult result, { double radius, double theta }) {
...@@ -184,7 +184,7 @@ class RenderSectorRing extends RenderSectorWithChildren { ...@@ -184,7 +184,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
} }
} }
void setParentData(RenderNode child) { void setParentData(RenderObject child) {
// TODO(ianh): avoid code duplication // TODO(ianh): avoid code duplication
if (child.parentData is! SectorChildListParentData) if (child.parentData is! SectorChildListParentData)
child.parentData = new SectorChildListParentData(); child.parentData = new SectorChildListParentData();
...@@ -251,7 +251,7 @@ class RenderSectorRing extends RenderSectorWithChildren { ...@@ -251,7 +251,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
// paint origin is 0,0 of our circle // paint origin is 0,0 of our circle
// each sector then knows how to paint itself at its location // each sector then knows how to paint itself at its location
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
// TODO(ianh): avoid code duplication // TODO(ianh): avoid code duplication
super.paint(canvas); super.paint(canvas);
RenderSector child = firstChild; RenderSector child = firstChild;
...@@ -294,7 +294,7 @@ class RenderSectorSlice extends RenderSectorWithChildren { ...@@ -294,7 +294,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
} }
} }
void setParentData(RenderNode child) { void setParentData(RenderObject child) {
// TODO(ianh): avoid code duplication // TODO(ianh): avoid code duplication
if (child.parentData is! SectorChildListParentData) if (child.parentData is! SectorChildListParentData)
child.parentData = new SectorChildListParentData(); child.parentData = new SectorChildListParentData();
...@@ -356,7 +356,7 @@ class RenderSectorSlice extends RenderSectorWithChildren { ...@@ -356,7 +356,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
// paint origin is 0,0 of our circle // paint origin is 0,0 of our circle
// each sector then knows how to paint itself at its location // each sector then knows how to paint itself at its location
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
// TODO(ianh): avoid code duplication // TODO(ianh): avoid code duplication
super.paint(canvas); super.paint(canvas);
RenderSector child = firstChild; RenderSector child = firstChild;
...@@ -394,7 +394,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox { ...@@ -394,7 +394,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
markNeedsLayout(); markNeedsLayout();
} }
void setParentData(RenderNode child) { void setParentData(RenderObject child) {
if (child.parentData is! SectorParentData) if (child.parentData is! SectorParentData)
child.parentData = new SectorParentData(); child.parentData = new SectorParentData();
} }
...@@ -430,7 +430,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox { ...@@ -430,7 +430,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
} }
// paint origin is 0,0 of our circle // paint origin is 0,0 of our circle
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
super.paint(canvas); super.paint(canvas);
if (child != null) { if (child != null) {
sky.Rect bounds = new sky.Rect.fromSize(size); sky.Rect bounds = new sky.Rect.fromSize(size);
......
...@@ -6,7 +6,7 @@ import 'dart:math'; ...@@ -6,7 +6,7 @@ import 'dart:math';
import 'dart:sky'; import 'dart:sky';
import 'package:sky/framework/app.dart'; import 'package:sky/framework/app.dart';
import 'package:sky/framework/rendering/box.dart'; import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/node.dart'; import 'package:sky/framework/rendering/object.dart';
// Material design colors. :p // Material design colors. :p
List<int> colors = [ List<int> colors = [
...@@ -32,7 +32,7 @@ class Dot { ...@@ -32,7 +32,7 @@ class Dot {
radius = 5 + (95 * event.pressure); radius = 5 + (95 * event.pressure);
} }
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
canvas.drawCircle(x, y, radius, _paint); canvas.drawCircle(x, y, radius, _paint);
} }
} }
...@@ -65,7 +65,7 @@ class RenderTouchDemo extends RenderBox { ...@@ -65,7 +65,7 @@ class RenderTouchDemo extends RenderBox {
size = constraints.constrain(new Size.infinite()); size = constraints.constrain(new Size.infinite());
} }
void paint(RenderNodeDisplayList canvas) { void paint(RenderObjectDisplayList canvas) {
dots.forEach((_, Dot dot) { dots.forEach((_, Dot dot) {
dot.paint(canvas); dot.paint(canvas);
}); });
......
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