Drawing performance suggestions please

In terms of drawing, what gives the best performance?

Lets say I have a drawable list that is rendered in a layout, now I need to update that.
So in onUpdate, I just draw on top of what has already been rendered by the layout.

Is this the correct way, or is there a better approach?

Should I rather convert the drawable list to a single bitmap, and then for updates I just draw over that?

I have x number of blocks drawn by the layout, all these blocks are defined as polygons.
Then in onUpdate I black them out based on user activity. Blacking out involves a fillrectangle for each block.
But I have to keep track of which have been blacked out previously, so it is a cumulative operation, and on each update the number of blocks increase.

Isn't there a way for the previous draw operation to remain without me having to redraw them all on each update?

All help and suggestions will be appreciated!
  • Former Member
    Former Member over 10 years ago
    If you don't blank out the screen yourself with something like dc.clear(), everything from the previous cycle will still be on the screen. You can try to only update things that have change, but this may cause issues if page transitions occur, and would need to be tested.

    I believe on a complex background, a single full screen bitmap would be more efficient than making lots of dc.drawX() calls.
  • I agree with Brian--based on my experience with others' watch faces, lots of draw calls can cause laggy performance on some devices. Several people have converted complex backgrounds to bitmaps and have successfully improved the performance of their apps.
  • I agree with Brian--based on my experience with others' watch faces, lots of draw calls can cause laggy performance on some devices. Several people have converted complex backgrounds to bitmaps and have successfully improved the performance of their apps.


    Ok, the issue I have is as follows:

    if I do the following in onUpdate:

    View.findDrawableById("time").setText("10:00");

    The only way this is shown, is by calling

    View.onUpdate(dc);

    Now if I have a mixture of drawables, like the above scenario, and manual dc.draw() calls in code, all the draw() calls have to happen after the call to the above View.onUpdate(dc), otherwise it just don't show up, as if it gets erased by the View.onUpdate(dc) call.

    My problem with this is that I'd like to prevent the View.onUpdate to happen on every cycle. But if I don't call it, my time drawable never displays.
    So I am in a rut here trying to optimize my drawing performance.