[PATCH 11/16] glamor: Use glamor_program and GL_LINES for 0-width lines

Keith Packard keithp at keithp.com
Tue Apr 1 21:15:51 PDT 2014


GL lines are nearly X compliant; you just need to fill in the last
pixel when the client hasn't requested CapNotLast.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 glamor/Makefile.am        |   4 +-
 glamor/glamor_lines.c     | 179 ++++++++++++++++++++++++++++++++++++++++++++++
 glamor/glamor_polylines.c | 136 -----------------------------------
 glamor/glamor_priv.h      |  26 ++++---
 glamor/glamor_segment.c   |  39 ----------
 glamor/glamor_segs.c      | 169 +++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 366 insertions(+), 187 deletions(-)
 create mode 100644 glamor/glamor_lines.c
 delete mode 100644 glamor/glamor_polylines.c
 delete mode 100644 glamor/glamor_segment.c
 create mode 100644 glamor/glamor_segs.c

diff --git a/glamor/Makefile.am b/glamor/Makefile.am
index 31e5f72..9a2b949 100644
--- a/glamor/Makefile.am
+++ b/glamor/Makefile.am
@@ -14,9 +14,9 @@ libglamor_la_SOURCES = \
 	glamor_font.c \
 	glamor_glx.c \
 	glamor_glyphs.c \
-	glamor_polylines.c \
 	glamor_putimage.c \
-	glamor_segment.c \
+	glamor_lines.c \
+	glamor_segs.c \
 	glamor_render.c \
 	glamor_gradient.c \
 	glamor_prepare.c \
