GEOS SDK TechDocs
|
|
6.1 Using Visible Document Layers
|
6.3 The 16-Bit Limit on Visual Bounds
All the GEOS drawing commands are based on 16-bit coordinates. Drawing may only occur within a 16-bit graphics space. The graphics system does, however, support extended translations of the 16-bit graphics space within 32-bit coordinates.
This means that you can think of the large document space as a number of smaller, 16-bit "local" graphics spaces. When you need to draw anything, you first use an extended translation to get near your drawing point in the large document. Then you can draw using 16-bit offsets from the point to which you translated.
The application using the extended translation can do so in two different ways: It can store a 32-bit translation with each visible object, or it can store a 32-bit translation in a visible composite, thereby making the entire visible branch under the composite in a 32-bit graphics space. Visible trees implementing layer objects must use the second option; the layer must contain the translation for the entire visible branch that it manages. If a simple large visible tree does not need layers, it may wish to use the first solution.
The first of the two solutions is simple but takes up additional memory and time; each object, when it draws, must translate the coordinates, draw, then translate back. Two translations for each object could significantly affect drawing performance unless visual updates are handled carefully.
The other solution, storing a translation in the composite object, requires just two translations for the entire branch headed by the composite. Whenever the composite receives
MSG_VIS_DRAW
or
MSG_VIS_VUP_CREATE_GSTATE
, it executes the translation on the GState. As long as the translation is always relative to the GState's current transformation (done using
GrApplyTranslationDWord()
), and as long as the translation is undone before the GState is returned to the caller, drawing will be done properly.
GEOS SDK TechDocs
|
|
6.1 Using Visible Document Layers
|
6.3 The 16-Bit Limit on Visual Bounds