Quick question - I'm having control that's extending LinearLayout and I'm overriding it's onPaint method like this
@Override protected void onDraw(Canvas canvas) { super.dispatchDraw(canvas); _background.draw(canvas); _object1.draw(canvas); _object2.draw(canvas); _object3.draw(canvas); // etc... }
Every 40ms I invoke postInvalidate() in background and onPaint gets called on UI thread. The problem is _background.draw is taking over 80% of my drawing time.
So - is it possible to somehow cache background and not redraw it every time?