Remove tranparent paint hack from BackdropFilter (#29929)

We can remove the hack because https://github.com/flutter/engine/pull/8183
has been rolled into the framework.
This commit is contained in:
liyuqian 2019-03-25 17:09:39 -07:00 committed by GitHub
parent 18a08a8f4f
commit 42443f6631
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1033,20 +1033,11 @@ class RenderBackdropFilter extends RenderProxyBox {
@override
bool get alwaysNeedsCompositing => child != null;
// TODO(liyuqian): remove this after updating the engine BackdropFilterLayer.
void _addTrasnparentPaint(PaintingContext context, Offset offset) {
// Draw a fully transparent paint to make sure that the cull rect won't be
// shrunk by Skia.
final Paint transparentPaint = Paint()..color = const Color(0x00000000);
context.canvas.drawPaint(transparentPaint);
super.paint(context, offset);
}
@override
void paint(PaintingContext context, Offset offset) {
if (child != null) {
assert(needsCompositing);
context.pushLayer(BackdropFilterLayer(filter: _filter), _addTrasnparentPaint, offset);
context.pushLayer(BackdropFilterLayer(filter: _filter), super.paint, offset);
}
}
}