XGL Test Suite User's Guide
この本のみを検索
PDF 文書ファイルをダウンロードする

Raster Test Descriptions

21

This chapter describes the Raster 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
· ras_attr1
Test Types:INDEX, SM
Description:Creates a window raster and verifies the values of various window raster attributes
Attributes Tested: XGL_RAS_WIDTH
XGL_WIN_RAS_BUFFERS_REQUESTED
XGL_WIN_RAS_BUF_DISPLAY
XGL_WIN_RAS_BUF_DRAW
XGL_WIN_RAS_BUF_MIN_DELAY
XGL_WIN_RAS_POSITION
XGL_WIN_RAS_TYPE

Operators Tested: xgl_object_create
                    xgl_object_get
Output:             Nothing is displayed.

· ras_attr2
Test Types:INDEX, SM
Description:Creates a memory raster and verifies the values of various memory raster attributes
Attributes Tested: XGL_MEM_RAS
                    XGL_MEM_RAS_IMAGE_BUFFER_ADDR
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_create
                    xgl_object_get
Output:             Nothing is displayed.

· ras_copy
Test Types:INDEX, SM
Description:Tests that xgl_context_copy_raster() can be used to copy a block of pixels from one raster to another raster
Attributes Tested: XGL_CTX_MARKER
XGL_RAS_WIDTH

Operators Tested: xgl_context_copy_raster
Output:· ras_opA green asterisk; first in upper-left corner, then in center
Test Types:INDEX, SM
Description:Sets the XGL_CTX_ROP attribute to various raster operation modes and uses overlapping primitives to verify the correct raster operations are done
Attributes Tested: XGL_CTX_LINE_COLOR
                    XGL_CTX_LINE_WIDTH_SCALE_FACTOR
                    XGL_CTX_ROP
                    XGL_CTX_SURF_FRONT_COLOR
                    XGL_RAS_DEPTH
Operators Tested:   xgl_object_set
                    xgl_context_new_frame
                    xgl_polygon
                    xgl_multipolyline
Output:             A red polygon obscured by a smaller, wider polygon
                    which is ropped in the various modes

· ras_copy2
Test Types:INDEX, SM
Description:Tests the XGL_CTX_RASTER_FILL_STYLE,
XGL_CTX_RASTER_FPAT_POSITION,· plane_mask
Test Types:INDEX, SM
Description:Tests the XGL_CTX_PLANE_MASK attribute
Attributes Tested: XGL_CTX_PLANE_MASK
XGL_CTX_SURF_FRONT_COLOR
XGL_DEV_COLOR_MAP
XGL_RAS_DEPTH

Operators Tested: xgl_object_set
                    xgl_polygon
Output:             A red quad polygon that changes to green (the
                    background color)

· ras0
Test Types:INDEX, SM
Description:Tests device attributes: XGL_DEV_CONTEXTS, XGL_DEV_CONTEXTS_NUM, and XGL_DEV_MAXIMUM_COORDINATES. The device is attached to a 2D context.
Attributes Tested: XGL_DEV_CONTEXTS
                    XGL_DEV_CONTEXTS_NUM
                    XGL_DEV_MAXIMUM_COORDINATES
Operators Tested:   xgl_object_set
                    xgl_object_get
Output:             Nothing is displayed.

· ras1
Test Types:SM
Description:Tests the device attributes XGL_DEV_CONTEXTS, XGL_DEV_CONTEXTS_NUM, and XGL_DEV_MAXIMUM_COORDINATES of a memory raster. The raster is attached to a 3D context.
Attributes Tested: XGL_DEV_CONTEXTS
                    XGL_DEV_CONTEXTS_NUM
                    XGL_DEV_MAXIMUM_COORDINATES
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_set
                    xgl_object_get
Output:             Nothing is displayed.

· ras_attr3
Test Types:RGB, SM
Description:Creates an RGB window raster and verifies the values of various window raster attributes
Attributes Tested: XGL_WIN_RAS_BUFFERS_ALLOCATED

