Extend ImageCache to handle Custom ImageInfo #86402
Labels
a: images
Loading, displaying, rendering images
c: new feature
Nothing broken; request for a new capability
c: proposal
A detailed proposal for a change to Flutter
customer: alibaba
framework
flutter/packages/flutter repository. See also f: labels.
r: fixed
Issue is closed as already fixed in a newer version
Background
We used external texture to display the images in our flutter app. On the Android platform, we draw the
Bitmap
onto theSurfaceTexture
, and on the iOS platform, we convert theUIImage
toCVPixelBufferRef
, and finally use theTexture
Widget to display the image. We do this mainly based on the following considerations:Bitmap
orUIImage
can be efficiently displayed to flutter app. For example, we need to customize a photo list page, but the native platform API only provide usBitmap
orUIImage
as photo.Use case
We are currently refactoring this solution, we want to let the external texture can benefit from the
ImageCache
logic.We hope that
ImageCache
can no longer dependent on ui.Image, so that we can customize ImageInfo and ImageProvier to cache external texture images in ImageCache.Proposal
let
ImageCache
can no longer dependent on ui.Image,then users can cache customImageInfo
Related code:
flutter/packages/flutter/lib/src/painting/image_cache.dart
Line 414 in 31de052
Expected
ImageInfo
add a property namedsizeBytes
, thenImageCache
use it.Actual
The text was updated successfully, but these errors were encountered: