Skip to content

Commit

Permalink
[new gallery] Reisze gallery images (#147882)
Browse files Browse the repository at this point in the history
Some cause of jank on both Skia and Impeller are these massive images. We should just resize them so that the noise is reduced and we can see other performance issues.

Fixes flutter/flutter#147797

Tested: this is a test!
  • Loading branch information
jonahwilliams authored May 6, 2024
1 parent af84f6b commit 5230ec5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,13 @@ class _CraneAppBarState extends State<CraneAppBar> {
children: <Widget>[
const ExcludeSemantics(
child: FadeInImagePlaceholder(
image: AssetImage(
'crane/logo/logo.png',
package: 'flutter_gallery_assets',
image: ResizeImage(
AssetImage(
'crane/logo/logo.png',
package: 'flutter_gallery_assets',
),
width: 40,
height: 60,
),
placeholder: SizedBox(
width: 40,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ class _DestinationImage extends StatelessWidget {
label: destination.assetSemanticLabel,
child: ExcludeSemantics(
child: FadeInImagePlaceholder(
image: AssetImage(
destination.assetName,
package: 'flutter_gallery_assets',
image: ResizeImage(
AssetImage(
destination.assetName,
package: 'flutter_gallery_assets',
),
width: isDesktop ? null : mobileThumbnailSize.toInt(),
height: isDesktop ? null : mobileThumbnailSize.toInt(),
),
fit: BoxFit.cover,
width: isDesktop ? null : mobileThumbnailSize,
Expand Down

0 comments on commit 5230ec5

Please sign in to comment.