title: SurfaceView of type PUSH_BUFFERS
body: <p>I have some experience with the <code>SurfaceView</code>. To prevent unneeded redrawing, I always use a countdown variable which tells the thread how often the view should be drawn.</p>
  
  <pre><code>countdown &gt; 0 : draw ? doNothing
  </code></pre>
  
  <p>However I was thinking about changing that to use a "push surface". So just push a buffer to the surface and show that instead of setting a countdown variable everywhere in my project.</p>
  
  <p>My problem is that I can't find a good tutorial/resource where the usage is described. Currently I have something like this:</p>
  
  <pre><code>// panel is the SurfaceView
  c = panel.getHolder().lockCanvas(null);
  synchronized (panel.getHolder()) {
      panel.updatePhysics();
      panel.onDraw(c);
  }
  panel.getHolder().unlockCanvasAndPost(c);
  </code></pre>
  
  <p>I have no idea on how to get the canvas to draw on when I can't use <code>lockCanvas()</code> as mentioned in the documentation.</p>