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>
This commit is contained in:
parent
910ddf8521
commit
2bf34fe8d9
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user