Update density dpi before load drawable.
When load a BitmapDrawable object with specific density, there will decode the image based on the density from display metrics, so even when load with higher override density, the final intrinsic size of the BitmapDrawable can still not big enough to draw on expect size. In order to load a bigger size BitmapDrawable object from a resources, there should also update the densityDpi on the display metrics. But since this kind of use case is relative rare, we use a standalone IconProvider object to load the Drawable object for higher density, so this resources object won't affect the entire system. Also, since this symptom is not noticeable at high density, the standalone icon provider only used for low density situation, so there should be no performance loss for most high denstiy device. Bug: 215673281 Test: atest StartingSurfaceDrawerTests Test: snapshot to see the loaded bitmap. Change-Id: Idd769327a8b0987f921c7d421ea1d9bb38a507ba
Loading
Please register or sign in to comment