treewide: replace PICT_FORMAT_A by PIXMAN_FORMAT_A

Try not to use old compat macros anymore, use the real ones instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-05 18:00:55 +02:00
committed by Enrico Weigelt
parent 97f3ff8c7e
commit ae1b649587
10 changed files with 29 additions and 29 deletions

View File

@@ -138,7 +138,7 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen, unsigned int format)
} }
} }
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) #define NeedsComponent(f) (PIXMAN_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
/* All caches for a single format share a single pixmap for glyph storage, /* All caches for a single format share a single pixmap for glyph storage,
* allowing mixing glyphs of different sizes without paying a penalty * allowing mixing glyphs of different sizes without paying a penalty

View File

@@ -143,7 +143,7 @@ exaGetPixelFromRGBA(CARD32 *pixel,
CARD16 green, CARD16 green,
CARD16 blue, CARD16 alpha, PictFormatPtr pFormat) CARD16 blue, CARD16 alpha, PictFormatPtr pFormat)
{ {
int rbits, bbits, gbits, abits; int rbits, bbits, gbits;
int rshift, bshift, gshift, ashift; int rshift, bshift, gshift, ashift;
*pixel = 0; *pixel = 0;
@@ -155,7 +155,7 @@ exaGetPixelFromRGBA(CARD32 *pixel,
rbits = PICT_FORMAT_R(pFormat->format); rbits = PICT_FORMAT_R(pFormat->format);
gbits = PICT_FORMAT_G(pFormat->format); gbits = PICT_FORMAT_G(pFormat->format);
bbits = PICT_FORMAT_B(pFormat->format); bbits = PICT_FORMAT_B(pFormat->format);
abits = PICT_FORMAT_A(pFormat->format); int abits = PIXMAN_FORMAT_A(pFormat->format);
rshift = pFormat->direct.red; rshift = pFormat->direct.red;
gshift = pFormat->direct.green; gshift = pFormat->direct.green;
@@ -178,7 +178,7 @@ exaGetRGBAFromPixel(CARD32 pixel,
CARD16 *alpha, CARD16 *alpha,
PictFormatPtr pFormat, PictFormatShort format) PictFormatPtr pFormat, PictFormatShort format)
{ {
int rbits, bbits, gbits, abits; int rbits, bbits, gbits;
int rshift, bshift, gshift, ashift; int rshift, bshift, gshift, ashift;
if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A) if (!PICT_FORMAT_COLOR(format) && PICT_FORMAT_TYPE(format) != PICT_TYPE_A)
@@ -187,7 +187,7 @@ exaGetRGBAFromPixel(CARD32 pixel,
rbits = PICT_FORMAT_R(format); rbits = PICT_FORMAT_R(format);
gbits = PICT_FORMAT_G(format); gbits = PICT_FORMAT_G(format);
bbits = PICT_FORMAT_B(format); bbits = PICT_FORMAT_B(format);
abits = PICT_FORMAT_A(format); int abits = PIXMAN_FORMAT_A(format);
if (pFormat) { if (pFormat) {
rshift = pFormat->direct.red; rshift = pFormat->direct.red;
@@ -889,7 +889,7 @@ exaComposite(CARD8 op,
pSrc->repeat = 0; pSrc->repeat = 0;
if (!pMask && !pSrc->alphaMap && !pDst->alphaMap && if (!pMask && !pSrc->alphaMap && !pDst->alphaMap &&
(op == PictOpSrc || (op == PictOpOver && !PICT_FORMAT_A(pSrc->format)))) (op == PictOpSrc || (op == PictOpOver && !PIXMAN_FORMAT_A(pSrc->format))))
{ {
if (pSrc->pDrawable ? if (pSrc->pDrawable ?
(pSrc->pDrawable->width == 1 && pSrc->pDrawable->height == 1 && (pSrc->pDrawable->width == 1 && pSrc->pDrawable->height == 1 &&
@@ -912,7 +912,7 @@ exaComposite(CARD8 op,
PICT_FORMAT_G(pSrc->format), PICT_FORMAT_G(pSrc->format),
PICT_FORMAT_B(pSrc->format))))) PICT_FORMAT_B(pSrc->format)))))
|| (op == PictOpOver && pSrc->format == pDst->format && || (op == PictOpOver && pSrc->format == pDst->format &&
!PICT_FORMAT_A(pSrc->format)))) { !PIXMAN_FORMAT_A(pSrc->format)))) {
if (!pSrc->repeat && xSrc >= 0 && ySrc >= 0 && if (!pSrc->repeat && xSrc >= 0 && ySrc >= 0 &&
(xSrc + width <= pSrc->pDrawable->width) && (xSrc + width <= pSrc->pDrawable->width) &&
(ySrc + height <= pSrc->pDrawable->height)) { (ySrc + height <= pSrc->pDrawable->height)) {

View File

@@ -126,7 +126,7 @@ fbShapes(CompositeShapesFunc composite,
} }
} }
else { else {
switch (PICT_FORMAT_A(maskFormat->format)) { switch (PIXMAN_FORMAT_A(maskFormat->format)) {
case 1: case 1:
format = PIXMAN_a1; format = PIXMAN_a1;
break; break;

View File

@@ -226,7 +226,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen,
return FALSE; return FALSE;
} }
if (!PICT_FORMAT_A(format)) if (!PIXMAN_FORMAT_A(format))
swizzle[3] = GL_ONE; swizzle[3] = GL_ONE;
return TRUE; return TRUE;

View File

@@ -507,7 +507,7 @@ glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst)
/* If there's no dst alpha channel, adjust the blend op so that we'll treat /* If there's no dst alpha channel, adjust the blend op so that we'll treat
* it as always 1. * it as always 1.
*/ */
if (PICT_FORMAT_A(dst->format) == 0 && op_info->dest_alpha) { if (PIXMAN_FORMAT_A(dst->format) == 0 && op_info->dest_alpha) {
if (src_blend == GL_DST_ALPHA) if (src_blend == GL_DST_ALPHA)
src_blend = GL_ONE; src_blend = GL_ONE;
else if (src_blend == GL_ONE_MINUS_DST_ALPHA) else if (src_blend == GL_ONE_MINUS_DST_ALPHA)

View File

@@ -532,7 +532,7 @@ glamor_set_composite_op(ScreenPtr screen,
/* If there's no dst alpha channel, adjust the blend op so that we'll treat /* If there's no dst alpha channel, adjust the blend op so that we'll treat
* it as always 1. * it as always 1.
*/ */
if (PICT_FORMAT_A(dest->format) == 0 && op_info->dest_alpha) { if (PIXMAN_FORMAT_A(dest->format) == 0 && op_info->dest_alpha) {
if (source_blend == GL_DST_ALPHA) if (source_blend == GL_DST_ALPHA)
source_blend = GL_ONE; source_blend = GL_ONE;
else if (source_blend == GL_ONE_MINUS_DST_ALPHA) else if (source_blend == GL_ONE_MINUS_DST_ALPHA)
@@ -640,7 +640,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
* is RGB (no alpha), which we use for 16bpp textures. * is RGB (no alpha), which we use for 16bpp textures.
*/ */
if (glamor_pixmap_priv_is_large(pixmap_priv) || if (glamor_pixmap_priv_is_large(pixmap_priv) ||
(!PICT_FORMAT_A(picture->format) && (!PIXMAN_FORMAT_A(picture->format) &&
repeat_type == RepeatNone && picture->transform)) { repeat_type == RepeatNone && picture->transform)) {
glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv); glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv);
glUniform4fv(wh_location, 1, wh); glUniform4fv(wh_location, 1, wh);
@@ -941,7 +941,7 @@ glamor_composite_choose_shader(CARD8 op,
goto fail; goto fail;
} }
else { else {
if (PICT_FORMAT_A(source->format)) if (PIXMAN_FORMAT_A(source->format))
key.source = SHADER_SOURCE_TEXTURE_ALPHA; key.source = SHADER_SOURCE_TEXTURE_ALPHA;
else else
key.source = SHADER_SOURCE_TEXTURE; key.source = SHADER_SOURCE_TEXTURE;
@@ -959,7 +959,7 @@ glamor_composite_choose_shader(CARD8 op,
goto fail; goto fail;
} }
else { else {
if (PICT_FORMAT_A(mask->format)) if (PIXMAN_FORMAT_A(mask->format))
key.mask = SHADER_MASK_TEXTURE_ALPHA; key.mask = SHADER_MASK_TEXTURE_ALPHA;
else else
key.mask = SHADER_MASK_TEXTURE; key.mask = SHADER_MASK_TEXTURE;
@@ -1066,12 +1066,12 @@ glamor_composite_choose_shader(CARD8 op,
* because we wire the alpha to 1. * because we wire the alpha to 1.
* *
**/ **/
if (!PICT_FORMAT_A(saved_source_format) if (!PIXMAN_FORMAT_A(saved_source_format)
&& PICT_FORMAT_A(mask->format)) && PIXMAN_FORMAT_A(mask->format))
key.source = SHADER_SOURCE_TEXTURE; key.source = SHADER_SOURCE_TEXTURE;
if (!PICT_FORMAT_A(mask->format) if (!PIXMAN_FORMAT_A(mask->format)
&& PICT_FORMAT_A(saved_source_format)) && PIXMAN_FORMAT_A(saved_source_format))
key.mask = SHADER_MASK_TEXTURE; key.mask = SHADER_MASK_TEXTURE;
} }
@@ -1559,7 +1559,7 @@ glamor_composite_clipped_region(CARD8 op,
PICT_FORMAT_B(source->format))))) PICT_FORMAT_B(source->format)))))
|| (op == PictOpOver || (op == PictOpOver
&& source->format == dest->format && source->format == dest->format
&& !PICT_FORMAT_A(source->format))) && !PIXMAN_FORMAT_A(source->format)))
&& x_source >= 0 && y_source >= 0 && x_source >= 0 && y_source >= 0
&& (x_source + width) <= source->pDrawable->width && (x_source + width) <= source->pDrawable->width
&& (y_source + height) <= source->pDrawable->height) { && (y_source + height) <= source->pDrawable->height) {

View File

@@ -593,13 +593,13 @@ glamor_get_rgba_from_pixel(CARD32 pixel,
float *green, float *green,
float *blue, float *alpha, CARD32 format) float *blue, float *alpha, CARD32 format)
{ {
int rbits, bbits, gbits, abits; int rbits, bbits, gbits;
int rshift, bshift, gshift, ashift; int rshift, bshift, gshift, ashift;
rbits = PICT_FORMAT_R(format); rbits = PICT_FORMAT_R(format);
gbits = PICT_FORMAT_G(format); gbits = PICT_FORMAT_G(format);
bbits = PICT_FORMAT_B(format); bbits = PICT_FORMAT_B(format);
abits = PICT_FORMAT_A(format); int abits = PIXMAN_FORMAT_A(format);
if (PICT_FORMAT_TYPE(format) == PICT_TYPE_A) { if (PICT_FORMAT_TYPE(format) == PICT_TYPE_A) {
rshift = gshift = bshift = ashift = 0; rshift = gshift = bshift = ashift = 0;

View File

@@ -542,7 +542,7 @@ GlyphExtents(int nlist, GlyphListPtr list, GlyphPtr * glyphs, BoxPtr extents)
} }
} }
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) #define NeedsComponent(f) (PIXMAN_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
void void
CompositeGlyphs(CARD8 op, CompositeGlyphs(CARD8 op,

View File

@@ -296,7 +296,7 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
case PICT_TYPE_ARGB: case PICT_TYPE_ARGB:
pFormats[f].type = PictTypeDirect; pFormats[f].type = PictTypeDirect;
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); pFormats[f].direct.alphaMask = Mask (PIXMAN_FORMAT_A(format));
if (pFormats[f].direct.alphaMask) if (pFormats[f].direct.alphaMask)
pFormats[f].direct.alpha = (PICT_FORMAT_R(format) + pFormats[f].direct.alpha = (PICT_FORMAT_R(format) +
@@ -320,7 +320,7 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
case PICT_TYPE_ABGR: case PICT_TYPE_ABGR:
pFormats[f].type = PictTypeDirect; pFormats[f].type = PictTypeDirect;
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); pFormats[f].direct.alphaMask = Mask (PIXMAN_FORMAT_A(format));
if (pFormats[f].direct.alphaMask) if (pFormats[f].direct.alphaMask)
pFormats[f].direct.alpha = (PICT_FORMAT_B(format) + pFormats[f].direct.alpha = (PICT_FORMAT_B(format) +
@@ -361,7 +361,7 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
(PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) - (PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) -
PICT_FORMAT_G(format) - PICT_FORMAT_R(format)); PICT_FORMAT_G(format) - PICT_FORMAT_R(format));
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); pFormats[f].direct.alphaMask = Mask (PIXMAN_FORMAT_A(format));
pFormats[f].direct.alpha = 0; pFormats[f].direct.alpha = 0;
break; break;
@@ -370,7 +370,7 @@ PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
pFormats[f].type = PictTypeDirect; pFormats[f].type = PictTypeDirect;
pFormats[f].direct.alpha = 0; pFormats[f].direct.alpha = 0;
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format)); pFormats[f].direct.alphaMask = Mask (PIXMAN_FORMAT_A(format));
/* remaining fields already set to zero */ /* remaining fields already set to zero */
break; break;
@@ -1431,7 +1431,7 @@ ReduceCompositeOp(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
* picture. * picture.
*/ */
no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) && no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) &&
PICT_FORMAT_A(pSrc->format) == 0 && PIXMAN_FORMAT_A(pSrc->format) == 0 &&
(pSrc->repeatType != RepeatNone || (pSrc->repeatType != RepeatNone ||
(!pSrc->transform && (!pSrc->transform &&
xSrc >= 0 && ySrc >= 0 && xSrc >= 0 && ySrc >= 0 &&
@@ -1439,7 +1439,7 @@ ReduceCompositeOp(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
ySrc + height <= pSrc->pDrawable->height)) && ySrc + height <= pSrc->pDrawable->height)) &&
pSrc->alphaMap == NULL && pMask == NULL; pSrc->alphaMap == NULL && pMask == NULL;
no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) && no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) &&
PICT_FORMAT_A(pDst->format) == 0 && pDst->alphaMap == NULL; PIXMAN_FORMAT_A(pDst->format) == 0 && pDst->alphaMap == NULL;
/* TODO, maybe: Conjoint and Disjoint op reductions? */ /* TODO, maybe: Conjoint and Disjoint op reductions? */

View File

@@ -989,7 +989,7 @@ typedef struct _GlyphNew {
unsigned char sha1[20]; unsigned char sha1[20];
} GlyphNewRec, *GlyphNewPtr; } GlyphNewRec, *GlyphNewPtr;
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) #define NeedsComponent(f) (PIXMAN_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
static int static int
ProcRenderAddGlyphs(ClientPtr client) ProcRenderAddGlyphs(ClientPtr client)