[PATCH xserver 3/4] exa: Remove some nonsense code from ValidateGC
Michel Dänzer
michel at daenzer.net
Wed Mar 1 16:04:26 UTC 2017
On 02/03/17 12:33 AM, Adam Jackson wrote:
> The "tile depth != drawable depth" conditional can't be true, the
> protocol requires a match.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
> exa/exa.c | 22 ++++------------------
> 1 file changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/exa/exa.c b/exa/exa.c
> index 7266b71..af0185f 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -507,27 +507,13 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
> PixmapPtr pTile = NULL;
> Bool finish_current_tile = FALSE;
>
> - /* Either of these conditions is enough to trigger access to a tile pixmap. */
> - /* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */
> + /* Either of these conditions is enough to trigger access to a tile pixmap.
> + * With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid
> + * tile pixmap pointer.
> + */
> if (pGC->fillStyle == FillTiled ||
> ((changes & GCTile) && !pGC->tileIsPixel)) {
> pTile = pGC->tile.pixmap;
> -
> - /* Sometimes tile pixmaps are swapped, you need access to:
> - * - The current tile if it depth matches.
> - * - Or the rotated tile if that one matches depth and !(changes & GCTile).
> - * - Or the current tile pixmap and a newly created one.
> - */
> - if (pTile && pTile->drawable.depth != pDrawable->depth &&
> - !(changes & GCTile)) {
> - PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC);
> -
> - if (pRotatedTile &&
> - pRotatedTile->drawable.depth == pDrawable->depth)
> - pTile = pRotatedTile;
> - else
> - finish_current_tile = TRUE; /* CreatePixmap will be called. */
> - }
This makes finish_current_tile == FALSE always, so that and
corresponding code is dead and can be removed as well.
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list