glamor: Add a screen argument to drop an ifdef from glamor_set_alu().
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
9553020b71
commit
f3f4fc7a65
|
@ -338,6 +338,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
|||
Bool upsidedown, Pixel bitplane,
|
||||
void *closure, Bool fallback)
|
||||
{
|
||||
ScreenPtr screen = dst->pScreen;
|
||||
PixmapPtr dst_pixmap, src_pixmap;
|
||||
glamor_pixmap_private *dst_pixmap_priv, *src_pixmap_priv;
|
||||
glamor_screen_private *glamor_priv;
|
||||
|
@ -354,7 +355,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
|||
src_pixmap = glamor_get_drawable_pixmap(src);
|
||||
src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
|
||||
|
||||
glamor_priv = glamor_get_screen_private(dst->pScreen);
|
||||
glamor_priv = glamor_get_screen_private(screen);
|
||||
|
||||
DEBUGF("Copy %d %d %dx%d dx %d dy %d from %p to %p \n",
|
||||
box[0].x1, box[0].y1,
|
||||
|
@ -368,7 +369,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
|||
if (!glamor_set_planemask(dst_pixmap, gc->planemask))
|
||||
goto fall_back;
|
||||
glamor_get_context(glamor_priv);
|
||||
if (!glamor_set_alu(gc->alu)) {
|
||||
if (!glamor_set_alu(screen, gc->alu)) {
|
||||
glamor_put_context(glamor_priv);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -546,7 +547,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
|||
|
||||
fail:
|
||||
glamor_get_context(glamor_priv);
|
||||
glamor_set_alu(GXcopy);
|
||||
glamor_set_alu(screen, GXcopy);
|
||||
glamor_put_context(glamor_priv);
|
||||
|
||||
if (ok)
|
||||
|
|
|
@ -330,7 +330,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
|
|||
}
|
||||
|
||||
glamor_get_context(glamor_priv);
|
||||
if (!glamor_set_alu(alu)) {
|
||||
if (!glamor_set_alu(screen, alu)) {
|
||||
if (alu == GXclear)
|
||||
fg_pixel = 0;
|
||||
else {
|
||||
|
@ -345,7 +345,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
|
|||
box.y2 = y + height;
|
||||
glamor_solid_boxes(pixmap, &box, 1, fg_pixel);
|
||||
|
||||
glamor_set_alu(GXcopy);
|
||||
glamor_set_alu(screen, GXcopy);
|
||||
glamor_put_context(glamor_priv);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -115,9 +115,17 @@ glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask)
|
|||
}
|
||||
|
||||
Bool
|
||||
glamor_set_alu(unsigned char alu)
|
||||
glamor_set_alu(ScreenPtr screen, unsigned char alu)
|
||||
{
|
||||
#ifndef GLAMOR_GLES2
|
||||
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
|
||||
|
||||
if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) {
|
||||
if (alu != GXcopy)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (alu == GXcopy) {
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
return TRUE;
|
||||
|
@ -173,10 +181,7 @@ glamor_set_alu(unsigned char alu)
|
|||
glamor_fallback("unsupported alu %x\n", alu);
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
if (alu != GXcopy)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -599,7 +599,7 @@ glamor_pixmap_fbo *glamor_es2_pixmap_read_prepare(PixmapPtr source, int x,
|
|||
int no_alpha, int revert,
|
||||
int swap_rb);
|
||||
|
||||
Bool glamor_set_alu(unsigned char alu);
|
||||
Bool glamor_set_alu(ScreenPtr screen, unsigned char alu);
|
||||
Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask);
|
||||
Bool glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
|
||||
RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
|
||||
|
|
|
@ -196,7 +196,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
|
|||
}
|
||||
|
||||
glamor_get_context(glamor_priv);
|
||||
if (!glamor_set_alu(alu)) {
|
||||
if (!glamor_set_alu(screen, alu)) {
|
||||
glamor_fallback("unsupported alu %x\n", alu);
|
||||
glamor_put_context(glamor_priv);
|
||||
goto fail;
|
||||
|
@ -291,7 +291,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
|
|||
else
|
||||
_glamor_tile(pixmap, tile, x, y, width, height, tile_x, tile_y);
|
||||
|
||||
glamor_set_alu(GXcopy);
|
||||
glamor_set_alu(screen, GXcopy);
|
||||
glamor_put_context(glamor_priv);
|
||||
return TRUE;
|
||||
fail:
|
||||
|
|
Loading…
Reference in New Issue
Block a user