diff --git a/glamor/glamor_lines.c b/glamor/glamor_lines.c
new file mode 100644
index 0000000..738dff4
--- /dev/null
+++ b/glamor/glamor_lines.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright © 2014 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include "glamor_priv.h"
+#include "glamor_program.h"
+#include "glamor_transform.h"
+#include "glamor_prepare.h"
+
+static const glamor_facet glamor_facet_poly_lines = {
+    .name = "poly_lines",
+    .vs_vars = "attribute vec2 primitive;\n",
+    .vs_exec = ("       vec2 pos = vec2(0.0,0.0);\n"
+                GLAMOR_POS(gl_Position, primitive.xy)),
+};
+
+static Bool
+glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc,
+                     int mode, int n, DDXPointPtr points)
+{
+    ScreenPtr screen = drawable->pScreen;
+    glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+    PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
+    glamor_pixmap_private *pixmap_priv;
+    glamor_program *prog;
+    int off_x, off_y;
+    DDXPointPtr v;
+    char *vbo_offset;
+    int box_x, box_y;
+    int add_last;
+
+    pixmap_priv = glamor_get_pixmap_private(pixmap);
+    if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
+        goto bail;
+
+    if (gc->lineWidth != 0)
+        goto bail;
+
+    if (gc->lineStyle != LineSolid)
+        goto bail;
+
+    add_last = 0;
+    if (gc->capStyle != CapNotLast)
+        add_last = 1;
+
+    if (n < 2)
+        return TRUE;
+
+    glamor_get_context(glamor_priv);
+
+    prog = glamor_use_program_fill(pixmap, gc,
+                                   &glamor_priv->poly_line_program,
+                                   &glamor_facet_poly_lines);
+
+    if (!prog)
+        goto bail_ctx;
+
+    /* Set up the vertex buffers for the points */
+
+    v = glamor_get_vbo_space(drawable->pScreen, (n + add_last) * sizeof (DDXPointRec), &vbo_offset);
+
+    glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
+    glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE,
+                          sizeof (DDXPointRec), vbo_offset);
+
+    if (mode == CoordModePrevious) {
+        int i;
+        DDXPointRec here = { 0, 0 };
+
+        for (i = 0; i < n; i++) {
+            here.x += points[i].x;
+            here.y += points[i].y;
+            v[i] = here;
+        }
+    } else {
+        memcpy(v, points, n * sizeof (DDXPointRec));
+    }
+
+    if (add_last) {
+        v[n].x = v[n-1].x + 1;
+        v[n].y = v[n-1].y;
+    }
+
+    glamor_put_vbo_space(screen);
+
+    glEnable(GL_SCISSOR_TEST);
+
+    glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+        int nbox = RegionNumRects(gc->pCompositeClip);
+        BoxPtr box = RegionRects(gc->pCompositeClip);
+
+        glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y);
+
+        while (nbox--) {
+            glScissor(box->x1 + off_x,
+                      box->y1 + off_y,
+                      box->x2 - box->x1,
+                      box->y2 - box->y1);
+            box++;
+            glDrawArrays(GL_LINE_STRIP, 0, n + add_last);
+        }
+    }
+
+    glDisable(GL_SCISSOR_TEST);
+    glDisable(GL_COLOR_LOGIC_OP);
+    glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
+
+    glamor_put_context(glamor_priv);
+    return TRUE;
+bail_ctx:
+    glDisable(GL_COLOR_LOGIC_OP);
+    glamor_put_context(glamor_priv);
+bail:
+    return FALSE;
+}
+
+static void
+glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc,
+                       int mode, int n, DDXPointPtr points)
+{
+    glamor_fallback("to %p (%c)\n", drawable,
+                    glamor_get_drawable_location(drawable));
+
+    if (gc->lineWidth == 0) {
+        if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+            glamor_prepare_access_gc(gc)) {
+            fbPolyLine(drawable, gc, mode, n, points);
+        }
+        glamor_finish_access_gc(gc);
+        glamor_finish_access(drawable);
+    } else {
+        if (gc->lineStyle != LineSolid)
+            miWideDash(drawable, gc, mode, n, points);
+        else
+            miWideLine(drawable, gc, mode, n, points);
+    }
+}
+
+void
+glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
+                  int mode, int n, DDXPointPtr points)
+{
+    if (glamor_poly_lines_gl(drawable, gc, mode, n, points))
+        return;
+    glamor_poly_lines_bail(drawable, gc, mode, n, points);
+}
+
+Bool
+glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc,
+                     int mode, int n, DDXPointPtr points)
+{
+    if (glamor_poly_lines_gl(drawable, gc, mode, n, points))
+        return TRUE;
+
+    if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
+        return FALSE;
+
+    glamor_poly_lines_bail(drawable, gc, mode, n, points);
+    return TRUE;
+}
+
diff --git a/glamor/glamor_polylines.c b/glamor/glamor_polylines.c
deleted file mode 100644
index 1adf45d..0000000
--- a/glamor/glamor_polylines.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright © 2009 Intel Corporation
- * Copyright © 1998 Keith Packard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *    Eric Anholt <eric at anholt.net>
- *
- */
-
-#include "glamor_priv.h"
-
-/** @file glamor_polylines.c
- *
- * GC PolyFillRect implementation, taken straight from fb_fill.c
- */
-
-/**
- * glamor_poly_lines() checks if it can accelerate the lines as a group of
- * horizontal or vertical lines (rectangles), and uses existing rectangle fill
- * acceleration if so.
- */
-static Bool
-_glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
-                   DDXPointPtr points, Bool fallback)
-{
-    xRectangle *rects;
-    int x1, x2, y1, y2;
-    int i;
-
-    /* Don't try to do wide lines or non-solid fill style. */
-    if (gc->lineWidth != 0) {
-        /* This ends up in miSetSpans, which is accelerated as well as we
-         * can hope X wide lines will be.
-         */
-        goto fail;
-    }
-
-    if (gc->lineStyle != LineSolid) {
-        glamor_fallback("non-solid fill line style %d\n", gc->lineStyle);
-        goto fail;
-    }
-    rects = malloc(sizeof(xRectangle) * (n - 1));
-    x1 = points[0].x;
-    y1 = points[0].y;
-    /* If we have any non-horizontal/vertical, fall back. */
-    for (i = 0; i < n - 1; i++) {
-        if (mode == CoordModePrevious) {
-            x2 = x1 + points[i + 1].x;
-            y2 = y1 + points[i + 1].y;
-        }
-        else {
-            x2 = points[i + 1].x;
-            y2 = points[i + 1].y;
-        }
-        if (x1 != x2 && y1 != y2) {
-            free(rects);
-            glamor_fallback("stub diagonal poly_line\n");
-            goto fail;
-        }
-        if (x1 < x2) {
-            rects[i].x = x1;
-            rects[i].width = x2 - x1 + 1;
-        }
-        else {
-            rects[i].x = x2;
-            rects[i].width = x1 - x2 + 1;
-        }
-        if (y1 < y2) {
-            rects[i].y = y1;
-            rects[i].height = y2 - y1 + 1;
-        }
-        else {
-            rects[i].y = y2;
-            rects[i].height = y1 - y2 + 1;
-        }
-
-        x1 = x2;
-        y1 = y2;
-    }
-    gc->ops->PolyFillRect(drawable, gc, n - 1, rects);
-    free(rects);
-    return TRUE;
-
- fail:
-    if (!fallback && glamor_ddx_fallback_check_pixmap(drawable)
-        && glamor_ddx_fallback_check_gc(gc))
-        return FALSE;
-
-    switch (gc->lineStyle) {
-    case LineSolid:
-        if (gc->lineWidth == 0)
-            miZeroLine(drawable, gc, mode, n, points);
-        else
-            miWideLine(drawable, gc, mode, n, points);
-        break;
-    case LineOnOffDash:
-    case LineDoubleDash:
-        miWideDash(drawable, gc, mode, n, points);
-        break;
-    }
-
-    return TRUE;
-}
-
-void
-glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
-                  DDXPointPtr points)
-{
-    _glamor_poly_lines(drawable, gc, mode, n, points, TRUE);
-}
-
-Bool
-glamor_poly_lines_nf(DrawablePtr drawable, GCPtr gc, int mode, int n,
-                     DDXPointPtr points)
-{
-    return _glamor_poly_lines(drawable, gc, mode, n, points, FALSE);
-}
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 60e7569..a2da020 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -242,6 +242,12 @@ typedef struct glamor_screen_private {
     glamor_program      copy_area_prog;
     glamor_program      copy_plane_prog;
 
+    /* glamor line shader */
+    glamor_program_fill poly_line_program;
+
+    /* glamor segment shaders */
+    glamor_program_fill poly_segment_program;
+
     /* vertext/elment_index buffer object for render */
     GLuint vbo, ebo;
     /** Next offset within the VBO that glamor_get_vbo_space() will use. */
@@ -691,10 +697,6 @@ void glamor_glyphs(CARD8 op,
                    INT16 xSrc,
                    INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr *glyphs);
 
-/* glamor_polylines.c */
-void glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n,
-                       DDXPointPtr points);
-
 /* glamor_putimage.c */
 void glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
                       int w, int h, int leftPad, int format, char *bits);
