3. Rendering Model

3.1 Introduction

The X2D rendering model is as follows:

  1. If an X2D entity resides within another document, for example, an HTML file, then the X2D entity is added to the rendering layer of the HTML file. If the X2D entity is a standalone document, then a new rendering layer is created to which the X2D entity is added.
  2. Rendering order (from the SVG Specifications): At the top level of the X2D document hierarchy, objects (and a <group> is considered a single object here) are rendered bottom-to-top in increasing z-index order. Objects with the same parent and same z-index are rendered bottom-to-top according to the location in the document (the first child is drawn first). The same algorithm applies recursively within each <group> element; thus, for the purposes of determining rendering order, each <group> is like its own mini SVG document, with z-index values within a <group> only applying relative to the same parent.
  3. Display List (from the SVG Specifications): The given object is converted into a X2D primitive object display list consisting of a list of path, text and image objects with all coordinates and lengths transformed into viewport space. All images are still in the original resolution (no resampling into viewport resolution yet).