YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Overdraw

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. As a developer,
  2. your goal is to keep your app
    rendering at 60 frames per second.
  3. This means that you have 16 milliseconds
    to finish all of your computation and
  4. drawing for the next frame.
  5. If you miss the 16 millisecond target,
  6. you'll have a dropped frame,
    which will cause your app to skip.
  7. So, you'll want to use this time wisely.
  8. A common you've probably
    encountered is overdraw.
  9. The idea here is that you draw a layer.
  10. Great.
  11. But then the next layer you draw
  12. obscures a portion of
    that initial layer.
  13. You just wasted precious time drawing
    all of those pixels that were drawn over
  14. immediately after.
  15. There are two ways to
    tackle overdraw issues.
  16. The first is to remove
    unnecessary backgrounds and
  17. drawables, such as a base white
    background on your top most layer
  18. when you're completely obscuring
    the layer out with other views.
  19. Or you can mark certain portions of
    the layer as visible or not visible.
  20. Especially with stacked views, this
    will help by only drawing the visible
  21. portions and
    ignoring the rest until it's needed.