summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/glamor.h7
-rw-r--r--src/glamor_fill.c5
-rw-r--r--src/glamor_fillspans.c33
-rw-r--r--src/glamor_glyphs.c2
-rw-r--r--src/glamor_polyfillrect.c2
-rw-r--r--src/glamor_priv.h2
6 files changed, 41 insertions, 10 deletions
diff --git a/src/glamor.h b/src/glamor.h
index f9da4ad..e98d7d5 100644
--- a/src/glamor.h
+++ b/src/glamor.h
@@ -79,3 +79,10 @@ extern _X_EXPORT void glamor_egl_free_screen(int scrnIndex, int flags);
extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
extern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap);
#endif
+
+extern _X_EXPORT Bool glamor_fill_spans_nf(DrawablePtr drawable,
+ GCPtr gc,
+ int n, DDXPointPtr points,
+ int *widths, int sorted);
+
+
diff --git a/src/glamor_fill.c b/src/glamor_fill.c
index 7a43251..5fc350b 100644
--- a/src/glamor_fill.c
+++ b/src/glamor_fill.c
@@ -34,7 +34,7 @@
Bool
glamor_fill(DrawablePtr drawable,
- GCPtr gc, int x, int y, int width, int height)
+ GCPtr gc, int x, int y, int width, int height, Bool fallback)
{
PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable);
int off_x, off_y;
@@ -80,7 +80,9 @@ glamor_fill(DrawablePtr drawable,
break;
}
return TRUE;
+
fail:
+ if (!fallback) return FALSE;
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
fbFill(drawable, gc, x, y, width, height);
@@ -89,7 +91,6 @@ glamor_fill(DrawablePtr drawable,
glamor_finish_access(drawable);
}
return TRUE;
-
}
void
diff --git a/src/glamor_fillspans.c b/src/glamor_fillspans.c
index a91e6a9..996f0c5 100644
--- a/src/glamor_fillspans.c
+++ b/src/glamor_fillspans.c
@@ -30,10 +30,10 @@
*/
#include "glamor_priv.h"
-void
-glamor_fill_spans(DrawablePtr drawable,
+static Bool
+_glamor_fill_spans(DrawablePtr drawable,
GCPtr gc,
- int n, DDXPointPtr points, int *widths, int sorted)
+ int n, DDXPointPtr points, int *widths, int sorted, Bool fallback)
{
DDXPointPtr ppt;
int nbox;
@@ -66,12 +66,15 @@ glamor_fill_spans(DrawablePtr drawable,
if (x2 <= x1)
continue;
- glamor_fill(drawable, gc, x1, y, x2 - x1, 1);
+ if (!glamor_fill(drawable, gc, x1, y, x2 - x1, 1, fallback))
+ goto fail;
pbox++;
}
}
- return;
+ return TRUE;
+
fail:
+ if (!fallback) return FALSE;
glamor_fallback("to %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
@@ -82,4 +85,24 @@ glamor_fill_spans(DrawablePtr drawable,
}
glamor_finish_access(drawable);
}
+ return TRUE;
}
+
+
+void
+glamor_fill_spans(DrawablePtr drawable,
+ GCPtr gc,
+ int n, DDXPointPtr points, int *widths, int sorted)
+{
+ _glamor_fill_spans(drawable, gc, n, points, widths, sorted, TRUE);
+}
+
+Bool
+glamor_fill_spans_nf(DrawablePtr drawable,
+ GCPtr gc,
+ int n, DDXPointPtr points, int *widths, int sorted)
+{
+ return _glamor_fill_spans(drawable, gc, n, points, widths, sorted, FALSE);
+}
+
+
diff --git a/src/glamor_glyphs.c b/src/glamor_glyphs.c
index 899dd9d..335540d 100644
--- a/src/glamor_glyphs.c
+++ b/src/glamor_glyphs.c
@@ -690,7 +690,7 @@ glamor_glyphs_via_mask(CARD8 op,
}
gc = GetScratchGC(mask_pixmap->drawable.depth, screen);
ValidateGC(&mask_pixmap->drawable, gc);
- glamor_fill(&mask_pixmap->drawable, gc, 0, 0, width, height);
+ glamor_fill(&mask_pixmap->drawable, gc, 0, 0, width, height, TRUE);
FreeScratchGC(gc);
x = -extents.x1;
y = -extents.y1;
diff --git a/src/glamor_polyfillrect.c b/src/glamor_polyfillrect.c
index 762dfc2..eff63b6 100644
--- a/src/glamor_polyfillrect.c
+++ b/src/glamor_polyfillrect.c
@@ -87,7 +87,7 @@ glamor_poly_fill_rect(DrawablePtr drawable,
if (x1 >= x2 || y1 >= y2)
continue;
if (!glamor_fill(drawable, gc, x1, y1, x2 - x1,
- y2 - y1))
+ y2 - y1, TRUE))
goto fail;
}
}
diff --git a/src/glamor_priv.h b/src/glamor_priv.h
index 66c4359..a40a508 100644
--- a/src/glamor_priv.h
+++ b/src/glamor_priv.h
@@ -370,7 +370,7 @@ int glamor_gl_get_version(void);
/* glamor_fill.c */
Bool glamor_fill(DrawablePtr drawable,
- GCPtr gc, int x, int y, int width, int height);
+ GCPtr gc, int x, int y, int width, int height, Bool fallback);
Bool glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
unsigned long fg_pixel);