XGL Test Suite User's Guide
只搜尋這本書
以 PDF 格式下載這本書

Pcache Test Descriptions

20

This chapter describes the Pcache test programs. The following is defined for each test program:
  • Name of the test program
  • Test types (See the section, "Denizen Test Types" on page 2 for the different test types.)
  • Description of the test program
  • Attributes tested by the program
  • Operators tested by the program
  • Output from the test program
· pcache1
Test Types:RGB, SM
Description:A Pcache object is created by xgl_object_create(). The attribute XGL_PCACHE_CONTEXT is used to set the context to the Pcache. The test checks the status returned by xgl_pcache_display() for all the combination of "test", "display" and "restore" of the function variables. xgl_pcache_display() is also tested for an empty Pcache. The front surface color is modified in Pcache by xgl_object_set() and checked if xgl_pcache_display() actually changes the context.
xgl_context_new_frame() is used to empty and reopen the Pcache, and xgl_object_destroy() destroys the Pcache.
Attributes Tested: XGL_PCACHE, XGL_PCACHE_CONTEXT
                    XGL_CTX_SURF_FRONT_COLOR
Operators Tested:   xgl_object_create
                    xgl_object_set
                    xgl_object_get
                    xgl_pcache_display
                    xgl_context_new_frame
                    xgl_multi_simple_polygon
Output:             One magenta square

· pcache2
Test Types: RGB, SM Description:
The test creates a window raster, and a context. The primitive colors, scale factors, etc. are set in the context. The test next creates a Pcache object, then renders a multisimple polygon onto it. The Pcache is then displayed on the raster using the attributes in the context. This is repeated for triangle strip, triangle star, individual triangles, quadmesh, multipolyline, stroketext, and multimarker. All the renderings are done with the attributes stored in the context.
Attributes Tested: XGL_CTX_BACKGROUND_COLOR
Operators Tested: xgl_object_create
                    xgl_object_set
                    xgl_multi_simple_polygon
                    xgl_triangle_list
                    xgl_quadrilateral_mesh
                    xgl_multipolyline
                    xgl_stroke_text
                    xgl_multimarker
                    xgl_pcache_display
Output:             Five yellow triangles, yellow corner, yellow protruding

rectangle, five triangles, another five triangles, a square, a polyline, text, and six yellow "+" markers
· pcache3
Test Types:RGB, SM
Description:Tests the general attributes supported by Pcache, i.e., the surface, line, marker, and pick attributes. A cube is rendered with xgl_multi_simple_polygon() to test the surface attributes. First, the default face cull is tested, then front face cull, back face cull. The front and back color selectors are next tested for the default color selector, XGL_SURF_COLOR_CONTEXT, and XGL_SURF_COLOR_VERTEX_ILLUM_INDEP. The back face is specified by changing
XGL_3D_CTX_SURF_GEOM_NORMAL to
XGL_GEOM_NORMAL_LAST_POINTS. The front and back
illuminations are tested for
XGL_ILLUM_NONE_INTERP_COLOR,
XGL_ILLUM_PER_FACET, and XGL_ILLUM_PER_VERTEX.
The line attribute test program tests for
XGL_CTX_LINE_COLOR_SELECTOR,
XGL_CTX_LINE_WIDTH_SCALE_FACTOR, and
XGL_CTX_LINE_STYLE. The default color selector,
XGL_LINE_COLOR_CONTEXT selector, and
XGL_LINE_PATTERNED are tested. The marker attribute
test program tests for default color selector, and context
color selector. The pick attribute test program tests
XGL_CTX_PICK_ID_1 and XGL_CTX_PICK_ID_2. These

attributes are changed in a single Pcache.
Attributes Tested: XGL_3D_CTX_SURF_FACE_CULL
                    XGL_3D_CTX_SURF_GEOM_NORMAL
                    XGL_CTX_SURF_FRONT_COLOR_SELECTOR
                    XGL_3D_CTX_SURF_BACK_COLOR_SELECTOR
                    XGL_CTX_SURF_FRONT_COLOR
                    XGL_3D_CTX_SURF_BACK_COLOR
                    XGL_3D_CTX_SURF_FRONT_ILLUMINATION
                    XGL_3D_CTX_SURF_BACK_ILLUMINATION
                    XGL_CTX_LINE_COLOR_SELECTOR
                    XGL_CTX_LINE_WIDTH_SCALE_FACTOR
                    XGL_CTX_LINE_STYLE
                    XGL_CTX_MARKER_COLOR_SELECTOR
                    XGL_CTX_PICK_ID_1
                    XGL_CTX_PICK_ID_2
Operators Tested:   xgl_object_create
                    xgl_object_set
                    xgl_context_new_frame
                    xgl_pcache_display
                    xgl_multi_simple_polygon
                    xgl_multipolyline
                    xgl_multimarker
                    xgl_pick_get_identifiers
Output:             Multi-colored cubes, lines, and "+" markers