summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-10-13 12:32:27 -0700
committerKeith Packard <keithp@keithp.com>2015-05-14 15:55:53 -0700
commit2bf34fe8d9b7628d164392c2d11ace78f7cf17b9 (patch)
treeafe2303212a46f0dd66cbd85a020cbb5e55bdcf0
parent910ddf85219f114744e8996a4ac044c4eafc62ac (diff)
glamor: Pass depth to glamor_pm_is_solid and glamor_set_planemask
Instead of passing the destination drawable, just pass the depth, as the underlying functions need only that to check whether the planemask is going to work. This API change will allow higher level functions to not need the destination pixmap. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--glamor/glamor_copy.c9
-rw-r--r--glamor/glamor_image.c4
-rw-r--r--glamor/glamor_pixmap.c4
-rw-r--r--glamor/glamor_priv.h8
-rw-r--r--glamor/glamor_spans.c2
-rw-r--r--glamor/glamor_text.c2
-rw-r--r--glamor/glamor_transform.c4
7 files changed, 16 insertions, 17 deletions
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index 75fe8a700..921e80e3d 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -212,7 +212,7 @@ glamor_copy_cpu_fbo(DrawablePtr src,
if (gc && gc->alu != GXcopy)
goto bail;
- if (gc && !glamor_pm_is_solid(dst, gc->planemask))
+ if (gc && !glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_make_current(glamor_priv);
@@ -262,7 +262,7 @@ glamor_copy_fbo_cpu(DrawablePtr src,
if (gc && gc->alu != GXcopy)
goto bail;
- if (gc && !glamor_pm_is_solid(dst, gc->planemask))
+ if (gc && !glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_make_current(glamor_priv);
@@ -319,7 +319,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
glamor_make_current(glamor_priv);
- if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask))
+ if (gc && !glamor_set_planemask(gc->depth, gc->planemask))
goto bail_ctx;
if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy))
@@ -419,7 +419,6 @@ glamor_copy_fbo_fbo_temp(DrawablePtr src,
{
ScreenPtr screen = dst->pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(dst);
PixmapPtr tmp_pixmap;
BoxRec bounds;
int n;
@@ -434,7 +433,7 @@ glamor_copy_fbo_fbo_temp(DrawablePtr src,
*/
glamor_make_current(glamor_priv);
- if (gc && !glamor_set_planemask(dst_pixmap, gc->planemask))
+ if (gc && !glamor_set_planemask(gc->depth, gc->planemask))
goto bail_ctx;
if (!glamor_set_alu(screen, gc ? gc->alu : GXcopy))
diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c
index 5633da647..a272d5eaf 100644
--- a/glamor/glamor_image.c
+++ b/glamor/glamor_image.c
@@ -49,7 +49,7 @@ glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
if (gc->alu != GXcopy)
goto bail;
- if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask))
+ if (!glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
if (format == XYPixmap && drawable->depth == 1 && leftPad == 0)
@@ -116,7 +116,7 @@ glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h,
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
goto bail;
- if (format != ZPixmap || !glamor_pm_is_solid(drawable, plane_mask))
+ if (format != ZPixmap || !glamor_pm_is_solid(drawable->depth, plane_mask))
goto bail;
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 623574716..4e8737172 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -109,9 +109,9 @@ glamor_set_destination_pixmap(PixmapPtr pixmap)
}
Bool
-glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask)
+glamor_set_planemask(int depth, unsigned long planemask)
{
- if (glamor_pm_is_solid(&pixmap->drawable, planemask)) {
+ if (glamor_pm_is_solid(depth, planemask)) {
return GL_TRUE;
}
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 4b9ba4d55..e586fcc51 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -638,10 +638,10 @@ glamor_get_gc_private(GCPtr gc)
* pixel values for pDrawable.
*/
static inline Bool
-glamor_pm_is_solid(DrawablePtr drawable, unsigned long planemask)
+glamor_pm_is_solid(int depth, unsigned long planemask)
{
- return (planemask & FbFullMask(drawable->depth)) ==
- FbFullMask(drawable->depth);
+ return (planemask & FbFullMask(depth)) ==
+ FbFullMask(depth);
}
extern int glamor_debug_level;
@@ -701,7 +701,7 @@ glamor_pixmap_fbo *glamor_es2_pixmap_read_prepare(PixmapPtr source, int x,
int swap_rb);
Bool glamor_set_alu(ScreenPtr screen, unsigned char alu);
-Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask);
+Bool glamor_set_planemask(int depth, unsigned long planemask);
RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
void
diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c
index b358c60bd..58da3edf7 100644
--- a/glamor/glamor_spans.c
+++ b/glamor/glamor_spans.c
@@ -279,7 +279,7 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
if (gc->alu != GXcopy)
goto bail;
- if (!glamor_pm_is_solid(&pixmap->drawable, gc->planemask))
+ if (!glamor_pm_is_solid(gc->depth, gc->planemask))
goto bail;
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
diff --git a/glamor/glamor_text.c b/glamor/glamor_text.c
index c7c1ab738..8d8c97072 100644
--- a/glamor/glamor_text.c
+++ b/glamor/glamor_text.c
@@ -431,7 +431,7 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
/* Check planemask before drawing background to
* bail early if it's not OK
*/
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
goto bail;
for (c = 0; c < count; c++)
if (charinfo[c])
diff --git a/glamor/glamor_transform.c b/glamor/glamor_transform.c
index 6d29e9eb6..3036a06d0 100644
--- a/glamor/glamor_transform.c
+++ b/glamor/glamor_transform.c
@@ -129,7 +129,7 @@ glamor_set_solid(PixmapPtr pixmap,
CARD32 pixel;
int alu = use_alu ? gc->alu : GXcopy;
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
return FALSE;
pixel = gc->fgPixel;
@@ -189,7 +189,7 @@ glamor_set_tiled(PixmapPtr pixmap,
if (!glamor_set_alu(pixmap->drawable.pScreen, gc->alu))
return FALSE;
- if (!glamor_set_planemask(pixmap, gc->planemask))
+ if (!glamor_set_planemask(gc->depth, gc->planemask))
return FALSE;
return glamor_set_texture(pixmap,