summaryrefslogtreecommitdiff
path: root/xserver/render
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/render')
-rw-r--r--xserver/render/Makefile.in1
-rw-r--r--xserver/render/animcur.c2
-rw-r--r--xserver/render/glyph.c2
-rw-r--r--xserver/render/glyphstr.h2
-rw-r--r--xserver/render/mipict.c34
-rw-r--r--xserver/render/mipict.h2
-rw-r--r--xserver/render/mirect.c2
-rw-r--r--xserver/render/picture.c129
-rw-r--r--xserver/render/picture.h8
-rw-r--r--xserver/render/picturestr.h6
-rw-r--r--xserver/render/render.c4
11 files changed, 60 insertions, 132 deletions
diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in
index aafe4285a..5d95cc5aa 100644
--- a/xserver/render/Makefile.in
+++ b/xserver/render/Makefile.in
@@ -265,6 +265,7 @@ KDRIVE_CFLAGS = @KDRIVE_CFLAGS@
KDRIVE_INCS = @KDRIVE_INCS@
KDRIVE_LIBS = @KDRIVE_LIBS@
KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@
+KDRIVE_MAIN_LIB = @KDRIVE_MAIN_LIB@
KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@
KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@
KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@
diff --git a/xserver/render/animcur.c b/xserver/render/animcur.c
index 69f9f887c..825ae1fe7 100644
--- a/xserver/render/animcur.c
+++ b/xserver/render/animcur.c
@@ -159,7 +159,7 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen,
/*
* Not a simple Unwrap/Wrap as this
- * isn't called along the DisplayCursor
+ * isn't called along the DisplayCursor
* wrapper chain.
*/
DisplayCursor = pScreen->DisplayCursor;
diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c
index ae3812171..f3310db12 100644
--- a/xserver/render/glyph.c
+++ b/xserver/render/glyph.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
diff --git a/xserver/render/glyphstr.h b/xserver/render/glyphstr.h
index 835c1a74e..2df055dfd 100644
--- a/xserver/render/glyphstr.h
+++ b/xserver/render/glyphstr.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
diff --git a/xserver/render/mipict.c b/xserver/render/mipict.c
index 3959fc415..a72510480 100644
--- a/xserver/render/mipict.c
+++ b/xserver/render/mipict.c
@@ -49,23 +49,9 @@ miDestroyPicture(PicturePtr pPicture)
void
miDestroyPictureClip(PicturePtr pPicture)
{
- switch (pPicture->clientClipType) {
- case CT_NONE:
- return;
- case CT_PIXMAP:
- (*pPicture->pDrawable->pScreen->
- DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
- break;
- default:
- /*
- * we know we'll never have a list of rectangles, since ChangeClip
- * immediately turns them into a region
- */
+ if (pPicture->clientClip)
RegionDestroy(pPicture->clientClip);
- break;
- }
pPicture->clientClip = NULL;
- pPicture->clientClipType = CT_NONE;
}
int
@@ -73,37 +59,31 @@ miChangePictureClip(PicturePtr pPicture, int type, void *value, int n)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
- void *clientClip;
- int clientClipType;
+ RegionPtr clientClip;
switch (type) {
case CT_PIXMAP:
/* convert the pixmap to a region */
- clientClip = (void *) BitmapToRegion(pScreen, (PixmapPtr) value);
+ clientClip = BitmapToRegion(pScreen, (PixmapPtr) value);
if (!clientClip)
return BadAlloc;
- clientClipType = CT_REGION;
(*pScreen->DestroyPixmap) ((PixmapPtr) value);
break;
case CT_REGION:
clientClip = value;
- clientClipType = CT_REGION;
break;
case CT_NONE:
clientClip = 0;
- clientClipType = CT_NONE;
break;
default:
- clientClip = (void *) RegionFromRects(n, (xRectangle *) value, type);
+ clientClip = RegionFromRects(n, (xRectangle *) value, type);
if (!clientClip)
return BadAlloc;
- clientClipType = CT_REGION;
free(value);
break;
}
(*ps->DestroyPictureClip) (pPicture);
pPicture->clientClip = clientClip;
- pPicture->clientClipType = clientClipType;
pPicture->stateChanges |= CPClipMask;
return Success;
}
@@ -144,7 +124,7 @@ miValidatePicture(PicturePtr pPicture, Mask mask)
* copying of regions. (this wins especially if many clients clip
* by children and have no client clip.)
*/
- if (pPicture->clientClipType == CT_NONE) {
+ if (!pPicture->clientClip) {
if (freeCompClip)
RegionDestroy(pPicture->pCompositeClip);
pPicture->pCompositeClip = pregWin;
@@ -203,7 +183,7 @@ miValidatePicture(PicturePtr pPicture, Mask mask)
pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
}
- if (pPicture->clientClipType == CT_REGION) {
+ if (pPicture->clientClip) {
if (pDrawable->x || pDrawable->y) {
RegionTranslate(pPicture->clientClip,
pDrawable->x + pPicture->clipOrigin.x,
@@ -284,7 +264,7 @@ miClipPictureReg(pixman_region16_t * pRegion,
static inline Bool
miClipPictureSrc(RegionPtr pRegion, PicturePtr pPicture, int dx, int dy)
{
- if (pPicture->clientClipType != CT_NONE) {
+ if (pPicture->clientClip) {
Bool result;
pixman_region_translate(pPicture->clientClip,
diff --git a/xserver/render/mipict.h b/xserver/render/mipict.h
index a16dd3112..23ce9e8f6 100644
--- a/xserver/render/mipict.h
+++ b/xserver/render/mipict.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
diff --git a/xserver/render/mirect.c b/xserver/render/mirect.c
index 4e76972d1..a36d1d6e3 100644
--- a/xserver/render/mirect.c
+++ b/xserver/render/mirect.c
@@ -54,7 +54,7 @@ miColorRects(PicturePtr pDst,
tmpval[1].val = pixel;
tmpval[2].val = pDst->subWindowMode;
mask = GCFunction | GCForeground | GCSubwindowMode;
- if (pClipPict->clientClipType == CT_REGION) {
+ if (pClipPict->clientClip) {
tmpval[3].val = pDst->clipOrigin.x - xoff;
tmpval[4].val = pDst->clipOrigin.y - yoff;
mask |= GCClipXOrigin | GCClipYOrigin;
diff --git a/xserver/render/picture.c b/xserver/render/picture.c
index 7da93102b..6ff31ba02 100644
--- a/xserver/render/picture.c
+++ b/xserver/render/picture.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
@@ -41,6 +41,9 @@
#include "servermd.h"
#include "picturestr.h"
#include "xace.h"
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#endif
DevPrivateKeyRec PictureScreenPrivateKeyRec;
DevPrivateKeyRec PictureWindowPrivateKeyRec;
@@ -731,7 +734,6 @@ SetPictureToDefaults(PicturePtr pPicture)
pPicture->polyEdge = PolyEdgeSharp;
pPicture->polyMode = PolyModePrecise;
pPicture->freeCompClip = FALSE;
- pPicture->clientClipType = CT_NONE;
pPicture->componentAlpha = FALSE;
pPicture->repeatType = RepeatNone;
@@ -1008,6 +1010,38 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle,
return pPicture;
}
+static int
+cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
+{
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ PanoramiXRes *res;
+ int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE,
+ client, mode);
+ if (err != Success)
+ return err;
+ id = res->info[screen->myNum].id;
+ }
+#endif
+ return dixLookupResourceByType(result, id, PictureType, client, mode);
+}
+
+static int
+cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
+{
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ PanoramiXRes *res;
+ int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP,
+ client, mode);
+ if (err != Success)
+ return err;
+ id = res->info[screen->myNum].id;
+ }
+#endif
+ return dixLookupResourceByType(result, id, RT_PIXMAP, client, mode);
+}
+
#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val)
#define NEXT_PTR(_type) ((_type) ulist++->ptr)
@@ -1054,9 +1088,8 @@ ChangePicture(PicturePtr pPicture,
if (pid == None)
pAlpha = 0;
else {
- error = dixLookupResourceByType((void **) &pAlpha, pid,
- PictureType, client,
- DixReadAccess);
+ error = cpAlphaMap((void **) &pAlpha, pid, pScreen,
+ client, DixReadAccess);
if (error != Success) {
client->errorValue = pid;
break;
@@ -1113,9 +1146,8 @@ ChangePicture(PicturePtr pPicture,
}
else {
clipType = CT_PIXMAP;
- error = dixLookupResourceByType((void **) &pPixmap, pid,
- RT_PIXMAP, client,
- DixReadAccess);
+ error = cpClipMask((void **) &pPixmap, pid, pScreen,
+ client, DixReadAccess);
if (error != Success) {
client->errorValue = pid;
break;
@@ -1332,87 +1364,6 @@ SetPictureTransform(PicturePtr pPicture, PictTransform * transform)
return Success;
}
-void
-CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst)
-{
- PictureScreenPtr ps = GetPictureScreen(pSrc->pDrawable->pScreen);
- Mask origMask = mask;
-
- pDst->serialNumber |= GC_CHANGE_SERIAL_BIT;
- pDst->stateChanges |= mask;
-
- while (mask) {
- Mask bit = lowbit(mask);
-
- switch (bit) {
- case CPRepeat:
- pDst->repeat = pSrc->repeat;
- pDst->repeatType = pSrc->repeatType;
- break;
- case CPAlphaMap:
- if (pSrc->alphaMap &&
- pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP)
- pSrc->alphaMap->refcnt++;
- if (pDst->alphaMap)
- FreePicture((void *) pDst->alphaMap, (XID) 0);
- pDst->alphaMap = pSrc->alphaMap;
- break;
- case CPAlphaXOrigin:
- pDst->alphaOrigin.x = pSrc->alphaOrigin.x;
- break;
- case CPAlphaYOrigin:
- pDst->alphaOrigin.y = pSrc->alphaOrigin.y;
- break;
- case CPClipXOrigin:
- pDst->clipOrigin.x = pSrc->clipOrigin.x;
- break;
- case CPClipYOrigin:
- pDst->clipOrigin.y = pSrc->clipOrigin.y;
- break;
- case CPClipMask:
- switch (pSrc->clientClipType) {
- case CT_NONE:
- (*ps->ChangePictureClip) (pDst, CT_NONE, NULL, 0);
- break;
- case CT_REGION:
- if (!pSrc->clientClip) {
- (*ps->ChangePictureClip) (pDst, CT_NONE, NULL, 0);
- }
- else {
- RegionPtr clientClip;
- RegionPtr srcClientClip = (RegionPtr) pSrc->clientClip;
-
- clientClip = RegionCreate(RegionExtents(srcClientClip),
- RegionNumRects(srcClientClip));
- (*ps->ChangePictureClip) (pDst, CT_REGION, clientClip, 0);
- }
- break;
- default:
- /* XXX: CT_PIXMAP unimplemented */
- break;
- }
- break;
- case CPGraphicsExposure:
- pDst->graphicsExposures = pSrc->graphicsExposures;
- break;
- case CPPolyEdge:
- pDst->polyEdge = pSrc->polyEdge;
- break;
- case CPPolyMode:
- pDst->polyMode = pSrc->polyMode;
- break;
- case CPDither:
- break;
- case CPComponentAlpha:
- pDst->componentAlpha = pSrc->componentAlpha;
- break;
- }
- mask &= ~bit;
- }
-
- (*ps->ChangePicture) (pDst, origMask);
-}
-
static void
ValidateOnePicture(PicturePtr pPicture)
{
diff --git a/xserver/render/picture.h b/xserver/render/picture.h
index c85353a44..66c85c56f 100644
--- a/xserver/render/picture.h
+++ b/xserver/render/picture.h
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
@@ -129,7 +129,7 @@ typedef enum _PictFormatShort {
} PictFormatShort;
/*
- * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
+ * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
* selection of colors allocated for drawing to Pictures. The default
* policy depends on the size of the colormap:
*
@@ -189,8 +189,8 @@ typedef pixman_fixed_1_16_t xFixed_1_16;
typedef pixman_fixed_16_16_t xFixed_16_16;
/*
- * An unadorned "xFixed" is the same as xFixed_16_16,
- * (since it's quite common in the code)
+ * An unadorned "xFixed" is the same as xFixed_16_16,
+ * (since it's quite common in the code)
*/
typedef pixman_fixed_t xFixed;
diff --git a/xserver/render/picturestr.h b/xserver/render/picturestr.h
index 8c8100d81..177f87b80 100644
--- a/xserver/render/picturestr.h
+++ b/xserver/render/picturestr.h
@@ -132,7 +132,6 @@ typedef struct _Picture {
unsigned int polyEdge:1;
unsigned int polyMode:1;
unsigned int freeCompClip:1;
- unsigned int clientClipType:2;
unsigned int componentAlpha:1;
unsigned int repeatType:2;
unsigned int filter:3;
@@ -145,7 +144,7 @@ typedef struct _Picture {
DDXPointRec alphaOrigin;
DDXPointRec clipOrigin;
- void *clientClip;
+ RegionPtr clientClip;
unsigned long serialNumber;
@@ -476,9 +475,6 @@ extern _X_EXPORT int
SetPictureTransform(PicturePtr pPicture, PictTransform * transform);
extern _X_EXPORT void
- CopyPicture(PicturePtr pSrc, Mask mask, PicturePtr pDst);
-
-extern _X_EXPORT void
ValidatePicture(PicturePtr pPicture);
extern _X_EXPORT int
diff --git a/xserver/render/render.c b/xserver/render/render.c
index 60834477b..723f380c2 100644
--- a/xserver/render/render.c
+++ b/xserver/render/render.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
@@ -1548,7 +1548,7 @@ ProcRenderCreateCursor(ClientPtr client)
FreePicture(pPicture, 0);
}
/*
- * Check whether the cursor can be directly supported by
+ * Check whether the cursor can be directly supported by
* the core cursor code
*/
ncolor = 0;