Bitmaps on ICS are loaded with wrong pixel format

安稳与你 提交于 2019-11-28 10:58:52

I can definitely assure you that the default window format is RGB888. This was actually made the default in Android 2.3, and has not been changed since them. At this point I would consider RGB565 windows deprecated, since basically all current devices have 32bpp displays.

You say you are also running this on the HTC HD2, but since there is no official build for it I would be suspicious of any result you get there.

I think the emulator may still use 16bpp displays, so in this area I would not rely on its results to exactly match what you will typically see on devices.

That demo app is a bit odd... it has two activities which both filter the launcher intent, one intended for 16bpp and one for 32bpp. Am not sure what determines which one gets picked when you launch the app.

Running the app as-is on an ICS device (a Nexus S running stock 4.0.3) results in the 16bpp version always being chosen. If remove the 16bpp activity declaration from the manifest, it unsurprisingly launches the 32bpp version instead. Which looks fine to me. The 'dither' option has no effect in 32bpp but that's as expected... dithering only comes into play when the display surface depth is lower than the image depth.

As for display surface depths, my understanding is that window surface depth used to default to 16bpp, up until Android 3.0 (Honeycomb) at which point the default quietly switched to 32bpp. The default has always been overrideable via Window.setFormat().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!