[cairo-commit] src/cairo-botor-scan-converter.c src/cairo-spans-private.h

Bryce Harrington bryce at kemper.freedesktop.org
Wed Jan 13 17:09:00 PST 2016


 src/cairo-botor-scan-converter.c |   36 ++++++++++++++++++++++++++++++++++++
 src/cairo-spans-private.h        |    4 ++++
 2 files changed, 40 insertions(+)

New commits:
commit b371b0157f8067b93c95cb535922705af5c0cd25
Author: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
Date:   Tue Dec 29 10:16:40 2015 +0100

    core: reintroduce bot-scan-converter functions
    
    These functions have been accidentially removed by commit:
    494cfd7eb9d994a5e2024e299986e66a3ef9a562.
    
    They're still needed by the DRM backend.
    (will be used by subsequent patches)
    
    Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
    Cc: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-botor-scan-converter.c b/src/cairo-botor-scan-converter.c
index 515305b..e23aefe 100644
--- a/src/cairo-botor-scan-converter.c
+++ b/src/cairo-botor-scan-converter.c
@@ -2128,6 +2128,42 @@ botor_add_edge (cairo_botor_scan_converter_t *self,
     return CAIRO_STATUS_SUCCESS;
 }
 
+static cairo_status_t
+_cairo_botor_scan_converter_add_edge (void		*converter,
+				      const cairo_point_t *p1,
+				      const cairo_point_t *p2,
+				      int top, int bottom,
+				      int dir)
+{
+    cairo_botor_scan_converter_t *self = converter;
+    cairo_edge_t edge;
+
+    edge.line.p1 = *p1;
+    edge.line.p2 = *p2;
+    edge.top = top;
+    edge.bottom = bottom;
+    edge.dir = dir;
+
+    return botor_add_edge (self, &edge);
+}
+
+cairo_status_t
+_cairo_botor_scan_converter_add_polygon (cairo_botor_scan_converter_t *converter,
+					 const cairo_polygon_t *polygon)
+{
+    cairo_botor_scan_converter_t *self = converter;
+    cairo_status_t status;
+    int i;
+
+    for (i = 0; i < polygon->num_edges; i++) {
+	status = botor_add_edge (self, &polygon->edges[i]);
+	if (unlikely (status))
+	    return status;
+    }
+
+    return CAIRO_STATUS_SUCCESS;
+}
+
 static void
 _cairo_botor_scan_converter_destroy (void *converter)
 {
diff --git a/src/cairo-spans-private.h b/src/cairo-spans-private.h
index b158f4d..653183f 100644
--- a/src/cairo-spans-private.h
+++ b/src/cairo-spans-private.h
@@ -168,6 +168,10 @@ _cairo_botor_scan_converter_init (cairo_botor_scan_converter_t *self,
 				  const cairo_box_t *extents,
 				  cairo_fill_rule_t fill_rule);
 
+cairo_private cairo_status_t
+_cairo_botor_scan_converter_add_polygon (cairo_botor_scan_converter_t *converter,
+					const cairo_polygon_t *polygon);
+
 /* cairo-spans.c: */
 
 cairo_private cairo_scan_converter_t *


More information about the cairo-commit mailing list