[Y-devel] display server architectures compared

Mike Paquette mpaque at mac.com
Fri Feb 20 20:56:00 GMT 2004


On Feb 20, 2004, at 12:06 PM, Mark-Jan Bastian wrote:

> Especially quartz has impressed me a lot. It is not the 
> ghost-in-a-bottle,
> and the transparent, very smooth animated graphics themselves that
> wowed me, but how they actually got it all that smooth and fast.
> I assume there is a lot of buffering going on for each window, RAM
> is cheap these days. But then still, the server has to make a
> good tradeoff between using videomemory and main memory.

A good bit of work went into getting the Quartz WIndow Server to be 
that way.

Essentially all the windows are buffered.  The Window Server acts as a 
sort of video mixer, using the Quartz Compositor to blend the drawn 
buffer contents together to produce the display contents.  The design 
was done so as to deliberately hide how the 'back end' is implemented, 
so that the original software compositing machinery could be supplanted 
by hardware acceleration transparently.  The hardware accelerated 
Quartz Compositor is called Quartz Extreme.  (Marketing.  Go figure...)

In this design, the window system itself does not contain any drawing 
code.  It acts as a screen 'real estate' manager and a video mixer to 
combine the window buffer contents.   All drawing is done into the 
window buffers from client side drawing frameworks such as Quartz 2D 
and QuickDraw.

Widget sets are implemented atop the drawing frameworks in higher level 
frameworks.  This makes the implementation of custom widgets relatively 
easy, as the custom widgets can use existing code in their 
implementation, as by subclassing Cocoa NSControls.  Such custom 
widgets operate using the same underlying drawing primitives as the 
standard system widgets.

One drawback of this implementation is that the communication of all 
window content to the window server is done as raster data.  The server 
is assumed to be on the same processor set and memory system as the 
client apps.  That's a reasonable assumption for most desktop personal 
computers, but it does mean that applications written to this model are 
not 'network transparent', and so cannot readily connect to a remote 
display server.  VNC and Timbuktu are used for remote system 
management.

>
> What I am also missing is info on the coordinate system to use,
> and what graphics primitives must be availble, how they are
> queued/batched, and how all the planes will be interfacing
> with each other. Is this thing going to be heavily multithreaded,
> like the still-awesome BeOS appserver ? Things like this.

Over in the Mac OS X world, I think every popular coordinate system is 
used.  Quartz 2D uses a lower-left origin, like PostScript and PDF.  
Transformation matrices are available to make like easier.    QuickDraw 
uses an upper-left origin, like many other raster-oriented drawing 
systems.

The window server itself is not heavily multithreaded.  As the drawing 
operations are done by the client applications, there's always (at 
least) a thread per app to do the drawing work.

On backing store compression:  This is a feature enabled in Mac OS X 
10.2 and later where the window buffers, or backing stores, are 
compressed while not in use.  This method for reducing backing memory 
usage was first introduced in OPENSTEP 4.0, way back on the Display 
PostScript window system.

On window visibiliity and compositing:  Apps draw the window content 
without regard to current window visibility, rendering the complete 
window content into the buffer.  The window server applies any needed 
clipping for totally obscured areas, or blending with translucent areas 
above a window.  Since the buffer contains the complete window content, 
there is never a need for 'damage repair' events.  When a portion of a 
window is revealed, the window server can immediately composite the 
revealed area to the display, without running the application to 
repaint the revealed area.  Compositing may be done by a GPU, as in 
Quartz Extreme, or by a software compositor, when a particular 
display's GPU  isn't quite up to handling Quartz Extreme.




More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved