From 1883d06aef1c05977112d1e908adf055e42f1b1d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 25 Aug 2015 14:10:32 -0700 Subject: [PATCH] Fix build I removed these functions by mistake in my previous patch. --- packages/flutter/lib/rendering/object.dart | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/rendering/object.dart b/packages/flutter/lib/rendering/object.dart index 4c6630eda8..c444440d34 100644 --- a/packages/flutter/lib/rendering/object.dart +++ b/packages/flutter/lib/rendering/object.dart @@ -181,6 +181,13 @@ class PaintingContext { } } + static Paint _getPaintForAlpha(int alpha) { + return new Paint() + ..color = new Color.fromARGB(alpha, 0, 0, 0) + ..setTransferMode(sky.TransferMode.srcOver) + ..isAntiAlias = false; + } + void paintChildWithOpacity(RenderObject child, Point childPosition, Rect bounds, @@ -188,7 +195,7 @@ class PaintingContext { assert(debugCanPaintChild(child)); final Offset childOffset = childPosition.toOffset(); if (!child.needsCompositing) { - canvas.saveLayer(bounds, OpacityLayer.paintForAlpha(alpha)); + canvas.saveLayer(bounds, _getPaintForAlpha(alpha)); canvas.translate(childOffset.dx, childOffset.dy); insertChild(child, Offset.zero); canvas.restore(); @@ -202,6 +209,12 @@ class PaintingContext { } } + static Paint _getPaintForColorFilter(Color color, sky.TransferMode transferMode) { + return new Paint() + ..setColorFilter(new sky.ColorFilter.mode(color, transferMode)) + ..isAntiAlias = false; + } + void paintChildWithColorFilter(RenderObject child, Point childPosition, Rect bounds, @@ -210,7 +223,7 @@ class PaintingContext { assert(debugCanPaintChild(child)); final Offset childOffset = childPosition.toOffset(); if (!child.needsCompositing) { - canvas.saveLayer(bounds, ColorFilterLayer.paintForColorFilter(color, transferMode)); + canvas.saveLayer(bounds, _getPaintForColorFilter(color, transferMode)); canvas.translate(childOffset.dx, childOffset.dy); insertChild(child, Offset.zero); canvas.restore();