Graphics Programs Reference
In-Depth Information
Layers and Views
In Chapter 6 , you learned that every view has an image and that it is a view's image that
gets drawn to the screen. This image is an instance of CALayer .
When you instantiate a view, it creates a layer, and when the screen is redrawn, the layers
of each view in the window's hierarchy are drawn (including the window's layer). We call
layers created by views implicit layers . Because every view has a layer, there is a matching
layer hierarchy that mimics the view hierarchy ( Figure 22.2 ).
After the views draw on their layers, the layers are copied to the screen. When we talk
about copying a bunch of layers to the screen in a particular order and respecting each
pixel's opacity, we use the word composite . Thus, the full description is “Each view renders
to its layer, and then all the layers are composited to the screen.”
Figure 22.2 View and corresponding layer hierarchy
 
Search WWH ::




Custom Search