title: On iOS, how do CALayer bitmaps (CGImage objects) get displayed onto Graphics Card?
body: <p>On iOS, I was able to create 3 <code>CGImage</code> objects, and use a <code>CADisplayLink</code> at 60fps to do</p>
  
  <pre><code>self.view.layer.contents = (__bridge id) imageArray[counter++ % 3];
  </code></pre>
  
  <p>inside the <code>ViewController</code>, and each time, an image is set to the view's CALayer <code>contents</code>, which is a bitmap.  </p>
  
  <p>And this all by itself, can alter what the screen shows.  The screen will just loop through these 3 images, at 60fps.  There is no UIView's <code>drawRect</code>, no CALayer's <code>display</code>, <code>drawInContext</code>, or CALayer's delegate's <code>drawLayerInContext</code>.  All it does is to change the CALayer's <code>contents</code>.</p>
  
  <p>I also tried adding a smaller size sublayer to <code>self.view.layer</code>, and set that sublayer's <code>contents</code> instead.  And that sublayer will cycle through those 3 images.</p>
  
  <p>So this is very similar to back in the old days even on Apple ][ or even in King's Quest III era, which are DOS video games, where there is 1 bitmap, and the screen just constantly shows what the bitmap is.</p>
  
  <p>Except this time, it is not 1 bitmap, but a tree or a linked list of bitmaps, and the graphics card constantly use the Painter's Model to paint those bitmaps (with position and opacity), onto the main screen.  So it seems that <code>drawRect</code>, CALayer, everything, were all designed to achieve this final purpose.</p>
  
  <p>Is that how it works?   Does the graphics card take an ordered list of bitmaps or a tree of bitmaps?  (and then constantly show them.  To simplify, we don't consider the Implicit animation in the CA framework)  What is actually happening down in the graphics card handling layer?  (and actually, is this method almost the same on iOS, Mac OS X, and on the PCs?)</p>
  
  <p>(this question aims to understand how our graphics programming actually get rendered in modern graphics cards, since for example, if we need to understand UIView and how CALayer works, or even use CALayer's bitmap directly, we do need to understand the graphics architecture.)</p>