@@ -976,6 +978,16 @@ void
 glamor_poly_fill_rect(DrawablePtr drawable,
                       GCPtr gc, int nrect, xRectangle *prect);
 
+/*  glamor_lines.c */
+void
+glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
+                  int mode, int n, DDXPointPtr points);
+
+/*  glamor_segs.c */
+void
+glamor_poly_segment(DrawablePtr drawable, GCPtr gc,
+                    int nseg, xSegment *segs);
+
 /* glamor_copy.c */
 void
 glamor_copy(DrawablePtr src,
@@ -1017,12 +1029,6 @@ void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
 void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
                        DDXPointPtr ppt);
 
-void glamor_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
-                         xSegment *pSeg);
-
-void glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
-                      DDXPointPtr ppt);
-
 void glamor_composite_rectangles(CARD8 op,
                                  PicturePtr dst,
                                  xRenderColor *color,
diff --git a/glamor/glamor_segment.c b/glamor/glamor_segment.c
deleted file mode 100644
index 84b27ac..0000000
--- a/glamor/glamor_segment.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright © 2014 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  The copyright holders make no representations
- * about the suitability of this software for any purpose.  It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "glamor_priv.h"
-
-Bool
-glamor_poly_segment_nf(DrawablePtr drawable, GCPtr gc, int nseg,
-                       xSegment *seg)
-{
-    return FALSE;
-}
-
-void
-glamor_poly_segment(DrawablePtr drawable, GCPtr gc, int nseg,
-                    xSegment *seg)
-{
-    if (glamor_poly_segment_nf(drawable, gc, nseg, seg))
-        return;
-    miPolySegment(drawable, gc, nseg, seg);
-}
diff --git a/glamor/glamor_segs.c b/glamor/glamor_segs.c
new file mode 100644
index 0000000..fbbd6f2
--- /dev/null
+++ b/glamor/glamor_segs.c
@@ -0,0 +1,169 @@
+/*
+ * Copyright © 2014 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include "glamor_priv.h"
+#include "glamor_program.h"
+#include "glamor_transform.h"
+#include "glamor_prepare.h"
+
+static const glamor_facet glamor_facet_poly_segment = {
+    .name = "poly_segment",
+    .vs_vars = "attribute vec2 primitive;\n",
+    .vs_exec = ("       vec2 pos = vec2(0.0,0.0);\n"
+                GLAMOR_POS(gl_Position, primitive.xy)),
+};
+
+static Bool
+glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc,
+                       int nseg, xSegment *segs)
+{
+    ScreenPtr screen = drawable->pScreen;
+    glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+    PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
+    glamor_pixmap_private *pixmap_priv;
+    glamor_program *prog;
+    int off_x, off_y;
+    xSegment *v;
+    char *vbo_offset;
+    int box_x, box_y;
+    int add_last;
+
+    pixmap_priv = glamor_get_pixmap_private(pixmap);
+    if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
+        goto bail;
+
+    if (gc->lineWidth != 0)
+        goto bail;
+
+    if (gc->lineStyle != LineSolid)
+        goto bail;
+
+    add_last = 0;
+    if (gc->capStyle != CapNotLast)
+        add_last = 1;
+
+    glamor_get_context(glamor_priv);
+
+    prog = glamor_use_program_fill(pixmap, gc,
+                                   &glamor_priv->poly_segment_program,
+                                   &glamor_facet_poly_segment);
+
+    if (!prog)
+        goto bail_ctx;
+
+    /* Set up the vertex buffers for the points */
+
+    v = glamor_get_vbo_space(drawable->pScreen, (nseg<<add_last) * sizeof (xSegment), &vbo_offset);
+
+    glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
+    glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE,
+                          sizeof(DDXPointRec), vbo_offset);
+
+    if (add_last) {
+        int i, j;
+        for (i = 0, j=0; i < nseg; i++) {
+            v[j++] = segs[i];
+            v[j].x1 = segs[i].x2;
+            v[j].y1 = segs[i].y2;
+            v[j].x2 = segs[i].x2+1;
+            v[j].y2 = segs[i].y2;
+            j++;
+        }
+    } else
+        memcpy(v, segs, nseg * sizeof (xSegment));
+
+    glamor_put_vbo_space(screen);
+
+    glEnable(GL_SCISSOR_TEST);
+
+    glamor_pixmap_loop(pixmap_priv, box_x, box_y) {
+        int nbox = RegionNumRects(gc->pCompositeClip);
+        BoxPtr box = RegionRects(gc->pCompositeClip);
+
+        glamor_set_destination_drawable(drawable, box_x, box_y, TRUE, TRUE, prog->matrix_uniform, &off_x, &off_y);
+
+        while (nbox--) {
+            glScissor(box->x1 + off_x,
+                      box->y1 + off_y,
+                      box->x2 - box->x1,
+                      box->y2 - box->y1);
+            box++;
+            glDrawArrays(GL_LINES, 0, nseg << (1 + add_last));
+        }
+    }
+
+    glDisable(GL_SCISSOR_TEST);
+    glDisable(GL_COLOR_LOGIC_OP);
+    glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
+
+    glamor_put_context(glamor_priv);
+    return TRUE;
+bail_ctx:
+    glDisable(GL_COLOR_LOGIC_OP);
+    glamor_put_context(glamor_priv);
+bail:
+    return FALSE;
+}
+
+static void
+glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc,
+                         int nseg, xSegment *segs)
+{
+    glamor_fallback("to %p (%c)\n", drawable,
+                    glamor_get_drawable_location(drawable));
+
+    if (gc->lineWidth == 0) {
+        if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
+            glamor_prepare_access_gc(gc)) {
+            fbPolySegment(drawable, gc, nseg, segs);
+        }
+        glamor_finish_access_gc(gc);
+        glamor_finish_access(drawable);
+    } else
+        miPolySegment(drawable, gc, nseg, segs);
+}
+
+
+void
+glamor_poly_segment(DrawablePtr drawable, GCPtr gc,
+                    int nseg, xSegment *segs)
+{
+    if (glamor_poly_segment_gl(drawable, gc, nseg, segs))
+        return;
+
+    glamor_poly_segment_bail(drawable, gc, nseg, segs);
+}
+
+Bool
+glamor_poly_segment_nf(DrawablePtr drawable, GCPtr gc,
+                       int nseg, xSegment *segs)
+{
+    if (glamor_poly_segment_gl(drawable, gc, nseg, segs))
+        return TRUE;
+
+    if (glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc))
+        return FALSE;
+
+    glamor_poly_segment_bail(drawable, gc, nseg, segs);
+    return TRUE;
+}
+
-- 
1.9.0



More information about the xorg-devel mailing list