Datasheet

Figure 1-4
Mac OS X provides a rich graphics library for doing two-dimensional drawing, called Quartz 2D. The
Quartz 2D library is specific to Mac OS X, although it uses industry-standard graphic formats, such as
PDF. Mac OS X also includes OpenGL for those interested in three-dimensional drawing. Although pop-
ularized by cross-platform video games, Mac OS X itself uses OpenGL for certain operations. Finally,
QuickTime is built into Mac OS X, providing support for what Apple occasionally calls four-dimensional
drawing. QuickTime is also available for Microsoft Windows operating systems, and for older versions
of Mac OS. All these programming libraries rely on the Quartz Compositor for actually drawing their
content.
The following sections look at these subsystems in more detail.
The Quartz Compositor
The Quartz Compositor is a private system service that oversees all graphics operations on Mac OS X.
Apple does not provide a means for developers to interact with the Quartz Compositor directly, so we
won’t look at it in detail here. The Quartz Compositor plays such an important role in Mac OS X’s
graphic strategy, however, it pays to understand what it does.
Among its many duties, the Quartz Compositor handles these tasks:
Manages all the windows on your screen: While the actual look of the window may come from
an application or an application framework like Cocoa or Carbon, the Quartz Compositor pro-
vides most of the window’s guts: where the window sits on the screen, how the window casts
its drop shadow, and so on.
Ensures that graphics are drawn appropriately, regardless of which library or libraries an
application may be using: In fact, an application may use commands from Quartz 2D, OpenGL,
and QuickTime when drawing a given window. The Quartz Compositor ensures that the draw-
ing reaches the screen correctly.
Collects user events from the Core Operating System and dispatches them to the Application
Frameworks layer: User events such as keystrokes and mouse movements are collected from
drivers in the Core Operating System and sent on to the Quartz Compositor. Some of these
events are passed along where they may be interpreted by the application. The Quartz
Compositor will also send its own special events through to the application for responding to
special conditions, such as when the user brings the application to the foreground or when a
window needs to be updated.
Frameworks and UI
Applications
Core Operating System
Quartz Compositor
Quartz 2D QuickTimeOpenGL
12
Chapter 1
05_573993 ch01.qxd 6/16/05 2:22 PM Page 12