Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6c0015ca
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看板
提交
6c0015ca
编写于
2月 05, 2018
作者:
K
kaddepalli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8171000: Robot.createScreenCapture() crashes in wayland mode
Reviewed-by: serb, mhalder
上级
48a842b5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
62 deletion
+33
-62
src/solaris/native/sun/awt/multiVis.c
src/solaris/native/sun/awt/multiVis.c
+33
-62
未找到文件。
src/solaris/native/sun/awt/multiVis.c
浏览文件 @
6c0015ca
...
@@ -394,77 +394,48 @@ int32_t format ;
...
@@ -394,77 +394,48 @@ int32_t format ;
XRectangle
bbox
;
/* bounding box of grabbed area */
XRectangle
bbox
;
/* bounding box of grabbed area */
list_ptr
regions
;
/* list of regions to read from */
list_ptr
regions
;
/* list of regions to read from */
{
{
image_region_type
*
reg
;
XImage
*
ximage
;
int32_t
dst_x
,
dst_y
;
/* where in pixmap to write (UL) */
int32_t
diff
;
XImage
*
reg_image
,
*
ximage
;
int32_t
srcRect_x
,
srcRect_y
,
srcRect_width
,
srcRect_height
;
int32_t
rem
;
int32_t
bytes_per_line
;
int32_t
bitmap_unit
;
bitmap_unit
=
sizeof
(
long
);
if
(
format
==
ZPixmap
)
bytes_per_line
=
width
*
depth
/
8
;
else
bytes_per_line
=
width
/
8
;
/* Find out how many more bytes are required for padding so that
** bytes per scan line will be multiples of bitmap_unit bits */
if
(
format
==
ZPixmap
)
{
rem
=
(
bytes_per_line
*
8
)
%
bitmap_unit
;
if
(
rem
)
bytes_per_line
+=
(
rem
/
8
+
1
);
}
ximage
=
XCreateImage
(
disp
,
fakeVis
,(
uint32_t
)
depth
,
format
,
0
,
NULL
,
ximage
=
XCreateImage
(
disp
,
fakeVis
,(
uint32_t
)
depth
,
format
,
0
,
NULL
,
(
uint32_t
)
width
,(
uint32_t
)
height
,
8
,
0
);
(
uint32_t
)
width
,(
uint32_t
)
height
,
8
,
0
);
bytes_per_line
=
ximage
->
bytes_per_line
;
ximage
->
data
=
calloc
(
ximage
->
bytes_per_line
*
height
*
((
format
==
ZPixmap
)
?
1
:
depth
),
sizeof
(
char
));
if
(
format
==
ZPixmap
)
ximage
->
data
=
malloc
(
height
*
bytes_per_line
);
else
ximage
->
data
=
malloc
(
height
*
bytes_per_line
*
depth
);
ximage
->
bits_per_pixel
=
depth
;
/** Valid only if format is ZPixmap ***/
ximage
->
bits_per_pixel
=
depth
;
/** Valid only if format is ZPixmap ***/
for
(
reg
=
(
image_region_type
*
)
first_in_list
(
regions
);
reg
;
for
(
image_region_type
*
reg
=
(
image_region_type
*
)
first_in_list
(
regions
);
reg
;
reg
=
(
image_region_type
*
)
next_in_list
(
regions
))
reg
=
(
image_region_type
*
)
next_in_list
(
regions
))
{
{
int32_t
rect
;
struct
my_XRegion
*
vis_reg
=
(
struct
my_XRegion
*
)(
reg
->
visible_region
);
struct
my_XRegion
*
vis_reg
;
for
(
int32_t
rect
=
0
;
rect
<
vis_reg
->
numRects
;
rect
++
)
vis_reg
=
(
struct
my_XRegion
*
)(
reg
->
visible_region
);
for
(
rect
=
0
;
rect
<
vis_reg
->
numRects
;
rect
++
)
{
{
/** ------------------------------------------------------------------------
/** ------------------------------------------------------------------------
Intersect bbox with visible part of region giving src rect & output
Intersect bbox with visible part of region giving src rect & output
location. Width is the min right side minus the max left side.
location. Width is the min right side minus the max left side.
Similar for height. Offset src rect so x,y are relative to
Similar for height. Offset src rect so x,y are relative to
origin of win, not the root-relative visible rect of win.
origin of win, not the root-relative visible rect of win.
------------------------------------------------------------------------ **/
------------------------------------------------------------------------ **/
srcRect_width
=
MIN
(
vis_reg
->
rects
[
rect
].
x2
,
bbox
.
width
+
bbox
.
x
)
int32_t
srcRect_width
=
MIN
(
vis_reg
->
rects
[
rect
].
x2
,
bbox
.
width
+
bbox
.
x
)
-
MAX
(
vis_reg
->
rects
[
rect
].
x1
,
bbox
.
x
);
-
MAX
(
vis_reg
->
rects
[
rect
].
x1
,
bbox
.
x
);
srcRect_height
=
MIN
(
vis_reg
->
rects
[
rect
].
y2
,
bbox
.
height
+
bbox
.
y
)
int32_t
srcRect_height
=
MIN
(
vis_reg
->
rects
[
rect
].
y2
,
bbox
.
height
+
bbox
.
y
)
-
MAX
(
vis_reg
->
rects
[
rect
].
y1
,
bbox
.
y
);
-
MAX
(
vis_reg
->
rects
[
rect
].
y1
,
bbox
.
y
);
diff
=
bbox
.
x
-
vis_reg
->
rects
[
rect
].
x1
;
int32_t
diff
=
bbox
.
x
-
vis_reg
->
rects
[
rect
].
x1
;
srcRect_x
=
MAX
(
0
,
diff
)
+
(
vis_reg
->
rects
[
rect
].
x1
-
reg
->
x_rootrel
-
reg
->
border
);
int32_t
srcRect_x
=
MAX
(
0
,
diff
)
+
(
vis_reg
->
rects
[
rect
].
x1
-
reg
->
x_rootrel
-
reg
->
border
);
dst_x
=
MAX
(
0
,
-
diff
)
;
int32_t
dst_x
=
MAX
(
0
,
-
diff
)
;
diff
=
bbox
.
y
-
vis_reg
->
rects
[
rect
].
y1
;
srcRect_y
=
MAX
(
0
,
diff
)
+
(
vis_reg
->
rects
[
rect
].
y1
-
reg
->
y_rootrel
-
reg
->
border
);
diff
=
bbox
.
y
-
vis_reg
->
rects
[
rect
].
y1
;
dst_y
=
MAX
(
0
,
-
diff
)
;
int32_t
srcRect_y
=
MAX
(
0
,
diff
)
+
(
vis_reg
->
rects
[
rect
].
y1
-
reg
->
y_rootrel
-
reg
->
border
);
reg_image
=
XGetImage
(
disp
,
reg
->
win
,
srcRect_x
,
srcRect_y
,
int32_t
dst_y
=
MAX
(
0
,
-
diff
)
;
(
uint32_t
)
srcRect_width
,
(
uint32_t
)
srcRect_height
,
AllPlanes
,
format
)
;
XImage
*
reg_image
=
XGetImage
(
disp
,
reg
->
win
,
srcRect_x
,
srcRect_y
,
TransferImage
(
disp
,
reg_image
,
srcRect_width
,
(
uint32_t
)
srcRect_width
,
(
uint32_t
)
srcRect_height
,
AllPlanes
,
format
)
;
srcRect_height
,
reg
,
ximage
,
dst_x
,
dst_y
)
;
XDestroyImage
(
reg_image
);
if
(
reg_image
)
{
}
TransferImage
(
disp
,
reg_image
,
srcRect_width
,
srcRect_height
,
reg
,
ximage
,
dst_x
,
dst_y
)
;
XDestroyImage
(
reg_image
);
}
}
}
}
return
ximage
;
return
ximage
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录