Operators Tested: xgl_object_create
Output:· ras_attr4Nothing is displayed.
Test Types:RGB, SM
Description:Creates an RGB memory raster and verifies the values of various memory raster attributes
Attributes Tested: XGL_MEM_RAS_IMAGE_BUFFER_ADDR
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_create
                    xgl_object_get
Output:             Nothing is displayed.

· ras_copy3
Test Types:RGB, SM
Description:Tests that xgl_context_copy_raster() can be used to copy a block of pixels from one RGB raster to another raster
Attributes Tested: XGL_CTX_MARKER
XGL_CTX_MARKER_COLOR
XGL_CTX_MARKER_SCALE_FACTOR
XGL_CTX_STEXT_CHAR_HEIGHT
XGL_CTX_STEXT_COLOR

                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_context_copy_raster
                    xgl_multimarker
                    xgl_stroke_text
Output:             A marker (green asterisk) and text that reads "XGL" with

the G and L upside down. The text is red.
· ras_copy4
Test Types:RGB, SM
Description:Tests the XGL_CTX_RASTER_FILL_STYLE,
                    XGL_CTX_RASTER_FPAT_POSITION,
                    XGL_CTX_RASTER_FPAT, and
                    XGL_CTX_RASTER_STIPPLE_COLOR attributes using an
                    RGB raster
Attributes Tested:  XGL_CTX_BACKGROUND_COLOR
                    XGL_CTX_RASTER_FILL_STYLE
                    XGL_CTX_RASTER_FPAT
                    XGL_CTX_RASTER_FPAT_POSITION
                    XGL_CTX_RASTER_STIPPLE_COLOR
                    XGL_CTX_SURF_FRONT_COLOR
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_set
                    xgl_context_copy_raster
                    xgl_polygon
Output:             A larger red stipple-filled red quad with a smaller olive
                    green polygon to its right

· ras3
Test Types:INDEX, SM
Description:Tests simple double-buffering (indexed mode, set buffer)
Attributes Tested: XGL_WIN_RAS_BUFFERS_ALLOCATED
                    XGL_WIN_RAS_BUFFERS_REQUESTED
                    XGL_WIN_RAS_BUF_DISPLAY
                    XGL_WIN_RAS_BUF_DRAW
                    XGL_WIN_RAS_BUF_MIN_DELAY
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_context_new_frame
                    xgl_context_set_pixel
                    xgl_multipolyline
                    xgl_inquire
Output:             A 100x100 window displays alternately a line and
                    polygon. The foreground is white.

· ras4
Test Types:INDEX, SM
Description:Double-buffering: all combinations of draw and display buffers, switching using explicit buffer settings
Attributes Tested: XGL_CTX_NEW_FRAME_ACTION

Operators Tested: xgl_object_set
xgl_multiarc
xgl_stroke_text
xgl_multirectangle
xgl_inquire

Output:.....A quarter arc, a four-pointed object, and XGL text
· ras5
Test Types:INDEX, SM
Description:Xlib rendering on XGL double-buffered windows
Attributes Tested: XGL_CTX_NEW_FRAME_ACTION
                    (XGL_CTX_NEW_FRAME_CLEAR |
                    XGL_CTX_NEW_FRAME_SWITCH_BUFFER)
                    XGL_WIN_RAS_BUFFERS_ALLOCATED
                    XGL_WIN_RAS_BUFFERS_REQUESTED
                    XGL_WIN_RAS_BUF_DISPLAY
                    XGL_WIN_RAS_BUF_DRAW
                    XGL_WIN_RAS_PIXEL_MAPPING
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_context_new_frame
                    xgl_inquire
Output:             A white horizontal line.

· ras6
Test Types:INDEX, SM
Description:Tests the interleaving of XGL and Xlib rendering. This test uses Xlib to render lines on the same index raster XGL is rendering polygons. All rendering is done in white/black foreground/background for simplicity. This test exits if it determines the visual is not equal to PseudoColor (index). The Xlib primitive is checked via Xlib.
Attributes Tested: XGL_DEV_COLOR_TYPE
Operators Tested: xgl_context_new_frame
                    xgl_context_post
                    xgl_context_flush
                    xgl_polygon
