Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
4d0a2aa1
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4d0a2aa1
编写于
5月 19, 2009
作者:
A
anthony
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6839999: Cumulative fix for 6762511 and 6838003
Summary: Adds support for ARGB and ABGR X11 surfaces. Reviewed-by: art, yan
上级
319b463b
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
226 addition
and
72 deletion
+226
-72
src/solaris/classes/sun/awt/X11/generator/sizes.64-solaris-i386
...laris/classes/sun/awt/X11/generator/sizes.64-solaris-i386
+17
-1
src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt
src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt
+16
-0
src/solaris/classes/sun/awt/X11GraphicsConfig.java
src/solaris/classes/sun/awt/X11GraphicsConfig.java
+19
-0
src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java
src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java
+4
-0
src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java
src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java
+16
-0
src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
+33
-4
src/solaris/native/sun/awt/X11Color.c
src/solaris/native/sun/awt/X11Color.c
+74
-25
src/solaris/native/sun/awt/awt_GraphicsEnv.c
src/solaris/native/sun/awt/awt_GraphicsEnv.c
+2
-42
src/solaris/native/sun/awt/awt_p.h
src/solaris/native/sun/awt/awt_p.h
+45
-0
未找到文件。
src/solaris/classes/sun/awt/X11/generator/sizes.64-solaris-i386
浏览文件 @
4d0a2aa1
...
...
@@ -186,6 +186,15 @@ XEvent.xerror 0
XEvent.xkeymap 0
XEvent.pad 0
XEvent 192
XRenderDirectFormat.red 0
XRenderDirectFormat.redMask 2
XRenderDirectFormat.green 4
XRenderDirectFormat.greenMask 6
XRenderDirectFormat.blue 8
XRenderDirectFormat.blueMask 10
XRenderDirectFormat.alpha 12
XRenderDirectFormat.alphaMask 14
XRenderDirectFormat 16
ColorData.awt_Colors 0
ColorData.awt_numICMcolors 8
ColorData.awt_icmLUT 16
...
...
@@ -440,6 +449,12 @@ XSetWindowAttributes.override_redirect 88
XSetWindowAttributes.colormap 96
XSetWindowAttributes.cursor 104
XSetWindowAttributes 112
XRenderPictFormat.id 0
XRenderPictFormat.type 8
XRenderPictFormat.depth 12
XRenderPictFormat.direct 16
XRenderPictFormat.colormap 32
XRenderPictFormat 40
XReparentEvent.type 0
XReparentEvent.serial 8
XReparentEvent.send_event 16
...
...
@@ -985,7 +1000,8 @@ AwtGraphicsConfigData.pixelStride 136
AwtGraphicsConfigData.color_data 144
AwtGraphicsConfigData.glxInfo 152
AwtGraphicsConfigData.isTranslucencySupported 160
AwtGraphicsConfigData 168
AwtGraphicsConfigData.renderPictFormat 168
AwtGraphicsConfigData 208
XColor.pixel 0
XColor.red 8
XColor.green 10
...
...
src/solaris/classes/sun/awt/X11/generator/xlibtypes.txt
浏览文件 @
4d0a2aa1
...
...
@@ -245,6 +245,21 @@ XVisualInfo
blue_mask long
colormap_size int
bits_per_rgb int
XRenderDirectFormat
red short
redMask short
green short
greenMask short
blue short
blueMask short
alpha short
alphaMask short
XRenderPictFormat
id long
type int
depth int
direct struct XRenderDirectFormat
colormap long
XIMHotKeyTrigger
keysym long
modifier int
...
...
@@ -751,6 +766,7 @@ AwtGraphicsConfigData
color_data pointer ColorData
glxInfo pointer
isTranslucencySupported int
renderPictFormat struct XRenderPictFormat
AwtScreenData
numConfigs int
...
...
src/solaris/classes/sun/awt/X11GraphicsConfig.java
浏览文件 @
4d0a2aa1
...
...
@@ -37,7 +37,10 @@ import java.awt.ImageCapabilities;
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
;
...
...
@@ -230,6 +233,22 @@ public class X11GraphicsConfig extends GraphicsConfiguration
}
}
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
...
...
src/solaris/classes/sun/java2d/x11/X11PMBlitBgLoops.java
浏览文件 @
4d0a2aa1
...
...
@@ -70,6 +70,10 @@ public class X11PMBlitBgLoops extends BlitBg {
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
);
}
...
...
src/solaris/classes/sun/java2d/x11/X11PMBlitLoops.java
浏览文件 @
4d0a2aa1
...
...
@@ -95,6 +95,22 @@ public class X11PMBlitLoops extends Blit {
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
),
...
...
src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
浏览文件 @
4d0a2aa1
...
...
@@ -81,6 +81,13 @@ public abstract class X11SurfaceData extends SurfaceData {
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"
;
...
...
@@ -133,6 +140,11 @@ public abstract class X11SurfaceData extends SurfaceData {
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
=
...
...
@@ -413,7 +425,7 @@ public abstract class X11SurfaceData extends SurfaceData {
int
transparency
)
{
return
new
X11PixmapSurfaceData
(
gc
,
width
,
height
,
image
,
getSurfaceType
(
gc
,
transparency
),
getSurfaceType
(
gc
,
transparency
,
true
),
cm
,
drawable
,
transparency
);
}
...
...
@@ -497,6 +509,13 @@ public abstract class X11SurfaceData extends SurfaceData {
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
;
...
...
@@ -524,11 +543,21 @@ public abstract class X11SurfaceData extends SurfaceData {
// Fall through for 32 bit case
case
32
:
if
(
cm
instanceof
DirectColorModel
)
{
if
(((
SunToolkit
)
java
.
awt
.
Toolkit
.
getDefaultToolkit
()
).
isTranslucencyCapable
(
gc
)
&&
!
pixmapSurface
)
{
sType
=
X11SurfaceData
.
IntArgbPreX11
;
}
else
{
if
(((
DirectColorModel
)
cm
).
getRedMask
()
==
0xff0000
)
{
sType
=
transparent
?
X11SurfaceData
.
IntRgbX11_BM
:
X11SurfaceData
.
IntRgbX11
;
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 "
+
...
...
src/solaris/native/sun/awt/X11Color.c
浏览文件 @
4d0a2aa1
...
...
@@ -886,6 +886,27 @@ awt_allocate_colors(AwtGraphicsConfigDataPtr awt_data)
#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
;
...
...
@@ -899,6 +920,7 @@ jobject awtJNI_GetColorModel(JNIEnv *env, AwtGraphicsConfigDataPtr aData)
(
aData
->
awt_depth
>=
15
))
{
clazz
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/image/DirectColorModel"
);
if
(
!
aData
->
isTranslucencySupported
)
{
mid
=
(
*
env
)
->
GetMethodID
(
env
,
clazz
,
"<init>"
,
"(IIIII)V"
);
...
...
@@ -906,13 +928,52 @@ jobject awtJNI_GetColorModel(JNIEnv *env, AwtGraphicsConfigDataPtr aData)
(
*
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;"
);
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
);
}
}
if
(
awt_colormodel
==
NULL
)
{
...
...
@@ -923,25 +984,13 @@ jobject awtJNI_GetColorModel(JNIEnv *env, AwtGraphicsConfigDataPtr aData)
}
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
;
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
);
cspace
=
getColorSpace
(
env
,
java_awt_color_ColorSpace_CS_GRAY
);
if
(
cspace
==
NULL
)
{
(
*
env
)
->
PopLocalFrame
(
env
,
0
);
return
NULL
;
...
...
src/solaris/native/sun/awt/awt_GraphicsEnv.c
浏览文件 @
4d0a2aa1
...
...
@@ -323,48 +323,6 @@ makeDefaultConfig(JNIEnv *env, int screen) {
return
NULL
;
}
/* Note: until we include the <X11/extensions/Xrender.h> 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
)
{
...
...
@@ -504,6 +462,8 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
format
->
direct
.
alphaMask
)
{
graphicsConfigs
[
ind
]
->
isTranslucencySupported
=
1
;
memcpy
(
&
graphicsConfigs
[
ind
]
->
renderPictFormat
,
format
,
sizeof
(
*
format
));
}
}
}
...
...
src/solaris/native/sun/awt/awt_p.h
浏览文件 @
4d0a2aa1
...
...
@@ -119,6 +119,50 @@ typedef struct _DamageRect {
}
DamageRect
;
#ifndef HEADLESS
/* Note: until we include the <X11/extensions/Xrender.h> 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
;
...
...
@@ -136,6 +180,7 @@ typedef struct _AwtGraphicsConfigData {
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录