glamor: For non-supported fill style fallback to fbFill.

The previous implementation will just skip the rendering
which is not good.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2011-06-10 16:01:40 +08:00
parent b60e6cb66d
commit d7f8b888d0
4 changed files with 37 additions and 33 deletions

View File

@ -621,15 +621,17 @@ glamor_finish_access_gc(GCPtr gc)
glamor_finish_access(&gc->stipple->drawable);
}
void
Bool
glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
unsigned long fg_pixel, unsigned long bg_pixel,
int stipple_x, int stipple_y)
{
ErrorF("stubbed out stipple depth %d\n", pixmap->drawable.depth);
glamor_solid_fail_region(pixmap, x, y, width, height);
glamor_fallback("stubbed out stipple depth %d\n", pixmap->drawable.depth);
return FALSE;
// ErrorF("stubbed out stipple depth %d\n", pixmap->drawable.depth);
// glamor_solid_fail_region(pixmap, x, y, width, height);
}
GCOps glamor_gc_ops = {

View File

@ -42,23 +42,23 @@ glamor_fill(DrawablePtr drawable,
{
PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable);
int x_off, y_off;
glamor_get_drawable_deltas(drawable, dst_pixmap, &x_off, &y_off);
switch (gc->fillStyle) {
case FillSolid:
glamor_solid(dst_pixmap,
x + x_off,
y + y_off,
width,
height,
gc->alu,
gc->planemask,
gc->fgPixel);
if (!glamor_solid(dst_pixmap,
x + x_off,
y + y_off,
width,
height,
gc->alu,
gc->planemask,
gc->fgPixel))
goto fail;
break;
case FillStippled:
case FillOpaqueStippled:
glamor_stipple(dst_pixmap,
if (!glamor_stipple(dst_pixmap,
gc->stipple,
x+ x_off,
y + y_off,
@ -69,10 +69,12 @@ glamor_fill(DrawablePtr drawable,
gc->fgPixel,
gc->bgPixel,
gc->patOrg.x + x_off,
gc->patOrg.y + y_off);
gc->patOrg.y + y_off))
goto fail;
return;
break;
case FillTiled:
glamor_tile(dst_pixmap,
if (!glamor_tile(dst_pixmap,
gc->tile.pixmap,
x + x_off,
y + y_off,
@ -81,12 +83,12 @@ glamor_fill(DrawablePtr drawable,
gc->alu,
gc->planemask,
drawable->x + x - gc->patOrg.x,
drawable->y + y - gc->patOrg.y);
drawable->y + y - gc->patOrg.y))
goto fail;
break;
}
return;
#if 0
fail:
fail:
glamor_fallback("glamor_fill()");
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
@ -95,7 +97,6 @@ glamor_fill(DrawablePtr drawable,
}
glamor_finish_access(drawable);
}
#endif
return;
}
@ -140,7 +141,7 @@ glamor_init_solid_shader(ScreenPtr screen)
glGetUniformLocationARB(glamor_priv->solid_prog, "color");
}
void
Bool
glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
unsigned char alu, unsigned long planemask, unsigned long fg_pixel)
{
@ -154,12 +155,12 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
float vertices[4][2];
if (!glamor_set_destination_pixmap(pixmap))
return;
goto fail;
glamor_set_alu(alu);
if (!glamor_set_planemask(pixmap, planemask)) {
ErrorF("Failedto set planemask in glamor_solid.\n");
goto fail;
}
ErrorF("Failedto set planemask in glamor_solid.\n");
goto fail;
}
glUseProgramObjectARB(glamor_priv->solid_prog);
glamor_get_color_4f_from_pixel(pixmap, fg_pixel, color);
@ -188,9 +189,11 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
glDisableClientState(GL_VERTEX_ARRAY);
glUseProgramObjectARB(0);
return TRUE;
fail:
glamor_set_alu(GXcopy);
glamor_set_planemask(pixmap, ~0);
return FALSE;
}
/* Highlight places where we're doing it wrong. */

View File

@ -350,7 +350,7 @@ const Bool glamor_get_drawable_location(const DrawablePtr drawable);
void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
int *x, int *y);
Bool glamor_create_gc(GCPtr gc);
void glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
Bool glamor_stipple(PixmapPtr pixmap, PixmapPtr stipple,
int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
unsigned long fg_pixel, unsigned long bg_pixel,
@ -376,7 +376,7 @@ void glamor_fill(DrawablePtr drawable,
int y,
int width,
int height);
void glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
Bool glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
unsigned long fg_pixel);
void glamor_solid_fail_region(PixmapPtr pixmap,
@ -456,7 +456,7 @@ void glamor_composite_rects(CARD8 op,
int nrect, glamor_composite_rect_t *rects);
/* glamor_tile.c */
void glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
Bool glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
int tile_x, int tile_y);

View File

@ -72,7 +72,7 @@ glamor_init_tile_shader(ScreenPtr screen)
glUseProgramObjectARB(0);
}
void
Bool
glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
int x, int y, int width, int height,
unsigned char alu, unsigned long planemask,
@ -93,7 +93,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
float source_texcoords[4][2];
if (glamor_priv->tile_prog == 0) {
ErrorF("Tiling unsupported\n");
glamor_fallback("Tiling unsupported\n");
goto fail;
}
@ -101,7 +101,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
goto fail;
if (tile_priv->tex == 0) {
ErrorF("Non-texture tile pixmap\n");
glamor_fallback("Non-texture tile pixmap\n");
goto fail;
}
@ -167,9 +167,8 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
glDisable(GL_TEXTURE_2D);
glamor_set_alu(GXcopy);
glamor_set_planemask(pixmap, ~0);
return;
return TRUE;
fail:
glamor_solid_fail_region(pixmap, x, y, width, height);
return;
return FALSE;
}