Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need workaround for Android U issue where single-channel, hardware gainmaps are dropped when rendering using skiagl #5362

Open
falhassen opened this issue Jan 30, 2024 · 1 comment

Comments

@falhassen
Copy link
Collaborator

There is an AOSP bug in the original Android U release in https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/HardwareBitmapUploader.cpp where single-channel bitmaps are initialized with the wrong GL enum (GL_R8 instead of GL_RGBA, introduced in https://cs.android.com/android/_/android/platform/frameworks/base/+/a008aa9c85bc136daefc4e056d88008cc4f55781:libs/hwui/HardwareBitmapUploader.cpp;dlc=4207fcf360998d0c6717f430c00aab13e5de80b9), causing the process of uploading the bitmap to hardware to fail.

As such, Ultra HDR images can fail to decode on Android U on devices where hwui is configured to use skiagl. This is not an issue on devices where hwui is configured to use skiavk.

A workaround could be to decode a single-channel, hardware 1x1 bitmap, see if it fails, and if it does, to copy the gainmap to a three-channel bitmap before uploading to hardware.

@falhassen
Copy link
Collaborator Author

Fixed `BitmapFactory in #5357.

But we still need a workaround for ImageDecoder like we do for BitmapFactory .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant