From 49e3b44aa813c98c05fcb10c19882e10d751580a Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Fri, 6 Apr 2012 21:17:46 +0800 Subject: [PATCH] glamor_set_alu: Added GXclear support at glamor_solid. We don't need to issue the glamor_fallback at the glamor_set_alu routine, as the caller may support GXclear or other most frequent Ops. Leave it to the caller to determine fallback or not. Signed-off-by: Zhigang Gong --- glamor/glamor_fill.c | 9 +++++++-- glamor/glamor_pixmap.c | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index 53c750afb..4cee485e0 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -190,8 +190,13 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, dispatch = glamor_get_dispatch(glamor_priv); if (!glamor_set_alu(dispatch, alu)) { - glamor_put_dispatch(glamor_priv); - return FALSE; + if (alu == GXclear) + color[0] = color[1] = color[2] = color[3] = 0.0; + else { + glamor_fallback("unsupported alu %x\n", alu); + glamor_put_dispatch(glamor_priv); + return FALSE; + } } dispatch->glUseProgram(glamor_priv->solid_prog); diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 35b2d56f1..066d9a779 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -204,10 +204,8 @@ glamor_set_alu(struct glamor_gl_dispatch *dispatch, unsigned char alu) return FALSE; } #else - if (alu != GXcopy) { - glamor_fallback("unsupported alu %x\n", alu); + if (alu != GXcopy) return FALSE; - } #endif return TRUE; } @@ -872,7 +870,6 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, GLenum format, return temp_fbo; } - /** * Move a pixmap to CPU memory. * The input data is the pixmap's fbo.