Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit e7e414490929d8544af25752f1bcffac839a92dd
Author: Nader Jawad <njawad@google.com>
Date: Thu Jan 28 17:35:15 2021
Use Android's Drawable Resource cache
Relnote: "Updated compose's imageFromResource
API to reuse the resource drawable cache
when loading ImageBitmap objects."
Fixes: 178751994
Test: Added test to verify referential equality
Change-Id: If3627edded04b55794aede912b7e698abbcad7e6
M compose/ui/ui-graphics/src/androidMain/kotlin/androidx/compose/ui/graphics/AndroidImageBitmap.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/res/ResourcesTest.kt
https://android-review.googlesource.com/1564793
Branch: androidx-main
commit e7e414490929d8544af25752f1bcffac839a92dd
Author: Nader Jawad <njawad@google.com>
Date: Thu Jan 28 17:35:15 2021
Use Android's Drawable Resource cache
Relnote: "Updated compose's imageFromResource
API to reuse the resource drawable cache
when loading ImageBitmap objects."
Fixes: 178751994
Test: Added test to verify referential equality
Change-Id: If3627edded04b55794aede912b7e698abbcad7e6
M compose/ui/ui-graphics/src/androidMain/kotlin/androidx/compose/ui/graphics/AndroidImageBitmap.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/res/ResourcesTest.kt
Description
The implementation of imageFromResource uses BitmapFactory.decodeResource instead of leveraging the existing Drawable resource cache in the framework. We should leverage this cache instead of having multiple copies of the same asset in both the traditional Android framework as well as compose.