[PATCH] render: remove unused fields from source picture structs

Adam Jackson ajax at redhat.com
Tue Apr 19 12:17:06 PDT 2011


Thanks to the magic of unions, this saves 12 or 16 bytes per source-only
picture.  Ideally we'll get to the point where we simply use pixman for
this and stop shadowing state in the server, but pixman lacks API for
that at the moment.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 render/picture.c    |    5 -----
 render/picturestr.h |   21 ---------------------
 2 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/render/picture.c b/render/picture.c
index e7e1f2b..d96282d 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -888,11 +888,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)
diff --git a/render/picturestr.h b/render/picturestr.h
index 7c7edb1..d97d90d 100644
--- a/render/picturestr.h
+++ b/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,12 +97,8 @@ 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;
@@ -126,12 +109,8 @@ typedef struct _PictRadialGradient {
 
 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;
-- 
1.7.4.4



More information about the xorg-devel mailing list