OSDN Git Service

Reland "Use ImageDecoder for NinePatchDrawable and BitmapDrawable"
authorLeon Scroggins III <scroggo@google.com>
Thu, 15 Feb 2018 15:40:33 +0000 (10:40 -0500)
committerLeon Scroggins III <scroggo@google.com>
Thu, 15 Feb 2018 19:14:25 +0000 (14:14 -0500)
commit2f1b06b58fc3c496832afc9b6ceeb2a36ef4bfa6
tree52f83f8f311f4dab750bf2c9dcdf71addd0e7fdf
parentee3a2ba97204f7d23c733504991d930aefd9fe7b
Reland "Use ImageDecoder for NinePatchDrawable and BitmapDrawable"

This reverts commit ac9c8f7c1e4cc608ff78217b7849351d7f77d90c.

Bug: 73083791
Bug: 73364985

Don't scale NinePatchDrawable if bitmap has no density (including fix
for 73364985).
Fixed bugs around density and input streams.

Update PointerIcon to account for the fact that BitmapDrawable no longer
scales its Bitmap up at decode time. PointerIcon now handles the
scaling. This is necessary because PointerIcon never draws its Bitmap.
Instead, native code uses the Bitmap's internal SkBitmap without
accounting for density.

Test: Ran CTS:
- CtsUiRenderingTestCases
- CtsGraphicsTestCases
  - I2d3976061d164ab4d58209db1320917f272a1958
- CtsViewTestCases
- ThemeHostTests

Change-Id: I3e0c11195622d65f084ce79dad887504630177ca
core/java/android/view/PointerIcon.java
graphics/java/android/graphics/ImageDecoder.java
graphics/java/android/graphics/drawable/BitmapDrawable.java
graphics/java/android/graphics/drawable/Drawable.java
graphics/java/android/graphics/drawable/NinePatchDrawable.java