139a46ad3eba85a786b38be687245004abbdff37
[nx-libs.git] / debian / patches / 204_nxagent_repaint-solidpict.full.patch
1 Description: Fix repainting of SolidFill pictures with libcairo > 1.12.x
2 Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>
3 diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c
4 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c       2012-05-16 18:05:07.000000000 +0200
5 +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c       2012-09-20 20:53:37.893459269 +0200
6 @@ -2689,11 +2689,17 @@ void nxagentReconnectPicture(pointer p0,
7      #endif
8    }
9  
10 -  if (!pForm)
11 +  if (!pForm && pPicture->pSourcePict)
12    {
13 -    *pBool = False;
14 -
15 -    return;
16 +        /*possible we need to add support for other picture types, for example gradients...*/
17 +        switch(pPicture->pSourcePict->type)
18 +        {
19 +        case SourcePictTypeSolidFill:
20 +            nxagentPicturePriv(pPicture) -> picture = XRenderCreateSolidFill(nxagentDisplay,
21 +                    (const XRenderColor*) &pPicture->pSourcePict->solidFill.fullColor);
22 +            break;
23 +        }
24 +        return;
25    }
26  
27    #ifdef TEST
28 diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c
29 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c  2010-11-11 21:18:00.000000000 +0100
30 +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c  2012-09-20 20:54:50.209817849 +0200
31 @@ -1137,6 +1137,10 @@ CreateSolidPicture (Picture pid, xRender
32      }
33      pPicture->pSourcePict->type = SourcePictTypeSolidFill;
34      pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color);
35 +    pPicture->pSourcePict->solidFill.fullColor.alpha=color->alpha;
36 +    pPicture->pSourcePict->solidFill.fullColor.red=color->red;
37 +    pPicture->pSourcePict->solidFill.fullColor.green=color->green;
38 +    pPicture->pSourcePict->solidFill.fullColor.blue=color->blue;
39      return pPicture;
40  }
41  
42 diff -rupN a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h
43 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h       2010-10-22 16:04:24.000000000 +0200
44 +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h       2012-09-20 20:55:31.106020653 +0200
45 @@ -95,6 +95,7 @@ typedef struct _PictTransform {
46  typedef struct _PictSolidFill {
47      unsigned int type;
48      CARD32 color;
49 +    xRenderColor fullColor;
50  } PictSolidFill, *PictSolidFillPtr;
51  
52  typedef struct _PictGradientStop {
53