6838046: Rollback 6762511 due to build failure (6838003)
authoranthony
Wed, 06 May 2009 20:06:23 +0400
changeset 1198b28b073e72b6
parent 1197 ba95c9101e50
child 1199 2b86dbc51d11
child 1216 f62f7fcc9965
6838046: Rollback 6762511 due to build failure (6838003)
Reviewed-by: yan
src/solaris/classes/sun/awt/X11GraphicsConfig.java
src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java
src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java
src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
src/solaris/native/sun/awt/X11Color.c
src/solaris/native/sun/awt/awt_GraphicsEnv.c
src/solaris/native/sun/awt/awt_p.h
     1.1 --- a/src/solaris/classes/sun/awt/X11GraphicsConfig.java	Wed May 06 12:39:23 2009 +0400
     1.2 +++ b/src/solaris/classes/sun/awt/X11GraphicsConfig.java	Wed May 06 20:06:23 2009 +0400
     1.3 @@ -37,10 +37,7 @@
     1.4  import java.awt.Transparency;
     1.5  import java.awt.image.BufferedImage;
     1.6  import java.awt.image.ColorModel;
     1.7 -import java.awt.color.ColorSpace;
     1.8 -import java.awt.image.ComponentColorModel;
     1.9  import java.awt.image.DirectColorModel;
    1.10 -import java.awt.image.DataBuffer;
    1.11  import java.awt.image.VolatileImage;
    1.12  import java.awt.image.WritableRaster;
    1.13  import java.awt.geom.AffineTransform;
    1.14 @@ -233,22 +230,6 @@
    1.15          }
    1.16      }
    1.17  
    1.18 -    public static DirectColorModel createDCM32(int rMask, int gMask, int bMask,
    1.19 -                                               int aMask, boolean aPre) {
    1.20 -        return new DirectColorModel(
    1.21 -            ColorSpace.getInstance(ColorSpace.CS_sRGB),
    1.22 -            32, rMask, gMask, bMask, aMask, aPre, DataBuffer.TYPE_INT);
    1.23 -    }
    1.24 -
    1.25 -    public static ComponentColorModel createABGRCCM() {
    1.26 -        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    1.27 -        int[] nBits = {8, 8, 8, 8};
    1.28 -        int[] bOffs = {3, 2, 1, 0};
    1.29 -        return new ComponentColorModel(cs, nBits, true, true,
    1.30 -                                       Transparency.TRANSLUCENT,
    1.31 -                                       DataBuffer.TYPE_BYTE);
    1.32 -    }
    1.33 -
    1.34      /**
    1.35       * Returns the default Transform for this configuration.  This
    1.36       * Transform is typically the Identity transform for most normal
     2.1 --- a/src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java	Wed May 06 12:39:23 2009 +0400
     2.2 +++ b/src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java	Wed May 06 20:06:23 2009 +0400
     2.3 @@ -70,10 +70,6 @@
     2.4                                   X11SurfaceData.UShort565RgbX11),
     2.5              new X11PMBlitBgLoops(X11SurfaceData.UShortIndexedX11_BM,
     2.6                                   X11SurfaceData.UShortIndexedX11),
     2.7 -            new X11PMBlitBgLoops(X11SurfaceData.IntRgbX11_BM,
     2.8 -                                 X11SurfaceData.IntArgbPreX11),
     2.9 -            new X11PMBlitBgLoops(X11SurfaceData.IntBgrX11_BM,
    2.10 -                                 X11SurfaceData.FourByteAbgrPreX11),
    2.11          };
    2.12          GraphicsPrimitiveMgr.register(primitives);
    2.13      }
     3.1 --- a/src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java	Wed May 06 12:39:23 2009 +0400
     3.2 +++ b/src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java	Wed May 06 20:06:23 2009 +0400
     3.3 @@ -95,22 +95,6 @@
     3.4              new X11PMBlitLoops(X11SurfaceData.UShortIndexedX11_BM,
     3.5                                 X11SurfaceData.UShortIndexedX11, true),
     3.6  
     3.7 -            new X11PMBlitLoops(X11SurfaceData.IntRgbX11,
     3.8 -                               X11SurfaceData.IntArgbPreX11, true),
     3.9 -            new X11PMBlitLoops(X11SurfaceData.IntRgbX11,
    3.10 -                               X11SurfaceData.IntArgbPreX11, false),
    3.11 -            new X11PMBlitLoops(X11SurfaceData.IntRgbX11_BM,
    3.12 -                               X11SurfaceData.IntArgbPreX11, true),
    3.13 -
    3.14 -            new X11PMBlitLoops(X11SurfaceData.IntBgrX11,
    3.15 -                               X11SurfaceData.FourByteAbgrPreX11, true),
    3.16 -            new X11PMBlitLoops(X11SurfaceData.IntBgrX11,
    3.17 -                               X11SurfaceData.FourByteAbgrPreX11, false),
    3.18 -            new X11PMBlitLoops(X11SurfaceData.IntBgrX11_BM,
    3.19 -                               X11SurfaceData.FourByteAbgrPreX11, true),
    3.20 -
    3.21 -
    3.22 -
    3.23              // delegate loops
    3.24              new DelegateBlitLoop(X11SurfaceData.IntBgrX11_BM,
    3.25                                   X11SurfaceData.IntBgrX11),
     4.1 --- a/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Wed May 06 12:39:23 2009 +0400
     4.2 +++ b/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Wed May 06 20:06:23 2009 +0400
     4.3 @@ -81,13 +81,6 @@
     4.4          DESC_INT_BGR_X11        = "Integer BGR Pixmap";
     4.5      public static final String
     4.6          DESC_INT_RGB_X11        = "Integer RGB Pixmap";
     4.7 -
     4.8 -    public static final String
     4.9 -        DESC_4BYTE_ABGR_PRE_X11 = "4 byte ABGR Pixmap with pre-multplied alpha";
    4.10 -    public static final String
    4.11 -        DESC_INT_ARGB_PRE_X11   = "Integer ARGB Pixmap with pre-multiplied " +
    4.12 -                                  "alpha";
    4.13 -
    4.14      public static final String
    4.15          DESC_BYTE_IND_OPQ_X11   = "Byte Indexed Opaque Pixmap";
    4.16  
    4.17 @@ -140,11 +133,6 @@
    4.18      public static final SurfaceType IntRgbX11 =
    4.19          SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11);
    4.20  
    4.21 -    public static final SurfaceType FourByteAbgrPreX11 =
    4.22 -        SurfaceType.FourByteAbgrPre.deriveSubType(DESC_4BYTE_ABGR_PRE_X11);
    4.23 -    public static final SurfaceType IntArgbPreX11 =
    4.24 -        SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_PRE_X11);
    4.25 -
    4.26      public static final SurfaceType ThreeByteRgbX11 =
    4.27          SurfaceType.ThreeByteRgb.deriveSubType(DESC_3BYTE_RGB_X11);
    4.28      public static final SurfaceType ThreeByteBgrX11 =
    4.29 @@ -425,7 +413,7 @@
    4.30                                                    int transparency)
    4.31      {
    4.32          return new X11PixmapSurfaceData(gc, width, height, image,
    4.33 -                                        getSurfaceType(gc, transparency, true),
    4.34 +                                        getSurfaceType(gc, transparency),
    4.35                                          cm, drawable, transparency);
    4.36      }
    4.37  
    4.38 @@ -510,13 +498,6 @@
    4.39      public static SurfaceType getSurfaceType(X11GraphicsConfig gc,
    4.40                                               int transparency)
    4.41      {
    4.42 -        return getSurfaceType(gc, transparency, false);
    4.43 -    }
    4.44 -
    4.45 -    public static SurfaceType getSurfaceType(X11GraphicsConfig gc,
    4.46 -                                             int transparency,
    4.47 -                                             boolean pixmapSurface)
    4.48 -    {
    4.49          boolean transparent = (transparency == Transparency.BITMASK);
    4.50          SurfaceType sType;
    4.51          ColorModel cm = gc.getColorModel();
    4.52 @@ -543,21 +524,11 @@
    4.53              // Fall through for 32 bit case
    4.54          case 32:
    4.55              if (cm instanceof DirectColorModel) {
    4.56 -                if (((SunToolkit)java.awt.Toolkit.getDefaultToolkit()
    4.57 -                     ).isTranslucencyCapable(gc) && !pixmapSurface)
    4.58 -                {
    4.59 -                    sType = X11SurfaceData.IntArgbPreX11;
    4.60 +                if (((DirectColorModel)cm).getRedMask() == 0xff0000) {
    4.61 +                    sType = transparent ? X11SurfaceData.IntRgbX11_BM : X11SurfaceData.IntRgbX11;
    4.62                  } else {
    4.63 -                    if (((DirectColorModel)cm).getRedMask() == 0xff0000) {
    4.64 -                        sType = transparent ? X11SurfaceData.IntRgbX11_BM :
    4.65 -                                              X11SurfaceData.IntRgbX11;
    4.66 -                    } else {
    4.67 -                        sType = transparent ? X11SurfaceData.IntBgrX11_BM :
    4.68 -                                              X11SurfaceData.IntBgrX11;
    4.69 -                    }
    4.70 +                    sType = transparent ? X11SurfaceData.IntBgrX11_BM : X11SurfaceData.IntBgrX11;
    4.71                  }
    4.72 -            } else if (cm instanceof ComponentColorModel) {
    4.73 -                   sType = X11SurfaceData.FourByteAbgrPreX11;
    4.74              } else {
    4.75  
    4.76                  throw new sun.java2d.InvalidPipeException("Unsupported bit " +
     5.1 --- a/src/solaris/native/sun/awt/X11Color.c	Wed May 06 12:39:23 2009 +0400
     5.2 +++ b/src/solaris/native/sun/awt/X11Color.c	Wed May 06 20:06:23 2009 +0400
     5.3 @@ -886,27 +886,6 @@
     5.4  #define blue(v)         (((v) >>  0) & 0xFF)
     5.5  
     5.6  #ifndef HEADLESS
     5.7 -
     5.8 -jobject getColorSpace(JNIEnv* env, jint csID) {
     5.9 -    jclass clazz;
    5.10 -    jobject cspaceL;
    5.11 -    jmethodID mid;
    5.12 -
    5.13 -    clazz = (*env)->FindClass(env,"java/awt/color/ColorSpace");
    5.14 -    mid = (*env)->GetStaticMethodID(env, clazz, "getInstance",
    5.15 -                                    "(I)Ljava/awt/color/ColorSpace;");
    5.16 -    if (mid == NULL) {
    5.17 -        return NULL;
    5.18 -    }
    5.19 -
    5.20 -    /* SECURITY: This is safe, because static methods cannot
    5.21 -     *           be overridden, and this method does not invoke
    5.22 -     *           client code
    5.23 -     */
    5.24 -
    5.25 -    return (*env)->CallStaticObjectMethod(env, clazz, mid, csID);
    5.26 -}
    5.27 -
    5.28  jobject awtJNI_GetColorModel(JNIEnv *env, AwtGraphicsConfigDataPtr aData)
    5.29  {
    5.30      jobject awt_colormodel = NULL;
    5.31 @@ -920,60 +899,20 @@
    5.32          (aData->awt_depth >= 15))
    5.33      {
    5.34          clazz = (*env)->FindClass(env,"java/awt/image/DirectColorModel");
    5.35 -        if (!aData->isTranslucencySupported) {
    5.36  
    5.37 -            mid = (*env)->GetMethodID(env,clazz,"<init>","(IIIII)V");
    5.38 +        mid = (*env)->GetMethodID(env,clazz,"<init>","(IIIII)V");
    5.39  
    5.40 -            if (mid == NULL) {
    5.41 -                (*env)->PopLocalFrame(env, 0);
    5.42 -                return NULL;
    5.43 -            }
    5.44 -            awt_colormodel = (*env)->NewObject(env,clazz, mid,
    5.45 -                    aData->awt_visInfo.depth,
    5.46 -                    aData->awt_visInfo.red_mask,
    5.47 -                    aData->awt_visInfo.green_mask,
    5.48 -                    aData->awt_visInfo.blue_mask,
    5.49 -                    0);
    5.50 -        } else {
    5.51 -            clazz = (*env)->FindClass(env,"sun/awt/X11GraphicsConfig");
    5.52 -            if (clazz == NULL) {
    5.53 -                (*env)->PopLocalFrame(env, 0);
    5.54 -                return NULL;
    5.55 -            }
    5.56 +        if (mid == NULL) {
    5.57 +            (*env)->PopLocalFrame(env, 0);
    5.58 +            return NULL;
    5.59 +        }
    5.60  
    5.61 -            if (aData->renderPictFormat.direct.red == 16) {
    5.62 -                mid = (*env)->GetStaticMethodID( env,clazz,"createDCM32",
    5.63 -                        "(IIIIZ)Ljava/awt/image/DirectColorModel;");
    5.64 -
    5.65 -                if (mid == NULL) {
    5.66 -                    (*env)->PopLocalFrame(env, 0);
    5.67 -                    return NULL;
    5.68 -                }
    5.69 -
    5.70 -                awt_colormodel = (*env)->CallStaticObjectMethod(
    5.71 -                        env,clazz, mid,
    5.72 -                        aData->renderPictFormat.direct.redMask
    5.73 -                            << aData->renderPictFormat.direct.red,
    5.74 -                        aData->renderPictFormat.direct.greenMask
    5.75 -                            << aData->renderPictFormat.direct.green,
    5.76 -                        aData->renderPictFormat.direct.blueMask
    5.77 -                            << aData->renderPictFormat.direct.blue,
    5.78 -                        aData->renderPictFormat.direct.alphaMask
    5.79 -                            << aData->renderPictFormat.direct.alpha,
    5.80 -                        JNI_TRUE);
    5.81 -            } else {
    5.82 -                mid = (*env)->GetStaticMethodID( env,clazz,"createABGRCCM",
    5.83 -                        "()Ljava/awt/image/ComponentColorModel;");
    5.84 -
    5.85 -                if (mid == NULL) {
    5.86 -                    (*env)->PopLocalFrame(env, 0);
    5.87 -                    return NULL;
    5.88 -                }
    5.89 -
    5.90 -                awt_colormodel = (*env)->CallStaticObjectMethod(
    5.91 -                        env,clazz, mid);
    5.92 -            }
    5.93 -        }
    5.94 +        awt_colormodel = (*env)->NewObject(env,clazz, mid,
    5.95 +                                           aData->awt_visInfo.depth,
    5.96 +                                           aData->awt_visInfo.red_mask,
    5.97 +                                           aData->awt_visInfo.green_mask,
    5.98 +                                           aData->awt_visInfo.blue_mask,
    5.99 +                                           0);
   5.100  
   5.101          if(awt_colormodel == NULL)
   5.102          {
   5.103 @@ -984,13 +923,25 @@
   5.104      }
   5.105      else if (aData->awt_visInfo.class == StaticGray &&
   5.106               aData->awt_num_colors == 256) {
   5.107 +        jclass clazz1;
   5.108          jobject cspace = NULL;
   5.109          jint bits[1];
   5.110          jintArray bitsArray;
   5.111          jboolean falseboolean = JNI_FALSE;
   5.112  
   5.113 -        cspace = getColorSpace(env, java_awt_color_ColorSpace_CS_GRAY);
   5.114 -
   5.115 +        clazz1 = (*env)->FindClass(env,"java/awt/color/ColorSpace");
   5.116 +        mid = (*env)->GetStaticMethodID(env, clazz1, "getInstance",
   5.117 +              "(I)Ljava/awt/color/ColorSpace;");
   5.118 +        if (mid == NULL) {
   5.119 +            (*env)->PopLocalFrame(env, 0);
   5.120 +            return NULL;
   5.121 +        }
   5.122 +        /* SECURITY: This is safe, because static methods cannot
   5.123 +         *           be overridden, and this method does not invoke
   5.124 +         *           client code
   5.125 +         */
   5.126 +        cspace = (*env)->CallStaticObjectMethod(env, clazz1, mid,
   5.127 +            java_awt_color_ColorSpace_CS_GRAY);
   5.128          if (cspace == NULL) {
   5.129              (*env)->PopLocalFrame(env, 0);
   5.130              return NULL;
     6.1 --- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed May 06 12:39:23 2009 +0400
     6.2 +++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed May 06 20:06:23 2009 +0400
     6.3 @@ -354,6 +354,48 @@
     6.4      return NULL;
     6.5  }
     6.6  
     6.7 +/* Note: until we include the <X11/extensions/Xrender.h> explicitly
     6.8 + * we have to define a couple of things ourselves.
     6.9 + */
    6.10 +typedef unsigned long   PictFormat;
    6.11 +#define PictTypeIndexed             0
    6.12 +#define PictTypeDirect              1
    6.13 +
    6.14 +typedef struct {
    6.15 +    short   red;
    6.16 +    short   redMask;
    6.17 +    short   green;
    6.18 +    short   greenMask;
    6.19 +    short   blue;
    6.20 +    short   blueMask;
    6.21 +    short   alpha;
    6.22 +    short   alphaMask;
    6.23 +} XRenderDirectFormat;
    6.24 +
    6.25 +typedef struct {
    6.26 +    PictFormat      id;
    6.27 +    int         type;
    6.28 +    int         depth;
    6.29 +    XRenderDirectFormat direct;
    6.30 +    Colormap        colormap;
    6.31 +} XRenderPictFormat;
    6.32 +
    6.33 +#define PictFormatID        (1 << 0)
    6.34 +#define PictFormatType      (1 << 1)
    6.35 +#define PictFormatDepth     (1 << 2)
    6.36 +#define PictFormatRed       (1 << 3)
    6.37 +#define PictFormatRedMask   (1 << 4)
    6.38 +#define PictFormatGreen     (1 << 5)
    6.39 +#define PictFormatGreenMask (1 << 6)
    6.40 +#define PictFormatBlue      (1 << 7)
    6.41 +#define PictFormatBlueMask  (1 << 8)
    6.42 +#define PictFormatAlpha     (1 << 9)
    6.43 +#define PictFormatAlphaMask (1 << 10)
    6.44 +#define PictFormatColormap  (1 << 11)
    6.45 +
    6.46 +typedef XRenderPictFormat *
    6.47 +XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
    6.48 +
    6.49  static void
    6.50  getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
    6.51  
    6.52 @@ -493,8 +535,6 @@
    6.53                  format->direct.alphaMask)
    6.54              {
    6.55                  graphicsConfigs [ind]->isTranslucencySupported = 1;
    6.56 -                memcpy(&graphicsConfigs [ind]->renderPictFormat, format,
    6.57 -                        sizeof(*format));
    6.58              }
    6.59          }
    6.60      }
     7.1 --- a/src/solaris/native/sun/awt/awt_p.h	Wed May 06 12:39:23 2009 +0400
     7.2 +++ b/src/solaris/native/sun/awt/awt_p.h	Wed May 06 20:06:23 2009 +0400
     7.3 @@ -119,50 +119,6 @@
     7.4  } DamageRect;
     7.5  
     7.6  #ifndef HEADLESS
     7.7 -
     7.8 -/* Note: until we include the <X11/extensions/Xrender.h> explicitly
     7.9 - * we have to define a couple of things ourselves.
    7.10 - */
    7.11 -typedef unsigned long   PictFormat;
    7.12 -#define PictTypeIndexed             0
    7.13 -#define PictTypeDirect              1
    7.14 -
    7.15 -typedef struct {
    7.16 -    short   red;
    7.17 -    short   redMask;
    7.18 -    short   green;
    7.19 -    short   greenMask;
    7.20 -    short   blue;
    7.21 -    short   blueMask;
    7.22 -    short   alpha;
    7.23 -    short   alphaMask;
    7.24 -} XRenderDirectFormat;
    7.25 -
    7.26 -typedef struct {
    7.27 -    PictFormat      id;
    7.28 -    int         type;
    7.29 -    int         depth;
    7.30 -    XRenderDirectFormat direct;
    7.31 -    Colormap        colormap;
    7.32 -} XRenderPictFormat;
    7.33 -
    7.34 -#define PictFormatID        (1 << 0)
    7.35 -#define PictFormatType      (1 << 1)
    7.36 -#define PictFormatDepth     (1 << 2)
    7.37 -#define PictFormatRed       (1 << 3)
    7.38 -#define PictFormatRedMask   (1 << 4)
    7.39 -#define PictFormatGreen     (1 << 5)
    7.40 -#define PictFormatGreenMask (1 << 6)
    7.41 -#define PictFormatBlue      (1 << 7)
    7.42 -#define PictFormatBlueMask  (1 << 8)
    7.43 -#define PictFormatAlpha     (1 << 9)
    7.44 -#define PictFormatAlphaMask (1 << 10)
    7.45 -#define PictFormatColormap  (1 << 11)
    7.46 -
    7.47 -typedef XRenderPictFormat *
    7.48 -XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
    7.49 -/* END OF Xrender.h chunk */
    7.50 -
    7.51  typedef struct _AwtGraphicsConfigData  {
    7.52      int         awt_depth;
    7.53      Colormap    awt_cmap;
    7.54 @@ -180,7 +136,6 @@
    7.55      ColorData      *color_data;
    7.56      struct _GLXGraphicsConfigInfo *glxInfo;
    7.57      int         isTranslucencySupported; /* Uses Xrender to find this out. */
    7.58 -    XRenderPictFormat renderPictFormat; /*Used only if translucency supported*/
    7.59  } AwtGraphicsConfigData;
    7.60  
    7.61  typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;