Output:             Repeated rendering of five horizontal lines, with five quad
                    polygons to the right of the lines

· ras_pix
Test Types:INDEX, SM
Description:Tests simple indexed xgl_context_set_multi_pixel rendering. Renders a diagonal line, then a rectangle.
Attributes Tested: XGL_CMAP_COLOR_TABLE
                    XGL_CMAP_COLOR_TABLE_SIZE
                    XGL_CTX_BACKGROUND_COLOR
                    XGL_CTX_DEFERRAL_MODE (XGL_DEFER_ASAP)
                    XGL_DEV_COLOR_MAP
Operators Tested:   xgl_context_set_multi_pixel
Output:             A red diagonal line and a green polygon on a blue
                    background

· ras_pix_rgb
Test Types:RGB, SM
Description:Tests simple xgl_context_set_multi_pixel rendering with RGB color model; renders a line and a rectangle using xgl_context_set_multi_pixel()
Attributes Tested: XGL_CTX_BACKGROUND_COLOR
Operators Tested: xgl_context_set_multi_pixel
Output:· ras_pix_rowA red diagonal line and a green polygon on a blue background, but only if you're using an RGB system. Otherwise nothing is displayed.
Test Types:INDEX, SM
Description:Tests xgl_context_set_pixel_row with different columns, rows, and lengths using an indexed color model
Attributes Tested: XGL_CMAP_COLOR_TABLE
                    XGL_CMAP_COLOR_TABLE_SIZE
                    XGL_CTX_BACKGROUND_COLOR
                    XGL_DEV_COLOR_MAP
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_context_set_pixel_row
Output:             A dozen or so red horizontal lines of varying length

· ras_pix_row_rgb
Test Types:SM, RGB
Description:Tests xgl_context_set_pixel_row with different columns, rows, and lengths using an RGB color model
Attributes Tested: XGL_CTX_BACKGROUND_COLOR
XGL_RAS_WIDTH

Operators Tested: xgl_context_set_pixel_row
Output:· image_tgA dozen or so red horizontal lines of varying length, but only if you're using RGB hardware; otherwise nothing is displayed.
Test Types:SM
Description:Tests xgl_image operator with 3D context and HLHSR values set to Z-buffer then none. Images with 1-, 8-, and 32-bit are tested.
Attributes Tested: XGL_3D_CTX_HLHSR_MODE
                    XGL_CTX_DC_VIEWPORT
                    XGL_CTX_VDC_MAP
                    XGL_CTX_VDC_ORIENTATION
                    XGL_CTX_VDC_WINDOW
                    XGL_MEM_RAS_IMAGE_BUFFER_ADDR
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_image
Output:             Nine frames of two red rectangles

· cp_ras_multi_ctx
Test Types:INDEX, CM
Description:The main purpose of the test is to test multiple memory rasters and multiple contexts; stretch resources. Each memory raster has a different dimension, a different size/color line drawn into it. This test then copies these unique characteristics to different offsets within the same window raster.
Attributes Tested: XGL_CMAP_COLOR_TABLE
                    XGL_CMAP_COLOR_TABLE_SIZE
                    XGL_DEV_COLOR_MAP
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_create
                    xgl_context_set_pixel_row
                    xgl_context_copy_raster
Output:             Various horizontal lines, all of different colors

· xgl_img_2d
Test Types:INDEX, CM
Description:Tests xgl_image in 2D, index color. This test renders polygons to four different-sized 8-bit memory rasters, then copies the memory rasters to the default depth window raster via xgl_image in a replrop (repeated) manner. The four memory rasters each have their own context. The final case tests window clipping of xgl_image where DC coordinates end; that is, only ~20 will fit, but 30 are rendered, some in coordinates outside of the window.
Attributes Tested: XGL_CMAP_COLOR_TABLE
XGL_CMAP_COLOR_TABLE_SIZE
XGL_CTX_SURF_FRONT_COLOR
XGL_DEV_COLOR_MAP
XGL_RAS_DEPTH
XGL_RAS_HEIGHT
XGL_RAS_WIDTH

