Acknowledged

Request - specify if WatchUi.View.onUpdate() is required or optional

If onUpdate() calls would allow differentiating between updates that are required and that are optional, it would allow avoiding unnecessary repainting.

For example, if a watch face does not require updating every second (by showing just HH:MM), then 59 repaints every minute in high-power mode go to waste.

On the other hand, if the OS wipes the screen clean for some reason, then onUpdate() obviously must execute.

The request is to change onUpdate to include an extra parameter to specify if the update is optional or not:

onUpdate(dc as Graphics.Dc, required as Boolean) as Void

This would help writing more power-efficient code.

Parents
  • To add another use case here that would benefit from this change way more.

    I have a watch face for AMOLED models that does a short custom animation upon entering High Power mode.

    The animation is driven by a short-interval timer that issues requestUpdate() on every tick and runs at about 20 fps.

    There are however a lot of back-to-back animation frames that are identical. Think - it fades in some text, pauses and then fades the text out.

    onUpdate() re-painting the same image is clearly wasteful. There is also a lot of them, so the logical thing to do is not to repaint if the content didn't change.

    In the simulator this works fine. On a real VA5 it doesn't.

    For whatever reason the watch erases the screen between onUpdate() calls even if these calls are spaced milliseconds apart. So the repaint is needed on every tick.

    With this approach, knowing if the screen is in tact is the key to making power-efficient custom animations. As the API stands now, it's not possible to do in principle.

    ---

    I should also add that if the Dc class had getPixel() method, it could've been used to test if a known non-black pixel is set or not. A cheap and hacky test for whether the screen is blank. Alas, Dc is write-only.

Comment
  • To add another use case here that would benefit from this change way more.

    I have a watch face for AMOLED models that does a short custom animation upon entering High Power mode.

    The animation is driven by a short-interval timer that issues requestUpdate() on every tick and runs at about 20 fps.

    There are however a lot of back-to-back animation frames that are identical. Think - it fades in some text, pauses and then fades the text out.

    onUpdate() re-painting the same image is clearly wasteful. There is also a lot of them, so the logical thing to do is not to repaint if the content didn't change.

    In the simulator this works fine. On a real VA5 it doesn't.

    For whatever reason the watch erases the screen between onUpdate() calls even if these calls are spaced milliseconds apart. So the repaint is needed on every tick.

    With this approach, knowing if the screen is in tact is the key to making power-efficient custom animations. As the API stands now, it's not possible to do in principle.

    ---

    I should also add that if the Dc class had getPixel() method, it could've been used to test if a known non-black pixel is set or not. A cheap and hacky test for whether the screen is blank. Alas, Dc is write-only.

Children
No Data