Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f4db7839
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看板
提交
f4db7839
编写于
5月 11, 2011
作者:
A
anthony
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7043455: Taking a screenshot may fail on X11 after 6903034
Summary: Backout 6903034 Reviewed-by: art, dcherepanov
上级
f5d80162
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
107 deletion
+4
-107
make/sun/xawt/mapfile-vers
make/sun/xawt/mapfile-vers
+0
-1
src/solaris/classes/sun/awt/X11/XRobotPeer.java
src/solaris/classes/sun/awt/X11/XRobotPeer.java
+1
-2
src/solaris/native/sun/awt/awt_Robot.c
src/solaris/native/sun/awt/awt_Robot.c
+3
-104
未找到文件。
make/sun/xawt/mapfile-vers
浏览文件 @
f4db7839
...
@@ -158,7 +158,6 @@ SUNWprivate_1.1 {
...
@@ -158,7 +158,6 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl;
Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl;
Java_sun_awt_X11_XRobotPeer_mouseWheelImpl;
Java_sun_awt_X11_XRobotPeer_mouseWheelImpl;
Java_sun_awt_X11_XRobotPeer_setup;
Java_sun_awt_X11_XRobotPeer_setup;
Java_sun_awt_X11_XRobotPeer__1dispose;
Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl;
Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl;
Java_java_awt_Component_initIDs;
Java_java_awt_Component_initIDs;
Java_java_awt_Container_initIDs;
Java_java_awt_Container_initIDs;
...
...
src/solaris/classes/sun/awt/X11/XRobotPeer.java
浏览文件 @
f4db7839
...
@@ -48,7 +48,7 @@ class XRobotPeer implements RobotPeer {
...
@@ -48,7 +48,7 @@ class XRobotPeer implements RobotPeer {
}
}
public
void
dispose
()
{
public
void
dispose
()
{
_dispose
();
// does nothing
}
}
public
void
mouseMove
(
int
x
,
int
y
)
{
public
void
mouseMove
(
int
x
,
int
y
)
{
...
@@ -88,7 +88,6 @@ class XRobotPeer implements RobotPeer {
...
@@ -88,7 +88,6 @@ class XRobotPeer implements RobotPeer {
}
}
private
static
native
synchronized
void
setup
(
int
numberOfButtons
,
int
[]
buttonDownMasks
);
private
static
native
synchronized
void
setup
(
int
numberOfButtons
,
int
[]
buttonDownMasks
);
private
static
native
synchronized
void
_dispose
();
private
static
native
synchronized
void
mouseMoveImpl
(
X11GraphicsConfig
xgc
,
int
x
,
int
y
);
private
static
native
synchronized
void
mouseMoveImpl
(
X11GraphicsConfig
xgc
,
int
x
,
int
y
);
private
static
native
synchronized
void
mousePressImpl
(
int
buttons
);
private
static
native
synchronized
void
mousePressImpl
(
int
buttons
);
...
...
src/solaris/native/sun/awt/awt_Robot.c
浏览文件 @
f4db7839
...
@@ -48,28 +48,12 @@
...
@@ -48,28 +48,12 @@
#ifdef __linux__
#ifdef __linux__
#include <sys/socket.h>
#include <sys/socket.h>
#endif
#endif
#include <dlfcn.h>
extern
struct
X11GraphicsConfigIDs
x11GraphicsConfigIDs
;
extern
struct
X11GraphicsConfigIDs
x11GraphicsConfigIDs
;
static
jint
*
masks
;
static
jint
*
masks
;
static
jint
num_buttons
;
static
jint
num_buttons
;
static
unsigned
int
s_robotInstanceCounter
=
0
;
static
void
*
xcompositeLibHandle
=
NULL
;
static
Bool
xcompositeExtAvailable
=
False
;
static
Bool
xcompositeExtTested
=
False
;
typedef
Status
(
*
T_XCompositeQueryVersion
)(
Display
*
dpy
,
int
*
major_versionp
,
int
*
minor_versionp
);
typedef
Window
(
*
T_XCompositeGetOverlayWindow
)(
Display
*
dpy
,
Window
window
);
typedef
void
(
*
T_XCompositeReleaseOverlayWindow
)(
Display
*
dpy
,
Window
window
);
static
T_XCompositeQueryVersion
XCompositeQueryVersion
=
NULL
;
static
T_XCompositeGetOverlayWindow
XCompositeGetOverlayWindow
=
NULL
;
static
T_XCompositeReleaseOverlayWindow
XCompositeReleaseOverlayWindow
=
NULL
;
static
int32_t
isXTestAvailable
()
{
static
int32_t
isXTestAvailable
()
{
int32_t
major_opcode
,
first_event
,
first_error
;
int32_t
major_opcode
,
first_event
,
first_error
;
int32_t
event_basep
,
error_basep
,
majorp
,
minorp
;
int32_t
event_basep
,
error_basep
,
majorp
,
minorp
;
...
@@ -210,80 +194,8 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton
...
@@ -210,80 +194,8 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton
}
}
AWT_UNLOCK
();
AWT_UNLOCK
();
s_robotInstanceCounter
++
;
}
}
JNIEXPORT
void
JNICALL
Java_sun_awt_X11_XRobotPeer__1dispose
(
JNIEnv
*
env
,
jclass
cls
)
{
if
(
--
s_robotInstanceCounter
)
{
return
;
}
// This is the last instance of the XRobotPeer being released
if
(
xcompositeExtTested
&&
xcompositeExtAvailable
&&
xcompositeLibHandle
)
{
// The lib is loaded in IsXCompositeAvailable(). Unload under AWT_LOCK
// so that the shutdown function of the lib behaves correctly.
AWT_LOCK
();
dlclose
(
xcompositeLibHandle
);
AWT_UNLOCK
();
}
xcompositeExtTested
=
False
;
xcompositeExtAvailable
=
False
;
xcompositeLibHandle
=
NULL
;
}
/*
* Returns True only if XCOMPOSITE is of version 0.3 or higher.
* The functions that we need are available since that version.
*
* Must be invoked under AWT_LOCK.
*
* Leaves the library loaded if the version is correct.
*/
static
Bool
IsXCompositeAvailable
()
{
if
(
!
xcompositeExtTested
)
{
int
opcode
,
eventb
,
errorb
;
if
(
XQueryExtension
(
awt_display
,
"Composite"
,
&
opcode
,
&
eventb
,
&
errorb
))
{
xcompositeLibHandle
=
dlopen
(
"libXcomposite.so.1"
,
RTLD_LAZY
|
RTLD_GLOBAL
);
#ifndef __linux__
/* SOLARIS */
if
(
xcompositeLibHandle
==
NULL
)
{
xcompositeLibHandle
=
dlopen
(
"/usr/sfw/lib/libXcomposite.so.1"
,
RTLD_LAZY
|
RTLD_GLOBAL
);
}
#endif
if
(
xcompositeLibHandle
)
{
int
major
,
minor
;
XCompositeQueryVersion
=
(
T_XCompositeQueryVersion
)
dlsym
(
xcompositeLibHandle
,
"XCompositeQueryVersion"
);
if
(
XCompositeQueryVersion
&&
XCompositeQueryVersion
(
awt_display
,
&
major
,
&
minor
))
{
if
(
major
>=
0
&&
minor
>=
3
)
{
XCompositeGetOverlayWindow
=
(
T_XCompositeGetOverlayWindow
)
dlsym
(
xcompositeLibHandle
,
"XCompositeGetOverlayWindow"
);
XCompositeReleaseOverlayWindow
=
(
T_XCompositeReleaseOverlayWindow
)
dlsym
(
xcompositeLibHandle
,
"XCompositeReleaseOverlayWindow"
);
if
(
XCompositeGetOverlayWindow
&&
XCompositeReleaseOverlayWindow
)
{
xcompositeExtAvailable
=
True
;
}
}
}
if
(
!
xcompositeExtAvailable
)
{
dlclose
(
xcompositeLibHandle
);
}
/* else the lib is unloaded in _dispose() */
}
}
xcompositeExtTested
=
True
;
}
return
xcompositeExtAvailable
;
}
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl
(
JNIEnv
*
env
,
Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl
(
JNIEnv
*
env
,
...
@@ -299,7 +211,7 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
...
@@ -299,7 +211,7 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
jint
*
ary
;
/* Array of jints for sending pixel values back
jint
*
ary
;
/* Array of jints for sending pixel values back
* to parent process.
* to parent process.
*/
*/
Window
w
indow
;
Window
rootW
indow
;
AwtGraphicsConfigDataPtr
adata
;
AwtGraphicsConfigDataPtr
adata
;
DTRACE_PRINTLN6
(
"RobotPeer: getRGBPixelsImpl(%lx, %d, %d, %d, %d, %x)"
,
xgc
,
x
,
y
,
width
,
height
,
pixelArray
);
DTRACE_PRINTLN6
(
"RobotPeer: getRGBPixelsImpl(%lx, %d, %d, %d, %d, %x)"
,
xgc
,
x
,
y
,
width
,
height
,
pixelArray
);
...
@@ -316,24 +228,14 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
...
@@ -316,24 +228,14 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
adata
=
(
AwtGraphicsConfigDataPtr
)
JNU_GetLongFieldAsPtr
(
env
,
xgc
,
x11GraphicsConfigIDs
.
aData
);
adata
=
(
AwtGraphicsConfigDataPtr
)
JNU_GetLongFieldAsPtr
(
env
,
xgc
,
x11GraphicsConfigIDs
.
aData
);
DASSERT
(
adata
!=
NULL
);
DASSERT
(
adata
!=
NULL
);
window
=
XRootWindow
(
awt_display
,
adata
->
awt_visInfo
.
screen
);
rootWindow
=
XRootWindow
(
awt_display
,
adata
->
awt_visInfo
.
screen
);
image
=
getWindowImage
(
awt_display
,
rootWindow
,
x
,
y
,
width
,
height
);
if
(
IsXCompositeAvailable
())
{
// Use 'composite overlay window' instead of the root window.
// See 6903034 for details.
window
=
XCompositeGetOverlayWindow
(
awt_display
,
window
);
}
image
=
getWindowImage
(
awt_display
,
window
,
x
,
y
,
width
,
height
);
/* Array to use to crunch around the pixel values */
/* Array to use to crunch around the pixel values */
ary
=
(
jint
*
)
malloc
(
width
*
height
*
sizeof
(
jint
));
ary
=
(
jint
*
)
malloc
(
width
*
height
*
sizeof
(
jint
));
if
(
ary
==
NULL
)
{
if
(
ary
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
"OutOfMemoryError"
);
JNU_ThrowOutOfMemoryError
(
env
,
"OutOfMemoryError"
);
XDestroyImage
(
image
);
XDestroyImage
(
image
);
if
(
IsXCompositeAvailable
())
{
XCompositeReleaseOverlayWindow
(
awt_display
,
window
);
}
AWT_UNLOCK
();
AWT_UNLOCK
();
return
;
return
;
}
}
...
@@ -354,9 +256,6 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
...
@@ -354,9 +256,6 @@ Java_sun_awt_X11_XRobotPeer_getRGBPixelsImpl( JNIEnv *env,
free
(
ary
);
free
(
ary
);
XDestroyImage
(
image
);
XDestroyImage
(
image
);
if
(
IsXCompositeAvailable
())
{
XCompositeReleaseOverlayWindow
(
awt_display
,
window
);
}
AWT_UNLOCK
();
AWT_UNLOCK
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录