-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#48805Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
This is a flaw in the new gaussian blur that isn't turned on by default.
reproduction
--- a/impeller/entity/contents/filters/filter_contents.cc
+++ b/impeller/entity/contents/filters/filter_contents.cc
@@ -50,6 +50,8 @@ std::shared_ptr<FilterContents> FilterContents::MakeDirectionalGaussianBlur(
return blur;
}
+#define IMPELLER_ENABLE_NEW_GAUSSIAN_FILTER 1
+import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
final _random = Random();
void main() => runApp(const BackdropFilterDemo());
class BackdropFilterDemo extends StatelessWidget {
const BackdropFilterDemo({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.black,
body: Stack(
children: [
ListView.separated(
separatorBuilder: (_, __) => const SizedBox(height: 8),
itemBuilder: (context, index) => BlurEffect(
child: Container(
height: 50,
color: Colors.primaries[_random.nextInt(17)].shade300,
child: Center(
child: Text(index.toString()),
),
),
),
itemCount: 200,
),
Positioned.fill(
bottom: null,
child: BlurEffect(
child: Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).viewPadding.top,
),
child: const SizedBox(height: 45),
),
),
),
Positioned.fill(
top: null,
child: BlurEffect(
child: Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).viewPadding.bottom,
),
child: const SizedBox(height: 50),
),
),
),
],
),
),
);
}
}
class BlurEffect extends StatelessWidget {
final Widget child;
const BlurEffect({
required this.child,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 28,
sigmaY: 28,
tileMode: TileMode.mirror,
),
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.black.withOpacity(.65)),
child: child,
),
),
);
}
}screenshot
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requeststeam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team