diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-30 17:28:21 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-12 08:29:48 +0100 |
commit | af9fbd176b145f042408ef5391eef2a51d7531f8 (patch) | |
tree | 5f75d1087d4325a013af6f0a4204a666fb4ca4f0 /src/cairo-spans-private.h | |
parent | 0540bf384aed344899417d3b0313bd6704679c1c (diff) |
Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
Diffstat (limited to 'src/cairo-spans-private.h')
-rw-r--r-- | src/cairo-spans-private.h | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/src/cairo-spans-private.h b/src/cairo-spans-private.h index 00a4df86..c42b5afa 100644 --- a/src/cairo-spans-private.h +++ b/src/cairo-spans-private.h @@ -36,11 +36,9 @@ /* A structure representing an open-ended horizontal span of constant * pixel coverage. */ typedef struct _cairo_half_open_span { - /* The inclusive x-coordinate of the start of the span. */ - int x; - - /* The pixel coverage for the pixels to the right. */ - int coverage; + int32_t x; /* The inclusive x-coordinate of the start of the span. */ + uint8_t coverage; /* The pixel coverage for the pixels to the right. */ + uint8_t inverse; /* between regular mask and clip */ } cairo_half_open_span_t; /* Span renderer interface. Instances of renderers are provided by @@ -73,17 +71,6 @@ struct _cairo_scan_converter { /* Destroy this scan converter. */ cairo_destroy_func_t destroy; - /* Add a single edge to the converter. */ - cairo_status_t (*add_edge) (void *abstract_converter, - const cairo_point_t *p1, - const cairo_point_t *p2, - int top, int bottom, - int dir); - - /* Add a polygon (set of edges) to the converter. */ - cairo_status_t (*add_polygon) (void *abstract_converter, - const cairo_polygon_t *polygon); - /* Generates coverage spans for rows for the added edges and calls * the renderer function for each row. After generating spans the * only valid thing to do with the converter is to destroy it. */ @@ -101,13 +88,43 @@ _cairo_tor_scan_converter_create (int xmin, int ymin, int xmax, int ymax, - cairo_fill_rule_t fill_rule); + cairo_fill_rule_t fill_rule, + cairo_antialias_t antialias); +cairo_private cairo_status_t +_cairo_tor_scan_converter_add_polygon (void *converter, + const cairo_polygon_t *polygon); + +cairo_private cairo_scan_converter_t * +_cairo_tor22_scan_converter_create (int xmin, + int ymin, + int xmax, + int ymax, + cairo_fill_rule_t fill_rule, + cairo_antialias_t antialias); +cairo_private cairo_status_t +_cairo_tor22_scan_converter_add_polygon (void *converter, + const cairo_polygon_t *polygon); + +cairo_private cairo_scan_converter_t * +_cairo_mono_scan_converter_create (int xmin, + int ymin, + int xmax, + int ymax, + cairo_fill_rule_t fill_rule); +cairo_private cairo_status_t +_cairo_mono_scan_converter_add_polygon (void *converter, + const cairo_polygon_t *polygon); + +cairo_private cairo_scan_converter_t * +_cairo_clip_tor_scan_converter_create (cairo_clip_t *clip, + cairo_polygon_t *polygon, + cairo_fill_rule_t fill_rule, + cairo_antialias_t antialias); typedef struct _cairo_rectangular_scan_converter { cairo_scan_converter_t base; - int xmin, xmax; - int ymin, ymax; + cairo_box_t extents; struct _cairo_rectangular_scan_converter_chunk { struct _cairo_rectangular_scan_converter_chunk *next; |