diff options
author | Eric Anholt <eric@anholt.net> | 2013-12-27 01:17:10 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-02-14 18:30:01 -0800 |
commit | f3f4fc7a65589a200a086ea7b1527f91941bc19b (patch) | |
tree | 67a88cbcb0adc7509b68213db5852d9c62ff6dac /glamor | |
parent | 9553020b7184ed7a7ef3f02d60556d519ea3e769 (diff) |
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>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor_copyarea.c | 7 | ||||
-rw-r--r-- | glamor/glamor_fill.c | 4 | ||||
-rw-r--r-- | glamor/glamor_pixmap.c | 17 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 2 | ||||
-rw-r--r-- | glamor/glamor_tile.c | 4 |
5 files changed, 20 insertions, 14 deletions
diff --git a/glamor/glamor_copyarea.c b/glamor/glamor_copyarea.c index 8cc7cad76..d6bcacd36 100644 --- a/glamor/glamor_copyarea.c +++ b/glamor/glamor_copyarea.c @@ -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) diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index d1c16ad43..dda55eace 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -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; diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 41d5f5aa9..5442c90da 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -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; } diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index 53af3531a..a6cdf6458 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -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); diff --git a/glamor/glamor_tile.c b/glamor/glamor_tile.c index 9abb95d52..7288af30e 100644 --- a/glamor/glamor_tile.c +++ b/glamor/glamor_tile.c @@ -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: |