diff options
author | Adam Jackson <ajax@redhat.com> | 2014-08-05 14:07:17 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2014-10-09 11:14:53 +0200 |
commit | 7eddc80bc4a6c1902746a9fbe79ab553f9fd5821 (patch) | |
tree | 5f022334ae9772ee7365234d09fae130915cd09d | |
parent | 7b35dc9b1533d4b99a3f84f460ac66354a6fe347 (diff) |
mi: Simplify composite border clip redirection interface
There's not really a good reason for mi to not just call the composite
code directly.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | composite/compext.c | 3 | ||||
-rw-r--r-- | mi/mi.h | 11 | ||||
-rw-r--r-- | mi/mivaltree.c | 52 |
3 files changed, 19 insertions, 47 deletions
diff --git a/composite/compext.c b/composite/compext.c index cadedbd37..fcfc3496a 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -594,9 +594,6 @@ CompositeExtensionInit(void) return; CompositeReqCode = (CARD8) extEntry->base; - miRegisterRedirectBorderClipProc(compSetRedirectBorderClip, - compGetRedirectBorderClip); - /* Initialization succeeded */ noCompositeExtension = FALSE; } @@ -425,17 +425,6 @@ extern _X_EXPORT int miShapedWindowIn(RegionPtr /*universe */ , int /*y */ ); -typedef void - (*SetRedirectBorderClipProcPtr) (WindowPtr pWindow, RegionPtr pRegion); - -typedef RegionPtr - (*GetRedirectBorderClipProcPtr) (WindowPtr pWindow); - -extern _X_EXPORT void - -miRegisterRedirectBorderClipProc(SetRedirectBorderClipProcPtr setBorderClip, - GetRedirectBorderClipProcPtr getBorderClip); - extern _X_EXPORT int miValidateTree(WindowPtr /*pParent */ , WindowPtr /*pChild */ , VTKind /*kind */ diff --git a/mi/mivaltree.c b/mi/mivaltree.c index c1cc43122..8e4e9a9e0 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -99,8 +99,10 @@ Equipment Corporation. #include "mi.h" #include "regionstr.h" #include "mivalidate.h" - #include "globals.h" +#ifdef COMPOSITE +#include "compint.h" +#endif /* * Compute the visibility of a shaped window @@ -160,17 +162,6 @@ miShapedWindowIn(RegionPtr universe, RegionPtr bounding, return rgnOUT; } -static GetRedirectBorderClipProcPtr miGetRedirectBorderClipProc; -static SetRedirectBorderClipProcPtr miSetRedirectBorderClipProc; - -void -miRegisterRedirectBorderClipProc(SetRedirectBorderClipProcPtr setBorderClip, - GetRedirectBorderClipProcPtr getBorderClip) -{ - miSetRedirectBorderClipProc = setBorderClip; - miGetRedirectBorderClipProc = getBorderClip; -} - /* * Manual redirected windows are treated as transparent; they do not obscure * siblings or parent windows @@ -242,11 +233,9 @@ miComputeClips(WindowPtr pParent, * In redirected drawing case, reset universe to borderSize */ if (pParent->redirectDraw != RedirectDrawNone) { - if (miSetRedirectBorderClipProc) { - if (TreatAsTransparent(pParent)) - RegionEmpty(universe); - (*miSetRedirectBorderClipProc) (pParent, universe); - } + if (TreatAsTransparent(pParent)) + RegionEmpty(universe); + compSetRedirectBorderClip (pParent, universe); RegionCopy(universe, &pParent->borderSize); } #endif @@ -516,6 +505,17 @@ miTreeObscured(WindowPtr pParent) } } +static RegionPtr +getBorderClip(WindowPtr pWin) +{ +#ifdef COMPOSITE + if (pWin->redirectDraw != RedirectDrawNone) + return compGetRedirectBorderClip(pWin); + else +#endif + return &pWin->borderClip; +} + /* *----------------------------------------------------------------------- * miValidateTree -- @@ -609,14 +609,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ forward = TRUE; for (pWin = pChild; pWin; pWin = pWin->nextSib) { if (pWin->valdata) { - RegionPtr pBorderClip = &pWin->borderClip; - -#ifdef COMPOSITE - if (pWin->redirectDraw != RedirectDrawNone && - miGetRedirectBorderClipProc) - pBorderClip = (*miGetRedirectBorderClipProc) (pWin); -#endif - RegionAppend(&totalClip, pBorderClip); + RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } @@ -627,14 +620,7 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ pWin = pParent->lastChild; while (1) { if (pWin->valdata) { - RegionPtr pBorderClip = &pWin->borderClip; - -#ifdef COMPOSITE - if (pWin->redirectDraw != RedirectDrawNone && - miGetRedirectBorderClipProc) - pBorderClip = (*miGetRedirectBorderClipProc) (pWin); -#endif - RegionAppend(&totalClip, pBorderClip); + RegionAppend(&totalClip, getBorderClip(pWin)); if (pWin->viewable) viewvals++; } |