4 ,Gˆl–ßi~” JC]Š�nàŸ¸&ÔÅ£Ë „e×€ÿ_‡I|¥ŠèªÁÎ?÷G The X Rendering Extension Version 0.11 2009-07-15 Keith Packard keithp@keithp.com 1. Introduction The X Rendering Extension (Render) introduces digital image composition as the foundation of a new rendering model within the X Window System. Rendering geometric figures is accomplished by client-side tessellation into either triangles or trapezoids. Text is drawn by loading glyphs into the server and rendering sets of them. 2. Acknowledgments This extension was the work of many people, in particular: + Thomas Porter and Tom Duff for their formal description of image compositing. + Rob Pike and Russ Cox who designed the Plan 9 window system from which the compositing model was lifted. + Juliusz Chroboczek and Raph Levien whose proposal for client-side glyph management eliminated font handling from the X server. + Jon Leech, Brad Grantham and Allen Akin for patiently explaining how OpenGL works. + Carl Worth for providing the sample implementation of trapezoid rendering and showing how broken the spec was + Sam Pottle and Jamey Sharp for helping demonstrate the correctness of the trapezoid specification. + Owen Taylor for helping specify projective transformations 3. Rendering Model Render provides a single rendering operation which can be used in a variety of ways to generate images: dest = (source IN mask) OP dest Where 'IN' is the Porter/Duff operator of that name and 'OP' is any of the list of compositing operators described below, among which can be found all of the Porter/Duff binary operators. To use this operator several additional values are required: + The destination rectangle. This is a subset of the destination within which the rendering is performed. + The source location. This identifies the coordinate in the source aligned with the upper left corner of the destination rectangle. + The mask location. This identifies the coordinate in the mask aligned with the upper left corner of the destination rectangle. + A clip list. This limits the rendering to the intersection of the destination rectangle with this clip list. + The OP to use + Whether the source should be repeated to cover the destination rectangle, extended with a constant pixel value or extended by using the nearest available source pixel. + Whether the mask should be repeated to cover the destination rectangle, extended with a constant pixel value or extended by using the nearest available mask pixel. + Whether the mask has a single alpha value for all four channels or whether each mask channel should affect the associated source/dest channels. + Whether the source should be reshaped with a projective transformation, and if so, what filter to apply while resampling the data. + Whether the mask should be reshaped with a projective transformation, and if so, what filter to apply while resampling the data. These parameters are variously attached to the operands or included in each rendering request. 4. Data types The core protocol rendering system uses a pixel model and applies color only in the final generation of the video signal. A compositing model operates on colors, not pixel values so a new datatype is needed to interpret data as color instead of just bits. The "PictFormat" object holds information needed to translate pixel values into red, green, blue and alpha channels. The server has a list of picture formats corresponding to the various visuals on the screen. There are two classes of formats, Indexed and Direct. Indexed PictFormats hold a list of pixel values and RGBA values while Direct PictFormats hold bit masks for each of R, G, B and A. The "Picture" object contains a Drawable, a PictFormat and some rendering state. More than one Picture can refer to the same Drawable. 5. Errors Errors are sent using core X error reports. PictFormat A value for a PICTFORMAT argument does not name a defined PICTFORMAT. Picture A value for a PICTURE