0

I have a weird behavior on one of my app on device updated to Jelly Bean. This game do a: canvas.drawBitmap(bitmap, locationX ,locationY, null); my bitmaps can be of 2 size: 40x15 and 60x15.

On Jelly Bean devices (I tried on Galaxy Nexus and Nexus S), the drawBitmap draw nothing when using bitmaps of 60x15. If I resize to 40x15, it works fine.

I dont have any problems with lower version of android.

Thanks in advance!

Charles
  • 50,943
  • 13
  • 104
  • 142
Patrick
  • 425
  • 4
  • 15
  • create a small test case and file a bug report. – blessanm86 Jul 25 '12 at 00:26
  • Could you post some code and images that cause the behavior, and screenshots of what goes wrong? Even if it is a bug, perhaps someone could find a workaround – skynet Jul 27 '12 at 02:37

2 Answers2

1

I found a work-around by storing a copy of all my graphics in "/drawable-nodpi". Jellybean then showed them.

Steve Smith
  • 2,244
  • 2
  • 18
  • 22
0

It seems that Jellybean introduced new caching behaviour for drawBitmap(). Now it tries to cache a texture in hardware for each bitmap object.

This means that if you redraw the same bitmap object, it will re-use the texture from previously. However it doesn't check whether the contents of the bitmap object have changed, it just uses the pointer to look up the cache.

In my opinion this is totally broken, but they've obviously decided to do that for performance reasons. Similar logic applies to drawPath().

I suspect the behaviour for different sizes is because when you resize the bitmap it causes a new buffer to be allocated.

Michael Smith
  • 717
  • 7
  • 12