Operators Tested: xgl_object_create
                    xgl_polygon
                    xgl_image
Output:             First row, 3 red stars; second row, 4 blue boomerangs;

third row, 5 yellow quads; fourth row, 13 green triangles
· xgl_img_2d_32
Test Types:RGB, CM
Description:Tests xgl_image in 2D with RGB rasters. Draws polygons on different-sized 32-bit memory rasters, then copies the memory rasters to the default depth window raster via xgl_image in a replrop (repeated) manner. This was adapted from xgl_img_2d, but exercises RGB instead of INDEX, and 32-bit memory raster instead of 8-bit. The last test is window clipping of xgl_image where DC coordinates end; that is, only ~20 will fit, but 30 are rendered, some in coordinates outside of the window.
Attributes Tested: XGL_CTX_SURF_FRONT_COLOR
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_create
                    xgl_polygon
                    xgl_image
Output:             First row, 3 red stars; second row, 4 blue boomerangs;

third row, 5 yellow quads; fourth row, 13 green triangles
· xgl_img_rect
Test Types:INDEX, CM
Description:Tests xgl_image in 2D, exercising clipping (that is, only copying regions) of memory rasters to the window raster. This creates three memory rasters, each of a different size. This test renders a polygon to each memory raster, then uses xgl_image to copy it back to the window raster. Only regions of the memory rasters are replroped (repeated) across.
Attributes Tested: XGL_CMAP_COLOR_TABLE
                    XGL_CMAP_COLOR_TABLE_SIZE
                    XGL_DEV_COLOR_MAP
                    XGL_RAS_DEPTH
                    XGL_RAS_HEIGHT
                    XGL_RAS_WIDTH
Operators Tested:   xgl_object_create
                    xgl_polygon
                    xgl_image
Output:             Red, blue, and yellow polygons; some three-, four-, and
                    five-sided

· cp_ras_32
Test Types:CM, RGB
Description:Tests copy_raster with 32-bit RGB rasters. Draws polygons on different-sized 32-bit memory rasters, then copies the memory rasters to the default depth window raster via copy_raster in a replrop (repeated) manner. This was adapted from xgl_img_2d_32, but uses copy_raster instead of xgl_image.
Attributes Tested: XGL_CTX_SURF_FRONT_COLOR
XGL_RAS_WIDTH

Operators Tested: xgl_object_create
Output:· copy_buffer0First row, 3 red stars; second row, 4 blue boomerangs; third row, 5 yellow quads; fourth row, 13 green triangles
Test Types:INDEX, CM
Description:Tests simple copy buffer operations using a 2D context. Creates two buffers. Draws to 0th, then copies and renders to buffer 1 twice.
Attributes Tested: XGL_CTX_RENDER_BUFFER
XGL_RAS_SOURCE_BUFFER
XGL_WIN_RAS_BUFFERS_ALLOCATED

                    XGL_WIN_RAS_BUFFERS_REQUESTED
                    XGL_WIN_RAS_BUF_DISPLAY
                    XGL_WIN_RAS_BUF_DRAW
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_context_copy_buffer
                    xgl_context_flush
Output:             A diagonal line and quad polygon. The polygon is
                    translated to the lower right.

· copy_buffer1
Test Types:INDEX, CM
Description:Tests simple copy buffer operations using a 3D context. Creates two buffers. Buffer 1 is the draw buffer, 0 is the display buffer. Draws, then copy_buffer to 0; draws again and copies again.
Attributes Tested: XGL_CTX_RENDER_BUFFER
                    XGL_RAS_SOURCE_BUFFER
                    XGL_WIN_RAS_BUFFERS_ALLOCATED
                    XGL_WIN_RAS_BUFFERS_REQUESTED
                    XGL_WIN_RAS_BUF_DISPLAY
                    XGL_WIN_RAS_BUF_DRAW
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_context_copy_buffer
                    xgl_context_flush
Output:             A white diagonal line and quad polygon. The polygon is
                    translated to the lower right.

