Drawing efficiency

Former Member
Former Member
I'm playing with apps for the first time and I'm unsure how to go about some specific situations to get minimal "cost". It's regarding the way the system implements draws, the easiest way to explain it being this - if drawing an analog watch face comprised of basic tick marks along the outside, would it be more efficient to do lines across the whole display (i.e. 12oclock and 6oclock in one drawLine) and then to draw a fillCircle in the centre, or separate drawLine operations? Essentially, # of operations versus actual pixels affected.

Many thanks
  • Former Member
    Former Member
    Generally you will want to reduce the number of affected pixels.

    I would only consider a construction of the type you are describing if it can replace a more complex operation with simpler ones. E.g. replacing an arc with an approximation constructed from lines may be faster (but only if you have pre-computed the arc points because that would be expensive on the VM).