summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-04-08 14:21:23 +1000
committerDave Airlie <airlied@redhat.com>2011-04-08 14:21:23 +1000
commit946a5b4a31a28045d83eace4fcc0410a7ecd1943 (patch)
treeedf0a68b94769110eeda86fa5022b6990883badb
parent96e7564016ae8a3f044877f7ca817bbc82fd3acb (diff)
gc: split gc validation.
-rw-r--r--dix/impedgc.c25
-rw-r--r--fb/fbgc.c24
-rw-r--r--include/gcstruct.h6
3 files changed, 32 insertions, 23 deletions
diff --git a/dix/impedgc.c b/dix/impedgc.c
index 35678b926..d7bc0998a 100644
--- a/dix/impedgc.c
+++ b/dix/impedgc.c
@@ -18,6 +18,30 @@
#include "scrnintstr.h"
#include "imped.h"
+void
+impedValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
+{
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
+ )
+ {
+ miComputeCompositeClip (pGC, pDrawable);
+ }
+
+ pGC->GPUValidateGC(pGC, changes, GetDrawablePixmap(pDrawable));
+
+}
+
+const GCFuncs impedGCFuncs = {
+ impedValidateGC,
+ miChangeGC,
+ miCopyGC,
+ miDestroyGC,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+
static void
impedFillSpans (DrawablePtr pDrawable,
GCPtr pGC,
@@ -329,4 +353,5 @@ const ProtocolGCOps impedGCOps = {
void impedSetGCOps(GCPtr pGC)
{
pGC->ops = (ProtocolGCOps *)&impedGCOps;
+ pGC->funcs = &impedGCFuncs;
}
diff --git a/fb/fbgc.c b/fb/fbgc.c
index 6c39823ca..4351d4fbb 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -29,15 +29,6 @@
#include "fb.h"
#include "imped.h"
-const GCFuncs fbGCFuncs = {
- fbValidateGC,
- miChangeGC,
- miCopyGC,
- miDestroyGC,
- miChangeClip,
- miDestroyClip,
- miCopyClip,
-};
const GCOps fbGCOps = {
fbFillSpans,
@@ -67,7 +58,7 @@ fbCreateGC(GCPtr pGC)
{
impedSetGCOps(pGC);
pGC->gpuops = (GCOps *) &fbGCOps;
- pGC->funcs = (GCFuncs *) &fbGCFuncs;
+ pGC->GPUValidateGC = fbValidateGC;
/* fb wants to translate before scan conversion */
pGC->miTranslate = 1;
@@ -195,19 +186,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
FbBits mask;
- /*
- * if the client clip is different or moved OR the subwindowMode has
- * changed OR the window's clip has changed since the last validation
- * we need to recompute the composite clip
- */
-
- if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
- (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
- )
- {
- miComputeCompositeClip (pGC, pDrawable);
- }
-
if (pPriv->bpp != pDrawable->bitsPerPixel)
{
changes |= GCStipple|GCForeground|GCBackground|GCPlaneMask;
diff --git a/include/gcstruct.h b/include/gcstruct.h
index f82e73197..cfe185197 100644
--- a/include/gcstruct.h
+++ b/include/gcstruct.h
@@ -482,6 +482,12 @@ typedef struct _GC {
PixmapPtr pRotatedPixmap; /* tile/stipple rotated for alignment */
RegionPtr pCompositeClip;
/* fExpose & freeCompClip defined above */
+
+ void (* GPUValidateGC)(
+ GCPtr /*pGC*/,
+ unsigned long /*stateChanges*/,
+ DrawablePtr /*pDrawable*/);
+
} GC;
#endif /* GCSTRUCT_H */