This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Fix shadow rendering using boxshadow due to webkit repaint area bug #23769
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
69c6bb5
Fix shadow rendering using boxshadow due to webkit repaint area bug w…
ferhatb a8afa2c
update golden locks
ferhatb 84346ad
address reviewer comments
ferhatb a5b0cb4
Remove unused import
ferhatb 69c0d24
Use boxshadow for fill only
ferhatb f88c9f6
Merge remote-tracking branch 'upstream/master' into boxshadow
ferhatb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| repository: https://github.com/flutter/goldens.git | ||
| revision: ee03ff97af36cbf9bd2627ef4e32f5a45676f96f | ||
| revision: 510c545ee4dd94f7d620cdc51a9027fdd8e521bc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
lib/web_ui/test/golden_tests/engine/dom_mask_filter_test.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| // @dart = 2.6 | ||
|
|
||
| import 'package:test/bootstrap/browser.dart'; | ||
| import 'package:test/test.dart'; | ||
| import 'package:ui/ui.dart' hide TextStyle; | ||
| import 'package:ui/src/engine.dart'; | ||
| import 'screenshot.dart'; | ||
|
|
||
| void main() { | ||
| internalBootstrapBrowserTest(() => testMain); | ||
| } | ||
|
|
||
| void testMain() async { | ||
| const double screenWidth = 500.0; | ||
| const double screenHeight = 500.0; | ||
| const Rect screenRect = Rect.fromLTWH(0, 0, screenWidth, screenHeight); | ||
|
|
||
| setUp(() async { | ||
| debugEmulateFlutterTesterEnvironment = true; | ||
| await webOnlyInitializePlatform(); | ||
| webOnlyFontCollection.debugRegisterTestFonts(); | ||
| await webOnlyFontCollection.ensureFontsLoaded(); | ||
| }); | ||
|
|
||
| test('Should blur rectangles based on sigma.', () async { | ||
| final RecordingCanvas rc = | ||
| RecordingCanvas(const Rect.fromLTRB(0, 0, 500, 500)); | ||
| for (int blurSigma = 1; blurSigma < 10; blurSigma += 2) { | ||
| final Paint paint = Paint() | ||
| ..color = Color(0xFF2fdfd2) | ||
| ..maskFilter = MaskFilter.blur(BlurStyle.normal, blurSigma.toDouble()); | ||
| rc.drawRect(Rect.fromLTWH(15.0, 15.0 + blurSigma * 40, 200, 20), paint); | ||
| } | ||
| await canvasScreenshot(rc, 'dom_mask_filter_blur', | ||
| region: screenRect, | ||
| maxDiffRatePercent: 0.01); | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 0 diff rate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blur & gradients typically are slightly off between mac and linux.