diff options
author | marha <marha@users.sourceforge.net> | 2010-06-11 12:14:52 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-06-11 12:14:52 +0000 |
commit | 4c61bf84b11e26e6f22648668c95ea760a379163 (patch) | |
tree | 0ac762ab2815eae283dded7447ad7cb5a54b926a /xorg-server/render | |
parent | e1dabd2ce8be0d70c6c15353b58de256129dfd1f (diff) | |
download | vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.gz vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.bz2 vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.zip |
xserver git update 11/6/2010
Diffstat (limited to 'xorg-server/render')
-rw-r--r-- | xorg-server/render/animcur.c | 19 | ||||
-rw-r--r-- | xorg-server/render/glyph.c | 38 | ||||
-rw-r--r-- | xorg-server/render/mipict.c | 42 | ||||
-rw-r--r-- | xorg-server/render/mirect.c | 7 | ||||
-rw-r--r-- | xorg-server/render/picture.c | 42 | ||||
-rw-r--r-- | xorg-server/render/picture.h | 463 | ||||
-rw-r--r-- | xorg-server/render/picturestr.h | 10 | ||||
-rw-r--r-- | xorg-server/render/render.c | 82 |
8 files changed, 350 insertions, 353 deletions
diff --git a/xorg-server/render/animcur.c b/xorg-server/render/animcur.c index 13f09d387..505c65c18 100644 --- a/xorg-server/render/animcur.c +++ b/xorg-server/render/animcur.c @@ -76,11 +76,11 @@ static CursorBits animCursorBits = { empty, empty, 2, 1, 1, 0, 0, 1
};
-static int AnimCurScreenPrivateKeyIndex;
-static DevPrivateKey AnimCurScreenPrivateKey = &AnimCurScreenPrivateKeyIndex;
+static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
+#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec)
#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits))
-#define GetAnimCur(c) ((AnimCurPtr) ((c) + 1))
+#define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE))))
#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey))
#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p)
@@ -322,6 +322,9 @@ AnimCurInit (ScreenPtr pScreen) {
AnimCurScreenPtr as;
+ if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
as = (AnimCurScreenPtr) malloc(sizeof (AnimCurScreenRec));
if (!as)
return FALSE;
@@ -354,11 +357,12 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp if (IsAnimCur (cursors[i]))
return BadMatch;
- pCursor = (CursorPtr) malloc(sizeof (CursorRec) +
- sizeof (AnimCurRec) +
- ncursor * sizeof (AnimCurElt));
+ pCursor = (CursorPtr) calloc(CURSOR_REC_SIZE +
+ sizeof (AnimCurRec) +
+ ncursor * sizeof (AnimCurElt), 1);
if (!pCursor)
return BadAlloc;
+ dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR);
pCursor->bits = &animCursorBits;
pCursor->refcnt = 1;
@@ -371,13 +375,12 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp pCursor->backBlue = cursors[0]->backBlue;
pCursor->id = cid;
- pCursor->devPrivates = NULL;
/* security creation/labeling check */
rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
RT_NONE, NULL, DixCreateAccess);
if (rc != Success) {
- dixFreePrivates(pCursor->devPrivates);
+ dixFiniPrivates(pCursor, PRIVATE_CURSOR);
free(pCursor);
return rc;
}
diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c index b147331c8..ab20da625 100644 --- a/xorg-server/render/glyph.c +++ b/xorg-server/render/glyph.c @@ -84,19 +84,13 @@ static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; static GlyphHashRec globalGlyphs[GlyphFormatNum];
-static void
-FreeGlyphPrivates (GlyphPtr glyph)
-{
- dixFreePrivates(glyph->devPrivates);
- glyph->devPrivates = NULL;
-}
-
void
GlyphUninit (ScreenPtr pScreen)
{
PictureScreenPtr ps = GetPictureScreen (pScreen);
GlyphPtr glyph;
int fdepth, i;
+ int scrno = pScreen->myNum;
for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
{
@@ -108,8 +102,12 @@ GlyphUninit (ScreenPtr pScreen) glyph = globalGlyphs[fdepth].table[i].glyph;
if (glyph && glyph != DeletedGlyph)
{
+ if (GlyphPicture(glyph)[scrno])
+ {
+ FreePicture ((pointer) GlyphPicture (glyph)[scrno], 0);
+ GlyphPicture(glyph)[scrno] = NULL;
+ }
(*ps->UnrealizeGlyph) (pScreen, glyph);
- FreeGlyphPrivates(glyph);
}
}
}
@@ -301,8 +299,7 @@ FreeGlyph (GlyphPtr glyph, int format) }
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
}
}
@@ -320,8 +317,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) if (gr->glyph && gr->glyph != DeletedGlyph && gr->glyph != glyph)
{
FreeGlyphPicture(glyph);
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
glyph = gr->glyph;
}
else if (gr->glyph != glyph)
@@ -379,15 +375,17 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) int size;
GlyphPtr glyph;
int i;
+ int head_size;
- size = screenInfo.numScreens * sizeof (PicturePtr);
- glyph = (GlyphPtr) malloc(size + sizeof (GlyphRec));
+ head_size = sizeof (GlyphRec) + screenInfo.numScreens * sizeof (PicturePtr);
+ size = (head_size + dixPrivatesSize(PRIVATE_GLYPH));
+ glyph = (GlyphPtr) malloc (size);
if (!glyph)
return 0;
glyph->refcnt = 0;
glyph->size = size + sizeof (xGlyphInfo);
glyph->info = *gi;
- glyph->devPrivates = NULL;
+ dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
for (i = 0; i < screenInfo.numScreens; i++)
{
@@ -411,8 +409,7 @@ bail: (*ps->UnrealizeGlyph) (screenInfo.screens[i], glyph);
}
- FreeGlyphPrivates(glyph);
- free(glyph);
+ dixFreeObjectWithPrivates(glyph, PRIVATE_GLYPH);
return 0;
}
@@ -481,7 +478,6 @@ GlyphSetPtr AllocateGlyphSet (int fdepth, PictFormatPtr format)
{
GlyphSetPtr glyphSet;
- int size;
if (!globalGlyphs[fdepth].hashSet)
{
@@ -489,8 +485,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) return FALSE;
}
- size = sizeof (GlyphSetRec);
- glyphSet = calloc(1, size);
+ glyphSet = dixAllocateObjectWithPrivates(GlyphSetRec, PRIVATE_GLYPHSET);
if (!glyphSet)
return FALSE;
@@ -532,8 +527,7 @@ FreeGlyphSet (pointer value, else
ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE);
free(table);
- dixFreePrivates(glyphSet->devPrivates);
- free(glyphSet);
+ dixFreeObjectWithPrivates(glyphSet, PRIVATE_GLYPHSET);
}
return Success;
}
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c index 3f88beba2..0f8076243 100644 --- a/xorg-server/render/mipict.c +++ b/xorg-server/render/mipict.c @@ -47,7 +47,7 @@ void miDestroyPicture (PicturePtr pPicture)
{
if (pPicture->freeCompClip)
- REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip);
+ RegionDestroy(pPicture->pCompositeClip);
}
void
@@ -64,7 +64,7 @@ miDestroyPictureClip (PicturePtr pPicture) * we know we'll never have a list of rectangles, since ChangeClip
* immediately turns them into a region
*/
- REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip);
+ RegionDestroy(pPicture->clientClip);
break;
}
pPicture->clientClip = NULL;
@@ -85,7 +85,7 @@ miChangePictureClip (PicturePtr pPicture, switch (type) {
case CT_PIXMAP:
/* convert the pixmap to a region */
- clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value);
+ clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
if (!clientClip)
return BadAlloc;
clientClipType = CT_REGION;
@@ -100,7 +100,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE;
break;
default:
- clientClip = (pointer) RECTS_TO_REGION(pScreen, n,
+ clientClip = (pointer) RegionFromRects(n,
(xRectangle *) value,
type);
if (!clientClip)
@@ -160,7 +160,7 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->clientClipType == CT_NONE)
{
if (freeCompClip)
- REGION_DESTROY(pScreen, pPicture->pCompositeClip);
+ RegionDestroy(pPicture->pCompositeClip);
pPicture->pCompositeClip = pregWin;
pPicture->freeCompClip = freeTmpClip;
}
@@ -175,30 +175,30 @@ miValidatePicture (PicturePtr pPicture, * clip. if neither is real, create a new region.
*/
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
+ RegionTranslate(pPicture->clientClip,
pDrawable->x + pPicture->clipOrigin.x,
pDrawable->y + pPicture->clipOrigin.y);
if (freeCompClip)
{
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
+ RegionIntersect(pPicture->pCompositeClip,
pregWin, pPicture->clientClip);
if (freeTmpClip)
- REGION_DESTROY(pScreen, pregWin);
+ RegionDestroy(pregWin);
}
else if (freeTmpClip)
{
- REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip);
+ RegionIntersect(pregWin, pregWin, pPicture->clientClip);
pPicture->pCompositeClip = pregWin;
}
else
{
- pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
+ pPicture->pCompositeClip = RegionCreate(NullBox, 0);
+ RegionIntersect(pPicture->pCompositeClip,
pregWin, pPicture->clientClip);
}
pPicture->freeCompClip = TRUE;
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
+ RegionTranslate(pPicture->clientClip,
-(pDrawable->x + pPicture->clipOrigin.x),
-(pDrawable->y + pPicture->clipOrigin.y));
}
@@ -216,31 +216,31 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->freeCompClip)
{
- REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds);
+ RegionReset(pPicture->pCompositeClip, &pixbounds);
}
else
{
pPicture->freeCompClip = TRUE;
- pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1);
+ pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
}
if (pPicture->clientClipType == CT_REGION)
{
if(pDrawable->x || pDrawable->y) {
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
+ RegionTranslate(pPicture->clientClip,
pDrawable->x + pPicture->clipOrigin.x,
pDrawable->y + pPicture->clipOrigin.y);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
+ RegionIntersect(pPicture->pCompositeClip,
pPicture->pCompositeClip, pPicture->clientClip);
- REGION_TRANSLATE(pScreen, pPicture->clientClip,
+ RegionTranslate(pPicture->clientClip,
-(pDrawable->x + pPicture->clipOrigin.x),
-(pDrawable->y + pPicture->clipOrigin.y));
} else {
- REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
+ RegionTranslate(pPicture->pCompositeClip,
-pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
- REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
+ RegionIntersect(pPicture->pCompositeClip,
pPicture->pCompositeClip, pPicture->clientClip);
- REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
+ RegionTranslate(pPicture->pCompositeClip,
pPicture->clipOrigin.x, pPicture->clipOrigin.y);
}
}
@@ -321,7 +321,7 @@ miClipPictureSrc (RegionPtr pRegion, pPicture->clipOrigin.x + dx,
pPicture->clipOrigin.y + dy);
- result = REGION_INTERSECT (pScreen, pRegion, pRegion, pPicture->clientClip);
+ result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
pixman_region_translate ( pPicture->clientClip,
- (pPicture->clipOrigin.x + dx),
diff --git a/xorg-server/render/mirect.c b/xorg-server/render/mirect.c index 70bdf63f6..d0becd578 100644 --- a/xorg-server/render/mirect.c +++ b/xorg-server/render/mirect.c @@ -42,7 +42,6 @@ miColorRects (PicturePtr pDst, int xoff,
int yoff)
{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
CARD32 pixel;
GCPtr pGC;
ChangeGCVal tmpval[5];
@@ -51,7 +50,7 @@ miColorRects (PicturePtr pDst, miRenderColorToPixel (pDst->pFormat, color, &pixel);
- pGC = GetScratchGC (pDst->pDrawable->depth, pScreen);
+ pGC = GetScratchGC (pDst->pDrawable->depth, pDst->pDrawable->pScreen);
if (!pGC)
return;
tmpval[0].val = GXcopy;
@@ -64,8 +63,8 @@ miColorRects (PicturePtr pDst, tmpval[4].val = pDst->clipOrigin.y - yoff;
mask |= GCClipXOrigin|GCClipYOrigin;
- pClip = REGION_CREATE (pScreen, NULL, 1);
- REGION_COPY (pScreen, pClip,
+ pClip = RegionCreate(NULL, 1);
+ RegionCopy(pClip,
(RegionPtr) pClipPict->clientClip);
(*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0);
}
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index a67a95888..17b1a2714 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -42,10 +42,8 @@ #include "picturestr.h"
#include "xace.h"
-static int PictureScreenPrivateKeyIndex;
-DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKeyIndex;
-static int PictureWindowPrivateKeyIndex;
-DevPrivateKey PictureWindowPrivateKey = &PictureWindowPrivateKeyIndex;
+DevPrivateKeyRec PictureScreenPrivateKeyRec;
+DevPrivateKeyRec PictureWindowPrivateKeyRec;
static int PictureGeneration;
RESTYPE PictureType;
RESTYPE PictFormatType;
@@ -628,6 +626,12 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) return FALSE;
PictureGeneration = serverGeneration;
}
+ if (!dixRegisterPrivateKey(&PictureScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
+ if (!dixRegisterPrivateKey(&PictureWindowPrivateKeyRec, PRIVATE_WINDOW, 0))
+ return FALSE;
+
if (!formats)
{
formats = PictureCreateDefaultFormats (pScreen, &nformats);
@@ -753,7 +757,7 @@ CreatePicture (Picture pid, PicturePtr pPicture;
PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
- pPicture = (PicturePtr)malloc(sizeof(PictureRec));
+ pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE);
if (!pPicture)
{
*error = BadAlloc;
@@ -764,7 +768,6 @@ CreatePicture (Picture pid, pPicture->pDrawable = pDrawable;
pPicture->pFormat = pFormat;
pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
- pPicture->devPrivates = NULL;
/* security creation/labeling check */
*error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType, pPicture,
@@ -896,12 +899,11 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void)
{
PicturePtr pPicture;
- pPicture = (PicturePtr) malloc(sizeof(PictureRec));
+ pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE);
pPicture->pDrawable = 0;
pPicture->pFormat = 0;
pPicture->pNext = 0;
pPicture->format = PICT_a8r8g8b8;
- pPicture->devPrivates = 0;
SetPictureToDefaults(pPicture);
return pPicture;
@@ -1298,8 +1300,7 @@ SetPictureClipRects (PicturePtr pPicture, RegionPtr clientClip;
int result;
- clientClip = RECTS_TO_REGION(pScreen,
- nRect, rects, CT_UNSORTED);
+ clientClip = RegionFromRects(nRect, rects, CT_UNSORTED);
if (!clientClip)
return BadAlloc;
result =(*ps->ChangePictureClip) (pPicture, CT_REGION,
@@ -1329,14 +1330,13 @@ SetPictureClipRegion (PicturePtr pPicture, if (pRegion)
{
type = CT_REGION;
- clientClip = REGION_CREATE (pScreen,
- REGION_EXTENTS(pScreen, pRegion),
- REGION_NUM_RECTS(pRegion));
+ clientClip = RegionCreate(RegionExtents(pRegion),
+ RegionNumRects(pRegion));
if (!clientClip)
return BadAlloc;
- if (!REGION_COPY (pSCreen, clientClip, pRegion))
+ if (!RegionCopy(clientClip, pRegion))
{
- REGION_DESTROY (pScreen, clientClip);
+ RegionDestroy(clientClip);
return BadAlloc;
}
}
@@ -1462,9 +1462,9 @@ CopyPicture (PicturePtr pSrc, RegionPtr clientClip;
RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip;
- clientClip = REGION_CREATE(pSrc->pDrawable->pScreen,
- REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip),
- REGION_NUM_RECTS(srcClientClip));
+ clientClip = RegionCreate(
+ RegionExtents(srcClientClip),
+ RegionNumRects(srcClientClip));
(*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0);
}
break;
@@ -1524,8 +1524,7 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0)
{
- if (pPicture->transform)
- free(pPicture->transform);
+ free(pPicture->transform);
if (pPicture->pSourcePict)
{
@@ -1566,8 +1565,7 @@ FreePicture (pointer value, (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable);
}
}
- dixFreePrivates(pPicture->devPrivates);
- free(pPicture);
+ dixFreeObjectWithPrivates(pPicture, PRIVATE_PICTURE);
}
return Success;
}
diff --git a/xorg-server/render/picture.h b/xorg-server/render/picture.h index 8bd38b98e..461bbf01b 100644 --- a/xorg-server/render/picture.h +++ b/xorg-server/render/picture.h @@ -1,232 +1,231 @@ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * 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 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _PICTURE_H_ -#define _PICTURE_H_ - -#include "privates.h" - -#include <pixman.h> - -typedef struct _DirectFormat *DirectFormatPtr; -typedef struct _PictFormat *PictFormatPtr; -typedef struct _Picture *PicturePtr; - -/* - * While the protocol is generous in format support, the - * sample implementation allows only packed RGB and GBR - * representations for data to simplify software rendering, - */ -#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b) - -/* - * gray/color formats use a visual index instead of argb - */ -#define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \ - ((type) << 16) | \ - ((vi))) - -#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f) -#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f) -#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f) -#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f) -#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f) -#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f) -#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f) -#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f) - -#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER -#define PICT_TYPE_A PIXMAN_TYPE_A -#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB -#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR -#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR -#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY -#define PICT_TYPE_BGRA PIXMAN_TYPE_BGRA - -#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f) - -/* 32bpp formats */ -typedef enum _PictFormatShort { - PICT_a2r10g10b10 = PIXMAN_a2r10g10b10, - PICT_x2r10g10b10 = PIXMAN_x2r10g10b10, - PICT_a2b10g10r10 = PIXMAN_a2b10g10r10, - PICT_x2b10g10r10 = PIXMAN_x2b10g10r10, - - PICT_a8r8g8b8 = PIXMAN_a8r8g8b8, - PICT_x8r8g8b8 = PIXMAN_x8r8g8b8, - PICT_a8b8g8r8 = PIXMAN_a8b8g8r8, - PICT_x8b8g8r8 = PIXMAN_x8b8g8r8, - PICT_b8g8r8a8 = PIXMAN_b8g8r8a8, - PICT_b8g8r8x8 = PIXMAN_b8g8r8x8, - -/* 24bpp formats */ - PICT_r8g8b8 = PIXMAN_r8g8b8, - PICT_b8g8r8 = PIXMAN_b8g8r8, - -/* 16bpp formats */ - PICT_r5g6b5 = PIXMAN_r5g6b5, - PICT_b5g6r5 = PIXMAN_b5g6r5, - - PICT_a1r5g5b5 = PIXMAN_a1r5g5b5, - PICT_x1r5g5b5 = PIXMAN_x1r5g5b5, - PICT_a1b5g5r5 = PIXMAN_a1b5g5r5, - PICT_x1b5g5r5 = PIXMAN_x1b5g5r5, - PICT_a4r4g4b4 = PIXMAN_a4r4g4b4, - PICT_x4r4g4b4 = PIXMAN_x4r4g4b4, - PICT_a4b4g4r4 = PIXMAN_a4b4g4r4, - PICT_x4b4g4r4 = PIXMAN_x4b4g4r4, - -/* 8bpp formats */ - PICT_a8 = PIXMAN_a8, - PICT_r3g3b2 = PIXMAN_r3g3b2, - PICT_b2g3r3 = PIXMAN_b2g3r3, - PICT_a2r2g2b2 = PIXMAN_a2r2g2b2, - PICT_a2b2g2r2 = PIXMAN_a2b2g2r2, - - PICT_c8 = PIXMAN_c8, - PICT_g8 = PIXMAN_g8, - - PICT_x4a4 = PIXMAN_x4a4, - - PICT_x4c4 = PIXMAN_x4c4, - PICT_x4g4 = PIXMAN_x4g4, - -/* 4bpp formats */ - PICT_a4 = PIXMAN_a4, - PICT_r1g2b1 = PIXMAN_r1g2b1, - PICT_b1g2r1 = PIXMAN_b1g2r1, - PICT_a1r1g1b1 = PIXMAN_a1r1g1b1, - PICT_a1b1g1r1 = PIXMAN_a1b1g1r1, - - PICT_c4 = PIXMAN_c4, - PICT_g4 = PIXMAN_g4, - -/* 1bpp formats */ - PICT_a1 = PIXMAN_a1, - - PICT_g1 = PIXMAN_g1 -} PictFormatShort; - -/* - * 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: - * - * Size Default Policy - * ---------------------------- - * < 64 PolicyMono - * < 256 PolicyGray - * 256 PolicyColor (only on PseudoColor) - * - * The actual allocation code lives in miindex.c, and so is - * austensibly server dependent, but that code does: - * - * PolicyMono Allocate no additional colors, use black and white - * PolicyGray Allocate 13 gray levels (11 cells used) - * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used) - * PolicyAll Allocate as big a cube as possible, fill with gray (all) - * - * Here's a picture to help understand how many colors are - * actually allocated (this is just the gray ramp): - * - * gray level - * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff - * b/w 0000 ffff - * 4x4x4 5555 aaaa - * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa - * - * The default colormap supplies two gray levels (black/white), the - * 4x4x4 cube allocates another two and nine more are allocated to fill - * in the 13 levels. When the 4x4x4 cube is not allocated, a total of - * 11 cells are allocated. - */ - -#define PictureCmapPolicyInvalid -1 -#define PictureCmapPolicyDefault 0 -#define PictureCmapPolicyMono 1 -#define PictureCmapPolicyGray 2 -#define PictureCmapPolicyColor 3 -#define PictureCmapPolicyAll 4 - -extern _X_EXPORT int PictureCmapPolicy; - -extern _X_EXPORT int PictureParseCmapPolicy (const char *name); - -extern _X_EXPORT int RenderErrBase; -extern _X_EXPORT DevPrivateKey RenderClientPrivateKey; - -/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */ - -typedef pixman_fixed_32_32_t xFixed_32_32; - -typedef pixman_fixed_48_16_t xFixed_48_16; - -#define MAX_FIXED_48_16 pixman_max_fixed_48_16 -#define MIN_FIXED_48_16 pixman_min_fixed_48_16 - -typedef pixman_fixed_1_31_t xFixed_1_31; -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) - */ -typedef pixman_fixed_t xFixed; -#define XFIXED_BITS 16 - -#define xFixedToInt(f) pixman_fixed_to_int(f) -#define IntToxFixed(i) pixman_int_to_fixed(i) -#define xFixedE pixman_fixed_e -#define xFixed1 pixman_fixed_1 -#define xFixed1MinusE pixman_fixed_1_minus_e -#define xFixedFrac(f) pixman_fixed_frac(f) -#define xFixedFloor(f) pixman_fixed_floor(f) -#define xFixedCeil(f) pixman_fixed_ceil(f) - -#define xFixedFraction(f) pixman_fixed_fraction(f) -#define xFixedMod2(f) pixman_fixed_mod2(f) - -/* whether 't' is a well defined not obviously empty trapezoid */ -#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \ - (t)->right.p1.y != (t)->right.p2.y && \ - (int) ((t)->bottom - (t)->top) > 0) - -/* - * Standard NTSC luminance conversions: - * - * y = r * 0.299 + g * 0.587 + b * 0.114 - * - * Approximate this for a bit more speed: - * - * y = (r * 153 + g * 301 + b * 58) / 512 - * - * This gives 17 bits of luminance; to get 15 bits, lop the low two - */ - -#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \ - (((s) >> 8) & 0xff) * 301 + \ - (((s) ) & 0xff) * 58) >> 2) - -#endif /* _PICTURE_H_ */ +/*
+ *
+ * Copyright © 2000 SuSE, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * 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
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _PICTURE_H_
+#define _PICTURE_H_
+
+#include "privates.h"
+
+#include <pixman.h>
+
+typedef struct _DirectFormat *DirectFormatPtr;
+typedef struct _PictFormat *PictFormatPtr;
+typedef struct _Picture *PicturePtr;
+
+/*
+ * While the protocol is generous in format support, the
+ * sample implementation allows only packed RGB and GBR
+ * representations for data to simplify software rendering,
+ */
+#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT(bpp, type, a, r, g, b)
+
+/*
+ * gray/color formats use a visual index instead of argb
+ */
+#define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \
+ ((type) << 16) | \
+ ((vi)))
+
+#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP(f)
+#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE(f)
+#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A(f)
+#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R(f)
+#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G(f)
+#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B(f)
+#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB(f)
+#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS(f)
+
+#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER
+#define PICT_TYPE_A PIXMAN_TYPE_A
+#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB
+#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR
+#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR
+#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY
+#define PICT_TYPE_BGRA PIXMAN_TYPE_BGRA
+
+#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR(f)
+
+/* 32bpp formats */
+typedef enum _PictFormatShort {
+ PICT_a2r10g10b10 = PIXMAN_a2r10g10b10,
+ PICT_x2r10g10b10 = PIXMAN_x2r10g10b10,
+ PICT_a2b10g10r10 = PIXMAN_a2b10g10r10,
+ PICT_x2b10g10r10 = PIXMAN_x2b10g10r10,
+
+ PICT_a8r8g8b8 = PIXMAN_a8r8g8b8,
+ PICT_x8r8g8b8 = PIXMAN_x8r8g8b8,
+ PICT_a8b8g8r8 = PIXMAN_a8b8g8r8,
+ PICT_x8b8g8r8 = PIXMAN_x8b8g8r8,
+ PICT_b8g8r8a8 = PIXMAN_b8g8r8a8,
+ PICT_b8g8r8x8 = PIXMAN_b8g8r8x8,
+
+/* 24bpp formats */
+ PICT_r8g8b8 = PIXMAN_r8g8b8,
+ PICT_b8g8r8 = PIXMAN_b8g8r8,
+
+/* 16bpp formats */
+ PICT_r5g6b5 = PIXMAN_r5g6b5,
+ PICT_b5g6r5 = PIXMAN_b5g6r5,
+
+ PICT_a1r5g5b5 = PIXMAN_a1r5g5b5,
+ PICT_x1r5g5b5 = PIXMAN_x1r5g5b5,
+ PICT_a1b5g5r5 = PIXMAN_a1b5g5r5,
+ PICT_x1b5g5r5 = PIXMAN_x1b5g5r5,
+ PICT_a4r4g4b4 = PIXMAN_a4r4g4b4,
+ PICT_x4r4g4b4 = PIXMAN_x4r4g4b4,
+ PICT_a4b4g4r4 = PIXMAN_a4b4g4r4,
+ PICT_x4b4g4r4 = PIXMAN_x4b4g4r4,
+
+/* 8bpp formats */
+ PICT_a8 = PIXMAN_a8,
+ PICT_r3g3b2 = PIXMAN_r3g3b2,
+ PICT_b2g3r3 = PIXMAN_b2g3r3,
+ PICT_a2r2g2b2 = PIXMAN_a2r2g2b2,
+ PICT_a2b2g2r2 = PIXMAN_a2b2g2r2,
+
+ PICT_c8 = PIXMAN_c8,
+ PICT_g8 = PIXMAN_g8,
+
+ PICT_x4a4 = PIXMAN_x4a4,
+
+ PICT_x4c4 = PIXMAN_x4c4,
+ PICT_x4g4 = PIXMAN_x4g4,
+
+/* 4bpp formats */
+ PICT_a4 = PIXMAN_a4,
+ PICT_r1g2b1 = PIXMAN_r1g2b1,
+ PICT_b1g2r1 = PIXMAN_b1g2r1,
+ PICT_a1r1g1b1 = PIXMAN_a1r1g1b1,
+ PICT_a1b1g1r1 = PIXMAN_a1b1g1r1,
+
+ PICT_c4 = PIXMAN_c4,
+ PICT_g4 = PIXMAN_g4,
+
+/* 1bpp formats */
+ PICT_a1 = PIXMAN_a1,
+
+ PICT_g1 = PIXMAN_g1
+} PictFormatShort;
+
+/*
+ * 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:
+ *
+ * Size Default Policy
+ * ----------------------------
+ * < 64 PolicyMono
+ * < 256 PolicyGray
+ * 256 PolicyColor (only on PseudoColor)
+ *
+ * The actual allocation code lives in miindex.c, and so is
+ * austensibly server dependent, but that code does:
+ *
+ * PolicyMono Allocate no additional colors, use black and white
+ * PolicyGray Allocate 13 gray levels (11 cells used)
+ * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used)
+ * PolicyAll Allocate as big a cube as possible, fill with gray (all)
+ *
+ * Here's a picture to help understand how many colors are
+ * actually allocated (this is just the gray ramp):
+ *
+ * gray level
+ * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff
+ * b/w 0000 ffff
+ * 4x4x4 5555 aaaa
+ * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa
+ *
+ * The default colormap supplies two gray levels (black/white), the
+ * 4x4x4 cube allocates another two and nine more are allocated to fill
+ * in the 13 levels. When the 4x4x4 cube is not allocated, a total of
+ * 11 cells are allocated.
+ */
+
+#define PictureCmapPolicyInvalid -1
+#define PictureCmapPolicyDefault 0
+#define PictureCmapPolicyMono 1
+#define PictureCmapPolicyGray 2
+#define PictureCmapPolicyColor 3
+#define PictureCmapPolicyAll 4
+
+extern _X_EXPORT int PictureCmapPolicy;
+
+extern _X_EXPORT int PictureParseCmapPolicy (const char *name);
+
+extern _X_EXPORT int RenderErrBase;
+
+/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
+
+typedef pixman_fixed_32_32_t xFixed_32_32;
+
+typedef pixman_fixed_48_16_t xFixed_48_16;
+
+#define MAX_FIXED_48_16 pixman_max_fixed_48_16
+#define MIN_FIXED_48_16 pixman_min_fixed_48_16
+
+typedef pixman_fixed_1_31_t xFixed_1_31;
+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)
+ */
+typedef pixman_fixed_t xFixed;
+#define XFIXED_BITS 16
+
+#define xFixedToInt(f) pixman_fixed_to_int(f)
+#define IntToxFixed(i) pixman_int_to_fixed(i)
+#define xFixedE pixman_fixed_e
+#define xFixed1 pixman_fixed_1
+#define xFixed1MinusE pixman_fixed_1_minus_e
+#define xFixedFrac(f) pixman_fixed_frac(f)
+#define xFixedFloor(f) pixman_fixed_floor(f)
+#define xFixedCeil(f) pixman_fixed_ceil(f)
+
+#define xFixedFraction(f) pixman_fixed_fraction(f)
+#define xFixedMod2(f) pixman_fixed_mod2(f)
+
+/* whether 't' is a well defined not obviously empty trapezoid */
+#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
+ (t)->right.p1.y != (t)->right.p2.y && \
+ (int) ((t)->bottom - (t)->top) > 0)
+
+/*
+ * Standard NTSC luminance conversions:
+ *
+ * y = r * 0.299 + g * 0.587 + b * 0.114
+ *
+ * Approximate this for a bit more speed:
+ *
+ * y = (r * 153 + g * 301 + b * 58) / 512
+ *
+ * This gives 17 bits of luminance; to get 15 bits, lop the low two
+ */
+
+#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
+ (((s) >> 8) & 0xff) * 301 + \
+ (((s) ) & 0xff) * 58) >> 2)
+
+#endif /* _PICTURE_H_ */
diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h index 7d04deacf..ca6d5868b 100644 --- a/xorg-server/render/picturestr.h +++ b/xorg-server/render/picturestr.h @@ -396,14 +396,18 @@ typedef struct _PictureScreen { } PictureScreenRec, *PictureScreenPtr;
-extern _X_EXPORT DevPrivateKey PictureScreenPrivateKey;
-extern _X_EXPORT DevPrivateKey PictureWindowPrivateKey;
+extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
+#define PictureScreenPrivateKey (&PictureScreenPrivateKeyRec)
+
+extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec;
+#define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec)
+
extern _X_EXPORT RESTYPE PictureType;
extern _X_EXPORT RESTYPE PictFormatType;
extern _X_EXPORT RESTYPE GlyphSetType;
#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
-#define GetPictureScreenIfSet(s) GetPictureScreen(s)
+#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
#define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p)
#define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey))
#define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)
diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index 600ffc645..cbd70cc7e 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -210,8 +210,8 @@ int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { };
int RenderErrBase;
-static int RenderClientPrivateKeyIndex;
-DevPrivateKey RenderClientPrivateKey = &RenderClientPrivateKeyIndex;
+static DevPrivateKeyRec RenderClientPrivateKeyRec;
+#define RenderClientPrivateKey (&RenderClientPrivateKeyRec )
typedef struct _RenderClient {
int major_version;
@@ -246,7 +246,7 @@ RenderExtensionInit (void) return;
if (!PictureFinishInit ())
return;
- if (!dixRequestPrivate(RenderClientPrivateKey, sizeof(RenderClientRec)))
+ if (!dixRegisterPrivateKey(&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec)))
return;
if (!AddCallback (&ClientStateCallback, RenderClientCallback, 0))
return;
@@ -852,7 +852,7 @@ ProcRenderTriStrip (ClientPtr client) pFormat = 0;
npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
if (npoints & 4)
- return(BadLength);
+ return BadLength;
npoints >>= 3;
if (npoints >= 3)
CompositeTriStrip (stuff->op, pSrc, pDst, pFormat,
@@ -892,7 +892,7 @@ ProcRenderTriFan (ClientPtr client) pFormat = 0;
npoints = ((client->req_len << 2) - sizeof (xRenderTriStripReq));
if (npoints & 4)
- return(BadLength);
+ return BadLength;
npoints >>= 3;
if (npoints >= 3)
CompositeTriFan (stuff->op, pSrc, pDst, pFormat,
@@ -1461,7 +1461,7 @@ ProcRenderFillRectangles (ClientPtr client) things = (client->req_len << 2) - sizeof(xRenderFillRectanglesReq);
if (things & 4)
- return(BadLength);
+ return BadLength;
things >>= 3;
CompositeRects (stuff->op,
@@ -1530,10 +1530,10 @@ ProcRenderCreateCursor (ClientPtr client) return BadAlloc;
if ( stuff->x > width
|| stuff->y > height )
- return (BadMatch);
+ return BadMatch;
argbbits = malloc(width * height * sizeof (CARD32));
if (!argbbits)
- return (BadAlloc);
+ return BadAlloc;
stride = BitmapBytePad(width);
nbytes_mono = stride*height;
@@ -1541,14 +1541,14 @@ ProcRenderCreateCursor (ClientPtr client) if (!srcbits)
{
free(argbbits);
- return (BadAlloc);
+ return BadAlloc;
}
mskbits = calloc(1, nbytes_mono);
if (!mskbits)
{
free(argbbits);
free(srcbits);
- return (BadAlloc);
+ return BadAlloc;
}
if (pSrc->format == PICT_a8r8g8b8)
@@ -1570,7 +1570,7 @@ ProcRenderCreateCursor (ClientPtr client) free(argbbits);
free(srcbits);
free(mskbits);
- return (BadImplementation);
+ return BadImplementation;
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
CREATE_PIXMAP_USAGE_SCRATCH);
@@ -1579,7 +1579,7 @@ ProcRenderCreateCursor (ClientPtr client) free(argbbits);
free(srcbits);
free(mskbits);
- return (BadAlloc);
+ return BadAlloc;
}
pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0,
client, &error);
@@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) newPict->info[0].id = stuff->pid;
if (refDraw->type == XRT_WINDOW &&
- stuff->drawable == WindowTable[0]->drawable.id)
+ stuff->drawable == screenInfo.screens[0]->root->drawable.id)
{
newPict->u.pict.root = TRUE;
}
@@ -2703,7 +2703,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) else
free(newPict);
- return (result);
+ return result;
}
static int
@@ -2723,7 +2723,7 @@ PanoramiXRenderChangePicture (ClientPtr client) if(result != Success) break;
}
- return (result);
+ return result;
}
static int
@@ -2743,7 +2743,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client) if(result != Success) break;
}
- return (result);
+ return result;
}
static int
@@ -2763,7 +2763,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client) if(result != Success) break;
}
- return (result);
+ return result;
}
static int
@@ -2783,7 +2783,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client) if(result != Success) break;
}
- return (result);
+ return result;
}
static int
@@ -2809,7 +2809,7 @@ PanoramiXRenderFreePicture (ClientPtr client) /* Since ProcRenderFreePicture is using FreeResource, it will free
our resource for us on the last pass through the loop above */
- return (result);
+ return result;
}
static int
@@ -2832,22 +2832,22 @@ PanoramiXRenderComposite (ClientPtr client) stuff->src = src->info[j].id;
if (src->u.pict.root)
{
- stuff->xSrc = orig.xSrc - panoramiXdataPtr[j].x;
- stuff->ySrc = orig.ySrc - panoramiXdataPtr[j].y;
+ stuff->xSrc = orig.xSrc - screenInfo.screens[j]->x;
+ stuff->ySrc = orig.ySrc - screenInfo.screens[j]->y;
}
stuff->dst = dst->info[j].id;
if (dst->u.pict.root)
{
- stuff->xDst = orig.xDst - panoramiXdataPtr[j].x;
- stuff->yDst = orig.yDst - panoramiXdataPtr[j].y;
+ stuff->xDst = orig.xDst - screenInfo.screens[j]->x;
+ stuff->yDst = orig.yDst - screenInfo.screens[j]->y;
}
if (msk)
{
stuff->mask = msk->info[j].id;
if (msk->u.pict.root)
{
- stuff->xMask = orig.xMask - panoramiXdataPtr[j].x;
- stuff->yMask = orig.yMask - panoramiXdataPtr[j].y;
+ stuff->xMask = orig.xMask - screenInfo.screens[j]->x;
+ stuff->yMask = orig.yMask - screenInfo.screens[j]->y;
}
}
result = (*PanoramiXSaveRenderVector[X_RenderComposite]) (client);
@@ -2881,14 +2881,14 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client) stuff->src = src->info[j].id;
if (src->u.pict.root)
{
- stuff->xSrc = xSrc - panoramiXdataPtr[j].x;
- stuff->ySrc = ySrc - panoramiXdataPtr[j].y;
+ stuff->xSrc = xSrc - screenInfo.screens[j]->x;
+ stuff->ySrc = ySrc - screenInfo.screens[j]->y;
}
stuff->dst = dst->info[j].id;
if (dst->u.pict.root)
{
- elt->deltax = origElt.deltax - panoramiXdataPtr[j].x;
- elt->deltay = origElt.deltay - panoramiXdataPtr[j].y;
+ elt->deltax = origElt.deltax - screenInfo.screens[j]->x;
+ elt->deltay = origElt.deltay - screenInfo.screens[j]->y;
}
result = (*PanoramiXSaveRenderVector[stuff->renderReqType]) (client);
if(result != Success) break;
@@ -2918,8 +2918,8 @@ PanoramiXRenderFillRectangles (ClientPtr client) if (j) memcpy (stuff + 1, extra, extra_len);
if (dst->u.pict.root)
{
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
if(x_off || y_off) {
xRectangle *rects = (xRectangle *) (stuff + 1);
@@ -2966,8 +2966,8 @@ PanoramiXRenderTrapezoids(ClientPtr client) FOR_NSCREENS_FORWARD(j) {
if (j) memcpy (stuff + 1, extra, extra_len);
if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
if(x_off || y_off) {
xTrapezoid *trap = (xTrapezoid *) (stuff + 1);
@@ -3026,8 +3026,8 @@ PanoramiXRenderTriangles(ClientPtr client) FOR_NSCREENS_FORWARD(j) {
if (j) memcpy (stuff + 1, extra, extra_len);
if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
if(x_off || y_off) {
xTriangle *tri = (xTriangle *) (stuff + 1);
@@ -3082,8 +3082,8 @@ PanoramiXRenderTriStrip(ClientPtr client) FOR_NSCREENS_FORWARD(j) {
if (j) memcpy (stuff + 1, extra, extra_len);
if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
if(x_off || y_off) {
xPointFixed *fixed = (xPointFixed *) (stuff + 1);
@@ -3134,8 +3134,8 @@ PanoramiXRenderTriFan(ClientPtr client) FOR_NSCREENS_FORWARD(j) {
if (j) memcpy (stuff + 1, extra, extra_len);
if (dst->u.pict.root) {
- int x_off = panoramiXdataPtr[j].x;
- int y_off = panoramiXdataPtr[j].y;
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
if(x_off || y_off) {
xPointFixed *fixed = (xPointFixed *) (stuff + 1);
@@ -3188,8 +3188,8 @@ PanoramiXRenderAddTraps (ClientPtr client) if (picture->u.pict.root)
{
- stuff->xOff = x_off + panoramiXdataPtr[j].x;
- stuff->yOff = y_off + panoramiXdataPtr[j].y;
+ stuff->xOff = x_off + screenInfo.screens[j]->x;
+ stuff->yOff = y_off + screenInfo.screens[j]->y;
}
result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
if(result != Success) break;
|