aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/render
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-28 11:14:32 +0000
committermarha <marha@users.sourceforge.net>2011-04-28 11:14:32 +0000
commit1840c5631682e0a69ed11487a23a43d45f2d15e1 (patch)
treefe954636044c0057b9f08e76d19489493ff09745 /xorg-server/render
parent2ab09dc03e4ecc726ee7b5528306b0fe3e5b1837 (diff)
parent57a879849643e79d9674198a3a77c59532fb79b4 (diff)
downloadvcxsrv-1840c5631682e0a69ed11487a23a43d45f2d15e1.tar.gz
vcxsrv-1840c5631682e0a69ed11487a23a43d45f2d15e1.tar.bz2
vcxsrv-1840c5631682e0a69ed11487a23a43d45f2d15e1.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/render')
-rw-r--r--xorg-server/render/picture.c60
-rw-r--r--xorg-server/render/picturestr.h48
2 files changed, 1 insertions, 107 deletions
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c
index ee0f8dee5..e93f08abf 100644
--- a/xorg-server/render/picture.c
+++ b/xorg-server/render/picture.c
@@ -158,7 +158,7 @@ addFormat (FormatInitRec formats[256],
return ++nformat;
}
-#define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1))
+#define Mask(n) ((1 << (n)) - 1)
PictFormatPtr
PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp)
@@ -811,51 +811,6 @@ static CARD32 xRenderColorToCard32(xRenderColor c)
(c.blue >> 8);
}
-static unsigned int premultiply(unsigned int x)
-{
- unsigned int a = x >> 24;
- unsigned int t = (x & 0xff00ff) * a + 0x800080;
- t = (t + ((t >> 8) & 0xff00ff)) >> 8;
- t &= 0xff00ff;
-
- x = ((x >> 8) & 0xff) * a + 0x80;
- x = (x + ((x >> 8) & 0xff));
- x &= 0xff00;
- x |= t | (a << 24);
- return x;
-}
-
-static unsigned int INTERPOLATE_PIXEL_256(unsigned int x, unsigned int a,
- unsigned int y, unsigned int b)
-{
- CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b;
- t >>= 8;
- t &= 0xff00ff;
-
- x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b;
- x &= 0xff00ff00;
- x |= t;
- return x;
-}
-
-CARD32
-PictureGradientColor (PictGradientStopPtr stop1,
- PictGradientStopPtr stop2,
- CARD32 x)
-{
- CARD32 current_color, next_color;
- int dist, idist;
-
- current_color = xRenderColorToCard32 (stop1->color);
- next_color = xRenderColorToCard32 (stop2->color);
-
- dist = (int) (256 * (x - stop1->x) / (stop2->x - stop1->x));
- idist = 256 - dist;
-
- return premultiply (INTERPOLATE_PIXEL_256 (current_color, idist,
- next_color, dist));
-}
-
static void initGradient(SourcePictPtr pGradient, int stopCount,
xFixed *stopPoints, xRenderColor *stopColors, int *error)
{
@@ -888,11 +843,6 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
pGradient->gradient.stops[i].x = stopPoints[i];
pGradient->gradient.stops[i].color = stopColors[i];
}
-
- pGradient->gradient.class = SourcePictClassUnknown;
- pGradient->gradient.stopRange = 0xffff;
- pGradient->gradient.colorTable = NULL;
- pGradient->gradient.colorTableSize = 0;
}
static PicturePtr createSourcePicture(void)
@@ -967,8 +917,6 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2,
return pPicture;
}
-#define FixedToDouble(x) ((x)/65536.)
-
PicturePtr
CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer,
xFixed innerRadius, xFixed outerRadius,
@@ -1004,12 +952,6 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer
radial->c2.x = outer->x;
radial->c2.y = outer->y;
radial->c2.radius = outerRadius;
- radial->cdx = (radial->c2.x - radial->c1.x) / 65536.;
- radial->cdy = (radial->c2.y - radial->c1.y) / 65536.;
- radial->dr = (radial->c2.radius - radial->c1.radius) / 65536.;
- radial->A = ( radial->cdx * radial->cdx
- + radial->cdy * radial->cdy
- - radial->dr * radial->dr);
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
if (*error) {
diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h
index f642bf0df..5b9df988b 100644
--- a/xorg-server/render/picturestr.h
+++ b/xorg-server/render/picturestr.h
@@ -65,13 +65,8 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr;
#define SourcePictTypeRadial 2
#define SourcePictTypeConical 3
-#define SourcePictClassUnknown 0
-#define SourcePictClassHorizontal 1
-#define SourcePictClassVertical 2
-
typedef struct _PictSolidFill {
unsigned int type;
- unsigned int class;
CARD32 color;
} PictSolidFill, *PictSolidFillPtr;
@@ -82,22 +77,14 @@ typedef struct _PictGradientStop {
typedef struct _PictGradient {
unsigned int type;
- unsigned int class;
int nstops;
PictGradientStopPtr stops;
- int stopRange;
- CARD32 *colorTable;
- int colorTableSize;
} PictGradient, *PictGradientPtr;
typedef struct _PictLinearGradient {
unsigned int type;
- unsigned int class;
int nstops;
PictGradientStopPtr stops;
- int stopRange;
- CARD32 *colorTable;
- int colorTableSize;
xPointFixed p1;
xPointFixed p2;
} PictLinearGradient, *PictLinearGradientPtr;
@@ -110,28 +97,16 @@ typedef struct _PictCircle {
typedef struct _PictRadialGradient {
unsigned int type;
- unsigned int class;
int nstops;
PictGradientStopPtr stops;
- int stopRange;
- CARD32 *colorTable;
- int colorTableSize;
PictCircle c1;
PictCircle c2;
- double cdx;
- double cdy;
- double dr;
- double A;
} PictRadialGradient, *PictRadialGradientPtr;
typedef struct _PictConicalGradient {
unsigned int type;
- unsigned int class;
int nstops;
PictGradientStopPtr stops;
- int stopRange;
- CARD32 *colorTable;
- int colorTableSize;
xPointFixed center;
xFixed angle;
} PictConicalGradient, *PictConicalGradientPtr;
@@ -285,24 +260,6 @@ typedef void (*TrianglesProcPtr) (CARD8 op,
int ntri,
xTriangle *tris);
-typedef void (*TriStripProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
-typedef void (*TriFanProcPtr) (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc,
- INT16 ySrc,
- int npoint,
- xPointFixed *points);
-
typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen,
PictFormatPtr pFormat);
@@ -614,11 +571,6 @@ CompositeTriFan (CARD8 op,
int npoints,
xPointFixed *points);
-extern _X_EXPORT CARD32
-PictureGradientColor (PictGradientStopPtr stop1,
- PictGradientStopPtr stop2,
- CARD32 x);
-
extern _X_EXPORT void RenderExtensionInit (void);
Bool