Commit 7eddc80b authored by Adam Jackson's avatar Adam Jackson

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: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
parent 7b35dc9b
......@@ -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 */
......
......@@ -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++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment