summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-11-05 19:08:36 -0500
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-11-05 19:08:36 -0500
commita52c9b2a59f27266557ff9d5d2c08492e04135a6 (patch)
tree705f11c54e8a31a07dde9ab6835032e2849e132b /render
parentc7e18beb3c87eb1ada9b21c4ffacd11c1939c087 (diff)
parent58332894c061ae96d6a457f65266660f5f65e88b (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: dix/dispatch.c dix/property.c hw/xfree86/common/xf86VidMode.c include/xkbsrv.h render/glyph.c xkb/xkbActions.c
Diffstat (limited to 'render')
-rw-r--r--render/glyph.c52
-rw-r--r--render/mipict.c2
-rw-r--r--render/mirect.c4
-rw-r--r--render/mitrap.c2
-rw-r--r--render/mitri.c8
-rw-r--r--render/render.c50
6 files changed, 60 insertions, 58 deletions
diff --git a/render/glyph.c b/render/glyph.c
index bb7c880d3..286e39d63 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -26,7 +26,7 @@
#include <dix-config.h>
#endif
-#include <stddef.h>
+#include <stddef.h> /* buggy openssl/sha.h wants size_t */
#include <openssl/sha.h>
#include "misc.h"
@@ -611,20 +611,22 @@ GlyphExtents (int nlist,
#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
-/* Stub ABI compatibility for mi*Glyph, should go away */
_X_EXPORT void
-miGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
+CompositeGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr lists,
+ GlyphPtr *glyphs)
{
- CompositeGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list,
- glyphs);
+ PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
+
+ ValidatePicture (pSrc);
+ ValidatePicture (pDst);
+ (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs);
}
Bool
@@ -641,15 +643,15 @@ miUnrealizeGlyph (ScreenPtr pScreen,
}
_X_EXPORT void
-CompositeGlyphs (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int nlist,
- GlyphListPtr list,
- GlyphPtr *glyphs)
+miGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs)
{
PicturePtr pPicture;
PixmapPtr pMaskPixmap = 0;
@@ -664,9 +666,6 @@ CompositeGlyphs (CARD8 op,
BoxRec extents = {0, 0, 0, 0};
CARD32 component_alpha;
- ValidatePicture (pSrc);
- ValidatePicture (pDst);
-
if (maskFormat)
{
GCPtr pGC;
@@ -679,7 +678,8 @@ CompositeGlyphs (CARD8 op,
width = extents.x2 - extents.x1;
height = extents.y2 - extents.y1;
pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
- maskFormat->depth);
+ maskFormat->depth,
+ CREATE_PIXMAP_USAGE_SCRATCH);
if (!pMaskPixmap)
return;
component_alpha = NeedsComponent(maskFormat->format);
diff --git a/render/mipict.c b/render/mipict.c
index 5aad676f5..87dccbbda 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -636,7 +636,7 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
/* MI rendering routines */
ps->Composite = 0; /* requires DDX support */
- ps->Glyphs = NULL;
+ ps->Glyphs = miGlyphs;
ps->CompositeRects = miCompositeRects;
ps->Trapezoids = miTrapezoids;
ps->Triangles = miTriangles;
diff --git a/render/mirect.c b/render/mirect.c
index fa9dab80b..38f4faf67 100644
--- a/render/mirect.c
+++ b/render/mirect.c
@@ -135,8 +135,8 @@ miCompositeRects (CARD8 op,
if (!rgbaFormat)
goto bail1;
- pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1,
- rgbaFormat->depth);
+ pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth,
+ CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
goto bail2;
diff --git a/render/mitrap.c b/render/mitrap.c
index c6188061c..8bdc8a8d0 100644
--- a/render/mitrap.c
+++ b/render/mitrap.c
@@ -61,7 +61,7 @@ miCreateAlphaPicture (ScreenPtr pScreen,
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
- pPictFormat->depth);
+ pPictFormat->depth, 0);
if (!pPixmap)
return 0;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
diff --git a/render/mitri.c b/render/mitri.c
index 374e2fdc7..a92c19b7e 100644
--- a/render/mitri.c
+++ b/render/mitri.c
@@ -144,7 +144,7 @@ miTriStrip (CARD8 op,
if (npoint < 3)
return;
ntri = npoint - 2;
- tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
+ tris = xalloc (ntri * sizeof (xTriangle));
if (!tris)
return;
for (tri = tris; npoint >= 3; npoint--, points++, tri++)
@@ -154,7 +154,7 @@ miTriStrip (CARD8 op,
tri->p3 = points[2];
}
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
- DEALLOCATE_LOCAL (tris);
+ xfree (tris);
}
void
@@ -176,7 +176,7 @@ miTriFan (CARD8 op,
if (npoint < 3)
return;
ntri = npoint - 2;
- tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle));
+ tris = xalloc (ntri * sizeof (xTriangle));
if (!tris)
return;
first = points++;
@@ -187,5 +187,5 @@ miTriFan (CARD8 op,
tri->p3 = points[1];
}
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
- DEALLOCATE_LOCAL (tris);
+ xfree (tris);
}
diff --git a/render/render.c b/render/render.c
index b9ac45e96..040a9507f 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1291,7 +1291,8 @@ ProcRenderAddGlyphs (ClientPtr client)
}
pDstPix = (pScreen->CreatePixmap) (pScreen,
- width, height, depth);
+ width, height, depth,
+ CREATE_PIMXAP_USAGE_GLYPH_PICTURE);
GlyphPicture (glyph)[screen] = pDst =
CreatePicture (0, &pDstPix->drawable,
@@ -1495,7 +1496,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase = glyphsLocal;
else
{
- glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr));
+ glyphsBase = (GlyphPtr *) xalloc (nglyph * sizeof (GlyphPtr));
if (!glyphsBase)
return BadAlloc;
}
@@ -1503,7 +1504,7 @@ ProcRenderCompositeGlyphs (ClientPtr client)
listsBase = listsLocal;
else
{
- listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec));
+ listsBase = (GlyphListPtr) xalloc (nlist * sizeof (GlyphListRec));
if (!listsBase)
return BadAlloc;
}
@@ -1528,9 +1529,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
client->errorValue = gs;
if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
+ xfree (glyphsBase);
if (listsBase != listsLocal)
- DEALLOCATE_LOCAL (listsBase);
+ xfree (listsBase);
return RenderErrBase + BadGlyphSet;
}
}
@@ -1584,9 +1585,9 @@ ProcRenderCompositeGlyphs (ClientPtr client)
glyphsBase);
if (glyphsBase != glyphsLocal)
- DEALLOCATE_LOCAL (glyphsBase);
+ xfree (glyphsBase);
if (listsBase != listsLocal)
- DEALLOCATE_LOCAL (listsBase);
+ xfree (listsBase);
return client->noClientException;
}
@@ -1723,7 +1724,8 @@ ProcRenderCreateCursor (ClientPtr client)
xfree (mskbits);
return (BadImplementation);
}
- pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32);
+ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32,
+ CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap)
{
xfree (argbbits);
@@ -3075,7 +3077,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len)))
+ (extra = (char *) xalloc (extra_len)))
{
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3101,7 +3103,7 @@ PanoramiXRenderFillRectangles (ClientPtr client)
result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client);
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3126,7 +3128,7 @@ PanoramiXRenderTrapezoids(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3163,7 +3165,7 @@ PanoramiXRenderTrapezoids(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3188,7 +3190,7 @@ PanoramiXRenderTriangles(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3221,7 +3223,7 @@ PanoramiXRenderTriangles(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3246,7 +3248,7 @@ PanoramiXRenderTriStrip(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3275,7 +3277,7 @@ PanoramiXRenderTriStrip(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3300,7 +3302,7 @@ PanoramiXRenderTriFan(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3329,7 +3331,7 @@ PanoramiXRenderTriFan(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3354,7 +3356,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3375,7 +3377,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3398,7 +3400,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len))) {
+ (extra = (char *) xalloc (extra_len))) {
memcpy (extra, stuff + 1, extra_len);
FOR_NSCREENS_FORWARD(j) {
@@ -3419,7 +3421,7 @@ PanoramiXRenderColorTriangles(ClientPtr client)
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;
@@ -3442,7 +3444,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
RenderErrBase + BadPicture);
extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq);
if (extra_len &&
- (extra = (char *) ALLOCATE_LOCAL (extra_len)))
+ (extra = (char *) xalloc (extra_len)))
{
memcpy (extra, stuff + 1, extra_len);
x_off = stuff->xOff;
@@ -3459,7 +3461,7 @@ PanoramiXRenderAddTraps (ClientPtr client)
result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
if(result != Success) break;
}
- DEALLOCATE_LOCAL(extra);
+ xfree(extra);
}
return result;