[PATCH 08/11] mi: Simplify composite border clip redirection interface
Adam Jackson
ajax at redhat.com
Thu Sep 18 10:23:57 PDT 2014
There's not really a good reason for mi to not just call the composite
code directly.
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
composite/compext.c | 3 ---
mi/mi.h | 11 -----------
mi/mivaltree.c | 52 +++++++++++++++++++---------------------------------
3 files changed, 19 insertions(+), 47 deletions(-)
diff --git a/composite/compext.c b/composite/compext.c
index cadedbd..fcfc349 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;
}
diff --git a/mi/mi.h b/mi/mi.h
index 4b5e862..a4a01b8 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -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 2a39c56..d23fbcc 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;
-}
-
static void
doVisibilityNotify(WindowPtr pWin, unsigned oldVis)
{
@@ -250,11 +241,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
@@ -519,6 +508,17 @@ miTreeObscured(WindowPtr pParent)
}
}
+static RegionPtr
+getBorderClip(WindowPtr pWin)
+{
+#ifdef COMPOSITE
+ if (pWin->redirectDraw != RedirectDrawNone)
+ return compGetRedirectBorderClip(pWin);
+ else
+#endif
+ return &pWin->borderClip;
+}
+
/*
*-----------------------------------------------------------------------
* miValidateTree --
@@ -612,14 +612,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++;
}
@@ -630,14 +623,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++;
}
--
1.9.3
More information about the xorg-devel
mailing list