· copy_buffer_ras_op
Test Types:RGB, CM
Description:Copies the buffer with different ROP operations
Attributes Tested: XGL_CTX_RENDER_BUFFER
XGL_CTX_ROP
XGL_CTX_SURF_FRONT_COLOR
XGL_RAS_SOURCE_BUFFER
XGL_WIN_RAS_BUFFERS_ALLOCATED

                    XGL_WIN_RAS_BUFFERS_REQUESTED
                    XGL_WIN_RAS_BUF_DISPLAY
                    XGL_WIN_RAS_BUF_DRAW
Operators Tested:   xgl_object_set
                    xgl_object_get
                    xgl_context_copy_buffer
                    xgl_polygon
Output:             Quad polygons, in different ROP modes. Notes from bug

1120966: because the clut will be in different states, the values being ropped are nondeterministic for the way the test is written, so the images can change but still be correct.
· win_backing_store
Test Types:INDEX, SM
Description:Tests backing store by creating a child window to use to obscure the parent window. Polygons are rendered to the parent, the child is mapped and unmapped, and polygons are checked.
Attributes Tested: XGL_CMAP_COLOR_TABLE
                    XGL_CMAP_COLOR_TABLE_SIZE
                    XGL_CTX_NEW_FRAME_ACTION
                    (XGL_CTX_NEW_FRAME_CLEAR)
                    XGL_DEV_COLOR_MAP
                    XGL_WIN_RAS_BACKING_STORE
Operators Tested:   xgl_context_new_frame
                    xgl_context_post
                    xgl_context_flush
                    xgl_multipolyline
                    xgl_multi_simple_polygon
Output:             A large red polygon, which is obscured four times by a
                    smaller window

· ras_copy5
Test Types:INDEX, SM
Description:Tests Fb->Fb copy by rendering to the screen and then copying
Attributes Tested: XGL_CTX_MARKER
                    XGL_CTX_MARKER_SCALE_FACTOR
                    XGL_CTX_MARKER_COLOR
                    XGL_CTX_LINE_COLOR
                    XGL_CTX_ROP
Operators Tested:   xgl_object_set
                    xgl_context_copy_raster
                    xgl_multimarker
                    xgl_multipolyline
Output:             A green "*" marker is drawn, at 100,100 surrounded by a

green 100.100 square and a red 102.102 square (the two squares together look yellow). The green marker and square are then copied to 50,350. All green pixels and no red pixels should be copied. The two squares are then copied to the right to make four. Finally, an overlapping copy with XGL_CTX_ROP set to XGL_ROP_OR should result in eight squares. This process is repeated for 2D and 3D contexts.
· ras_copy6
Test Types:INDEX, SM
Description:Tests Fb->Fb overlapping copy
Attributes Tested: XGL_CTX_MARKER
XGL_CTX_ROP

Operators Tested: xgl_object_set
Output:.....A green "*" marker is drawn, at 100,100 surrounded by a green 100.100 square. The square is then copied in an overlapping manner. This is done four times, for overlaps on all four sides of the square. In addition, another set of copies will attempt to copy the square over the edges of the window, to assure that window clipping works properly. This process is repeated for 2D and 3D contexts.
· ras_copy7
Test Types:INDEX, SM
Description:Tests Mem1->Fb copy
Attributes Tested: XGL_CTX_MARKER
                    XGL_CTX_MARKER_SCALE_FACTOR
                    XGL_CTX_MARKER_COLOR
                    XGL_CTX_SURF_FRONT_COLOR
                    XGL_CTX_BACKGROUND_COLOR
Operators Tested:   xgl_object_set
                    xgl_context_copy_raster
                    xgl_multimarker
                    xgl_multipolyline
Output:             A "*" marker is drawn into a 1-bit memory raster.  This
                    raster is then copied to the framebuffer with
                    xgl_context_copy_raster. The SURF_FRONT_COLOR

and BACKGROUND_COLOR are changed and a series of small copies are done at 1-pixel intervals to verify that the 1-bit to N-bit copy is performed correctly for all offsets and phases.