# HG changeset patch # User anthony # Date 1241625983 -14400 # Node ID f038acdbdf9c32f630cf111255274b4a8d7814ed # Parent a6629ca69b70ff9448e1d936ba8dd805348b7041 6838046: Rollback 6762511 due to build failure (6838003) Reviewed-by: yan diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java Wed May 06 20:06:23 2009 +0400 @@ -37,10 +37,7 @@ import java.awt.Transparency; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; -import java.awt.color.ColorSpace; -import java.awt.image.ComponentColorModel; import java.awt.image.DirectColorModel; -import java.awt.image.DataBuffer; import java.awt.image.VolatileImage; import java.awt.image.WritableRaster; import java.awt.geom.AffineTransform; @@ -233,22 +230,6 @@ } } - public static DirectColorModel createDCM32(int rMask, int gMask, int bMask, - int aMask, boolean aPre) { - return new DirectColorModel( - ColorSpace.getInstance(ColorSpace.CS_sRGB), - 32, rMask, gMask, bMask, aMask, aPre, DataBuffer.TYPE_INT); - } - - public static ComponentColorModel createABGRCCM() { - ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); - int[] nBits = {8, 8, 8, 8}; - int[] bOffs = {3, 2, 1, 0}; - return new ComponentColorModel(cs, nBits, true, true, - Transparency.TRANSLUCENT, - DataBuffer.TYPE_BYTE); - } - /** * Returns the default Transform for this configuration. This * Transform is typically the Identity transform for most normal diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java --- a/jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java Wed May 06 20:06:23 2009 +0400 @@ -70,10 +70,6 @@ X11SurfaceData.UShort565RgbX11), new X11PMBlitBgLoops(X11SurfaceData.UShortIndexedX11_BM, X11SurfaceData.UShortIndexedX11), - new X11PMBlitBgLoops(X11SurfaceData.IntRgbX11_BM, - X11SurfaceData.IntArgbPreX11), - new X11PMBlitBgLoops(X11SurfaceData.IntBgrX11_BM, - X11SurfaceData.FourByteAbgrPreX11), }; GraphicsPrimitiveMgr.register(primitives); } diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java --- a/jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java Wed May 06 20:06:23 2009 +0400 @@ -95,22 +95,6 @@ new X11PMBlitLoops(X11SurfaceData.UShortIndexedX11_BM, X11SurfaceData.UShortIndexedX11, true), - new X11PMBlitLoops(X11SurfaceData.IntRgbX11, - X11SurfaceData.IntArgbPreX11, true), - new X11PMBlitLoops(X11SurfaceData.IntRgbX11, - X11SurfaceData.IntArgbPreX11, false), - new X11PMBlitLoops(X11SurfaceData.IntRgbX11_BM, - X11SurfaceData.IntArgbPreX11, true), - - new X11PMBlitLoops(X11SurfaceData.IntBgrX11, - X11SurfaceData.FourByteAbgrPreX11, true), - new X11PMBlitLoops(X11SurfaceData.IntBgrX11, - X11SurfaceData.FourByteAbgrPreX11, false), - new X11PMBlitLoops(X11SurfaceData.IntBgrX11_BM, - X11SurfaceData.FourByteAbgrPreX11, true), - - - // delegate loops new DelegateBlitLoop(X11SurfaceData.IntBgrX11_BM, X11SurfaceData.IntBgrX11), diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java --- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java Wed May 06 20:06:23 2009 +0400 @@ -81,13 +81,6 @@ DESC_INT_BGR_X11 = "Integer BGR Pixmap"; public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap"; - - public static final String - DESC_4BYTE_ABGR_PRE_X11 = "4 byte ABGR Pixmap with pre-multplied alpha"; - public static final String - DESC_INT_ARGB_PRE_X11 = "Integer ARGB Pixmap with pre-multiplied " + - "alpha"; - public static final String DESC_BYTE_IND_OPQ_X11 = "Byte Indexed Opaque Pixmap"; @@ -140,11 +133,6 @@ public static final SurfaceType IntRgbX11 = SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11); - public static final SurfaceType FourByteAbgrPreX11 = - SurfaceType.FourByteAbgrPre.deriveSubType(DESC_4BYTE_ABGR_PRE_X11); - public static final SurfaceType IntArgbPreX11 = - SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_PRE_X11); - public static final SurfaceType ThreeByteRgbX11 = SurfaceType.ThreeByteRgb.deriveSubType(DESC_3BYTE_RGB_X11); public static final SurfaceType ThreeByteBgrX11 = @@ -425,7 +413,7 @@ int transparency) { return new X11PixmapSurfaceData(gc, width, height, image, - getSurfaceType(gc, transparency, true), + getSurfaceType(gc, transparency), cm, drawable, transparency); } @@ -510,13 +498,6 @@ public static SurfaceType getSurfaceType(X11GraphicsConfig gc, int transparency) { - return getSurfaceType(gc, transparency, false); - } - - public static SurfaceType getSurfaceType(X11GraphicsConfig gc, - int transparency, - boolean pixmapSurface) - { boolean transparent = (transparency == Transparency.BITMASK); SurfaceType sType; ColorModel cm = gc.getColorModel(); @@ -543,21 +524,11 @@ // Fall through for 32 bit case case 32: if (cm instanceof DirectColorModel) { - if (((SunToolkit)java.awt.Toolkit.getDefaultToolkit() - ).isTranslucencyCapable(gc) && !pixmapSurface) - { - sType = X11SurfaceData.IntArgbPreX11; + if (((DirectColorModel)cm).getRedMask() == 0xff0000) { + sType = transparent ? X11SurfaceData.IntRgbX11_BM : X11SurfaceData.IntRgbX11; } else { - if (((DirectColorModel)cm).getRedMask() == 0xff0000) { - sType = transparent ? X11SurfaceData.IntRgbX11_BM : - X11SurfaceData.IntRgbX11; - } else { - sType = transparent ? X11SurfaceData.IntBgrX11_BM : - X11SurfaceData.IntBgrX11; - } + sType = transparent ? X11SurfaceData.IntBgrX11_BM : X11SurfaceData.IntBgrX11; } - } else if (cm instanceof ComponentColorModel) { - sType = X11SurfaceData.FourByteAbgrPreX11; } else { throw new sun.java2d.InvalidPipeException("Unsupported bit " + diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/native/sun/awt/X11Color.c --- a/jdk/src/solaris/native/sun/awt/X11Color.c Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/native/sun/awt/X11Color.c Wed May 06 20:06:23 2009 +0400 @@ -886,27 +886,6 @@ #define blue(v) (((v) >> 0) & 0xFF) #ifndef HEADLESS - -jobject getColorSpace(JNIEnv* env, jint csID) { - jclass clazz; - jobject cspaceL; - jmethodID mid; - - clazz = (*env)->FindClass(env,"java/awt/color/ColorSpace"); - mid = (*env)->GetStaticMethodID(env, clazz, "getInstance", - "(I)Ljava/awt/color/ColorSpace;"); - if (mid == NULL) { - return NULL; - } - - /* SECURITY: This is safe, because static methods cannot - * be overridden, and this method does not invoke - * client code - */ - - return (*env)->CallStaticObjectMethod(env, clazz, mid, csID); -} - jobject awtJNI_GetColorModel(JNIEnv *env, AwtGraphicsConfigDataPtr aData) { jobject awt_colormodel = NULL; @@ -920,60 +899,20 @@ (aData->awt_depth >= 15)) { clazz = (*env)->FindClass(env,"java/awt/image/DirectColorModel"); - if (!aData->isTranslucencySupported) { - mid = (*env)->GetMethodID(env,clazz,"","(IIIII)V"); - - if (mid == NULL) { - (*env)->PopLocalFrame(env, 0); - return NULL; - } - awt_colormodel = (*env)->NewObject(env,clazz, mid, - aData->awt_visInfo.depth, - aData->awt_visInfo.red_mask, - aData->awt_visInfo.green_mask, - aData->awt_visInfo.blue_mask, - 0); - } else { - clazz = (*env)->FindClass(env,"sun/awt/X11GraphicsConfig"); - if (clazz == NULL) { - (*env)->PopLocalFrame(env, 0); - return NULL; - } - - if (aData->renderPictFormat.direct.red == 16) { - mid = (*env)->GetStaticMethodID( env,clazz,"createDCM32", - "(IIIIZ)Ljava/awt/image/DirectColorModel;"); + mid = (*env)->GetMethodID(env,clazz,"","(IIIII)V"); - if (mid == NULL) { - (*env)->PopLocalFrame(env, 0); - return NULL; - } + if (mid == NULL) { + (*env)->PopLocalFrame(env, 0); + return NULL; + } - awt_colormodel = (*env)->CallStaticObjectMethod( - env,clazz, mid, - aData->renderPictFormat.direct.redMask - << aData->renderPictFormat.direct.red, - aData->renderPictFormat.direct.greenMask - << aData->renderPictFormat.direct.green, - aData->renderPictFormat.direct.blueMask - << aData->renderPictFormat.direct.blue, - aData->renderPictFormat.direct.alphaMask - << aData->renderPictFormat.direct.alpha, - JNI_TRUE); - } else { - mid = (*env)->GetStaticMethodID( env,clazz,"createABGRCCM", - "()Ljava/awt/image/ComponentColorModel;"); - - if (mid == NULL) { - (*env)->PopLocalFrame(env, 0); - return NULL; - } - - awt_colormodel = (*env)->CallStaticObjectMethod( - env,clazz, mid); - } - } + awt_colormodel = (*env)->NewObject(env,clazz, mid, + aData->awt_visInfo.depth, + aData->awt_visInfo.red_mask, + aData->awt_visInfo.green_mask, + aData->awt_visInfo.blue_mask, + 0); if(awt_colormodel == NULL) { @@ -984,13 +923,25 @@ } else if (aData->awt_visInfo.class == StaticGray && aData->awt_num_colors == 256) { + jclass clazz1; jobject cspace = NULL; jint bits[1]; jintArray bitsArray; jboolean falseboolean = JNI_FALSE; - cspace = getColorSpace(env, java_awt_color_ColorSpace_CS_GRAY); - + clazz1 = (*env)->FindClass(env,"java/awt/color/ColorSpace"); + mid = (*env)->GetStaticMethodID(env, clazz1, "getInstance", + "(I)Ljava/awt/color/ColorSpace;"); + if (mid == NULL) { + (*env)->PopLocalFrame(env, 0); + return NULL; + } + /* SECURITY: This is safe, because static methods cannot + * be overridden, and this method does not invoke + * client code + */ + cspace = (*env)->CallStaticObjectMethod(env, clazz1, mid, + java_awt_color_ColorSpace_CS_GRAY); if (cspace == NULL) { (*env)->PopLocalFrame(env, 0); return NULL; diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c Wed May 06 20:06:23 2009 +0400 @@ -354,6 +354,48 @@ return NULL; } +/* Note: until we include the explicitly + * we have to define a couple of things ourselves. + */ +typedef unsigned long PictFormat; +#define PictTypeIndexed 0 +#define PictTypeDirect 1 + +typedef struct { + short red; + short redMask; + short green; + short greenMask; + short blue; + short blueMask; + short alpha; + short alphaMask; +} XRenderDirectFormat; + +typedef struct { + PictFormat id; + int type; + int depth; + XRenderDirectFormat direct; + Colormap colormap; +} XRenderPictFormat; + +#define PictFormatID (1 << 0) +#define PictFormatType (1 << 1) +#define PictFormatDepth (1 << 2) +#define PictFormatRed (1 << 3) +#define PictFormatRedMask (1 << 4) +#define PictFormatGreen (1 << 5) +#define PictFormatGreenMask (1 << 6) +#define PictFormatBlue (1 << 7) +#define PictFormatBlueMask (1 << 8) +#define PictFormatAlpha (1 << 9) +#define PictFormatAlphaMask (1 << 10) +#define PictFormatColormap (1 << 11) + +typedef XRenderPictFormat * +XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual); + static void getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) { @@ -493,8 +535,6 @@ format->direct.alphaMask) { graphicsConfigs [ind]->isTranslucencySupported = 1; - memcpy(&graphicsConfigs [ind]->renderPictFormat, format, - sizeof(*format)); } } } diff -r a6629ca69b70 -r f038acdbdf9c jdk/src/solaris/native/sun/awt/awt_p.h --- a/jdk/src/solaris/native/sun/awt/awt_p.h Wed May 06 12:39:23 2009 +0400 +++ b/jdk/src/solaris/native/sun/awt/awt_p.h Wed May 06 20:06:23 2009 +0400 @@ -119,50 +119,6 @@ } DamageRect; #ifndef HEADLESS - -/* Note: until we include the explicitly - * we have to define a couple of things ourselves. - */ -typedef unsigned long PictFormat; -#define PictTypeIndexed 0 -#define PictTypeDirect 1 - -typedef struct { - short red; - short redMask; - short green; - short greenMask; - short blue; - short blueMask; - short alpha; - short alphaMask; -} XRenderDirectFormat; - -typedef struct { - PictFormat id; - int type; - int depth; - XRenderDirectFormat direct; - Colormap colormap; -} XRenderPictFormat; - -#define PictFormatID (1 << 0) -#define PictFormatType (1 << 1) -#define PictFormatDepth (1 << 2) -#define PictFormatRed (1 << 3) -#define PictFormatRedMask (1 << 4) -#define PictFormatGreen (1 << 5) -#define PictFormatGreenMask (1 << 6) -#define PictFormatBlue (1 << 7) -#define PictFormatBlueMask (1 << 8) -#define PictFormatAlpha (1 << 9) -#define PictFormatAlphaMask (1 << 10) -#define PictFormatColormap (1 << 11) - -typedef XRenderPictFormat * -XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual); -/* END OF Xrender.h chunk */ - typedef struct _AwtGraphicsConfigData { int awt_depth; Colormap awt_cmap; @@ -180,7 +136,6 @@ ColorData *color_data; struct _GLXGraphicsConfigInfo *glxInfo; int isTranslucencySupported; /* Uses Xrender to find this out. */ - XRenderPictFormat renderPictFormat; /*Used only if translucency supported*/ } AwtGraphicsConfigData; typedef AwtGraphicsConfigData* AwtGraphicsConfigDataPtr;