From 5230ec5ba4a7d15757096976bf02f2884acbd27c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 6 May 2024 12:20:32 -0700 Subject: [PATCH] [new gallery] Reisze gallery images (#147882) 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 https://github.com/flutter/flutter/issues/147797 Tested: this is a test! --- .../new_gallery/lib/studies/crane/backdrop.dart | 10 +++++++--- .../new_gallery/lib/studies/crane/item_cards.dart | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dev/integration_tests/new_gallery/lib/studies/crane/backdrop.dart b/dev/integration_tests/new_gallery/lib/studies/crane/backdrop.dart index cfa9b6e0745c..3252a7181757 100644 --- a/dev/integration_tests/new_gallery/lib/studies/crane/backdrop.dart +++ b/dev/integration_tests/new_gallery/lib/studies/crane/backdrop.dart @@ -337,9 +337,13 @@ class _CraneAppBarState extends State { children: [ 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, diff --git a/dev/integration_tests/new_gallery/lib/studies/crane/item_cards.dart b/dev/integration_tests/new_gallery/lib/studies/crane/item_cards.dart index dc926f6cc78b..c5abd5f5224f 100644 --- a/dev/integration_tests/new_gallery/lib/studies/crane/item_cards.dart +++ b/dev/integration_tests/new_gallery/lib/studies/crane/item_cards.dart @@ -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,