Skip to content

Commit

Permalink
composite: Wrap GetSpans
Browse files Browse the repository at this point in the history
GetSpans should flush composition from children to parent, just like
GetImage and SourceValidate.  Fortunately no one is likely to have
noticed, since to hit this you're already deep into failure town.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
nwnk authored and keith-packard committed Oct 28, 2014
1 parent da70c7d commit 0fbbdb3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions composite/compinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ compCloseScreen(ScreenPtr pScreen)
pScreen->PositionWindow = cs->PositionWindow;

pScreen->GetImage = cs->GetImage;
pScreen->GetSpans = cs->GetSpans;
pScreen->SourceValidate = cs->SourceValidate;

free(cs);
Expand Down Expand Up @@ -150,6 +151,21 @@ compGetImage(DrawablePtr pDrawable,
pScreen->GetImage = compGetImage;
}

static void
compGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth,
int nspans, char *pdstStart)
{
ScreenPtr pScreen = pDrawable->pScreen;
CompScreenPtr cs = GetCompScreen(pScreen);

pScreen->GetSpans = cs->GetSpans;
if (pDrawable->type == DRAWABLE_WINDOW)
compPaintChildrenToWindow((WindowPtr) pDrawable);
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
cs->GetSpans = pScreen->GetSpans;
pScreen->GetSpans = compGetSpans;
}

static void
compSourceValidate(DrawablePtr pDrawable,
int x, int y,
Expand Down Expand Up @@ -432,6 +448,9 @@ compScreenInit(ScreenPtr pScreen)
cs->GetImage = pScreen->GetImage;
pScreen->GetImage = compGetImage;

cs->GetSpans = pScreen->GetSpans;
pScreen->GetSpans = compGetSpans;

cs->SourceValidate = pScreen->SourceValidate;
pScreen->SourceValidate = compSourceValidate;

Expand Down
1 change: 1 addition & 0 deletions composite/compint.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ typedef struct _CompScreen {
CompOverlayClientPtr pOverlayClients;

GetImageProcPtr GetImage;
GetSpansProcPtr GetSpans;
SourceValidateProcPtr SourceValidate;
} CompScreenRec, *CompScreenPtr;

Expand Down

0 comments on commit 0fbbdb3

Please sign in to comment.