mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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:
parent
18a08a8f4f
commit
42443f6631
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user