Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia counterparts.
Also changes the framework dart code to use the refactored APIs and fixes the various examples and tests. R=abarth@chromium.org, ianh@chromium.org Review URL: https://codereview.chromium.org/1190123003.
This commit is contained in:
@@ -116,7 +116,7 @@ abstract class RenderDecoratedSector extends RenderSector {
|
||||
}
|
||||
|
||||
// origin must be set to the center of the circle
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
assert(deltaRadius != null);
|
||||
assert(deltaTheta != null);
|
||||
assert(parentData is SectorParentData);
|
||||
@@ -253,7 +253,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
// each sector then knows how to paint itself at its location
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
super.paint(canvas);
|
||||
RenderSector child = firstChild;
|
||||
@@ -358,7 +358,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
// each sector then knows how to paint itself at its location
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
// TODO(ianh): avoid code duplication
|
||||
super.paint(canvas);
|
||||
RenderSector child = firstChild;
|
||||
@@ -452,7 +452,7 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
|
||||
}
|
||||
|
||||
// paint origin is 0,0 of our circle
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
super.paint(canvas);
|
||||
if (child != null) {
|
||||
Rect bounds = new Rect.fromSize(size);
|
||||
|
||||
@@ -36,7 +36,7 @@ class Dot {
|
||||
radius = 5 + (95 * event.pressure);
|
||||
}
|
||||
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
canvas.drawCircle(x, y, radius, _paint);
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class RenderTouchDemo extends RenderBox {
|
||||
size = constraints.constrain(Size.infinite);
|
||||
}
|
||||
|
||||
void paint(RenderObjectDisplayList canvas) {
|
||||
void paint(RenderCanvas canvas) {
|
||||
Paint white = new Paint()..color = const Color(0xFFFFFFFF);
|
||||
canvas.drawRect(new Rect.fromSize(size), white);
|
||||
for (Dot dot in dots.values)
|
||||
|
||||
Reference in New Issue
Block a user