I have an Android App that is custom drawing a View (full-screen). I want to invalidate a part of it, then just draw that part in the next onDraw() call. I want to do this in a cycle, drawing each part of the screen at a time. What I have found is that it works well on Nexus 7 (Android 4.4.2) not too bad on Galaxy Nexus (4.3) but never draws the whole screen at one time on HTC Sensation XL (4.0.3). Did some bugs get fixed with the pipeline rendering, or am I doing something wrong? -- What is the correct way to do this?
More detail: I have a set of Rect objects. There is an update method in a handler that regularly calls Invalidate(Rect). Each time, based on an index. in the onDraw() I use
canvas.drawBitmap(background, src, dest, null);
Where src and dest are the same Rect that were used for the invalidate call. At the end of the onDraw method, the index is updated. It appears that in Android 4.0.3 the whole canvas has been blanked, but in 4.3 and 4.4.2 it has not.
What am I really trying to achieve? Spend as little time as possible in each call to onDraw (< 1mS) so that the CPU is free to do other things, and at the same time maintain a UI with a number of bitmaps being drawn, rotated etc. This is most important on the older-less capable phones that are likely to be running 4.0.3