Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ce00db43
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看板
提交
ce00db43
编写于
10月 16, 2019
作者:
A
alitvinov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8225279: Better XRender interpolation
Reviewed-by: serb, prr, rhalade, ahgross
上级
39a1668d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
11 deletion
+39
-11
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+38
-10
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
+1
-1
未找到文件。
src/solaris/native/sun/java2d/x11/X11SurfaceData.c
浏览文件 @
ce00db43
...
@@ -78,6 +78,7 @@ static void X11SD_SwapBytes(X11SDOps *xsdo, XImage *img, int depth, int bpp);
...
@@ -78,6 +78,7 @@ static void X11SD_SwapBytes(X11SDOps *xsdo, XImage *img, int depth, int bpp);
static
XImage
*
X11SD_GetImage
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
,
static
XImage
*
X11SD_GetImage
(
JNIEnv
*
env
,
X11SDOps
*
xsdo
,
SurfaceDataBounds
*
bounds
,
SurfaceDataBounds
*
bounds
,
jint
lockFlags
);
jint
lockFlags
);
static
int
X11SD_GetBitmapPad
(
int
pixelStride
);
extern
jfieldID
validID
;
extern
jfieldID
validID
;
...
@@ -438,11 +439,33 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
...
@@ -438,11 +439,33 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
xsdo
->
drawable
=
drawable
;
xsdo
->
drawable
=
drawable
;
xsdo
->
isPixmap
=
JNI_FALSE
;
xsdo
->
isPixmap
=
JNI_FALSE
;
}
else
{
}
else
{
jboolean
sizeIsInvalid
=
JNI_FALSE
;
jlong
scan
=
0
;
/*
/*
* width , height must be nonzero otherwise XCreatePixmap
* width , height must be nonzero otherwise XCreatePixmap
* generates BadValue in error_handler
* generates BadValue in error_handler
*/
*/
if
(
width
<=
0
||
height
<=
0
||
width
>
32767
||
height
>
32767
)
{
if
(
width
<=
0
||
height
<=
0
||
width
>
32767
||
height
>
32767
)
{
sizeIsInvalid
=
JNI_TRUE
;
}
else
{
XImage
*
tmpImg
=
NULL
;
AWT_LOCK
();
tmpImg
=
XCreateImage
(
awt_display
,
xsdo
->
configData
->
awt_visInfo
.
visual
,
depth
,
ZPixmap
,
0
,
NULL
,
width
,
height
,
X11SD_GetBitmapPad
(
xsdo
->
configData
->
pixelStride
),
0
);
if
(
tmpImg
)
{
scan
=
(
jlong
)
tmpImg
->
bytes_per_line
;
XDestroyImage
(
tmpImg
);
tmpImg
=
NULL
;
}
AWT_UNLOCK
();
JNU_CHECK_EXCEPTION_RETURN
(
env
,
JNI_FALSE
);
}
if
(
sizeIsInvalid
||
(
scan
*
height
>
0x7FFFFFFFL
))
{
JNU_ThrowOutOfMemoryError
(
env
,
JNU_ThrowOutOfMemoryError
(
env
,
"Can't create offscreen surface"
);
"Can't create offscreen surface"
);
return
JNI_FALSE
;
return
JNI_FALSE
;
...
@@ -457,7 +480,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
...
@@ -457,7 +480,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
xsdo
->
pmHeight
=
height
;
xsdo
->
pmHeight
=
height
;
#ifdef MITSHM
#ifdef MITSHM
xsdo
->
shmPMData
.
pmSize
=
width
*
height
*
depth
;
xsdo
->
shmPMData
.
pmSize
=
(
jlong
)
width
*
height
*
depth
;
xsdo
->
shmPMData
.
pixelsReadThreshold
=
width
*
height
/
8
;
xsdo
->
shmPMData
.
pixelsReadThreshold
=
width
*
height
/
8
;
if
(
forceSharedPixmaps
)
{
if
(
forceSharedPixmaps
)
{
AWT_LOCK
();
AWT_LOCK
();
...
@@ -560,7 +583,7 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
...
@@ -560,7 +583,7 @@ XImage* X11SD_CreateSharedImage(X11SDOps *xsdo,
return
NULL
;
return
NULL
;
}
}
shminfo
->
shmid
=
shminfo
->
shmid
=
shmget
(
IPC_PRIVATE
,
height
*
img
->
bytes_per_line
,
shmget
(
IPC_PRIVATE
,
(
size_t
)
height
*
img
->
bytes_per_line
,
IPC_CREAT
|
mitShmPermissionMask
);
IPC_CREAT
|
mitShmPermissionMask
);
if
(
shminfo
->
shmid
<
0
)
{
if
(
shminfo
->
shmid
<
0
)
{
J2dRlsTraceLn1
(
J2D_TRACE_ERROR
,
J2dRlsTraceLn1
(
J2D_TRACE_ERROR
,
...
@@ -622,7 +645,7 @@ XImage* X11SD_GetSharedImage(X11SDOps *xsdo, jint width, jint height,
...
@@ -622,7 +645,7 @@ XImage* X11SD_GetSharedImage(X11SDOps *xsdo, jint width, jint height,
XSync
(
awt_display
,
False
);
XSync
(
awt_display
,
False
);
retImage
=
cachedXImage
;
retImage
=
cachedXImage
;
cachedXImage
=
(
XImage
*
)
NULL
;
cachedXImage
=
(
XImage
*
)
NULL
;
}
else
if
(
width
*
height
*
xsdo
->
depth
>
0x10000
)
{
}
else
if
(
(
jlong
)
width
*
height
*
xsdo
->
depth
>
0x10000
)
{
retImage
=
X11SD_CreateSharedImage
(
xsdo
,
width
,
height
);
retImage
=
X11SD_CreateSharedImage
(
xsdo
,
width
,
height
);
}
}
return
retImage
;
return
retImage
;
...
@@ -978,7 +1001,7 @@ static void X11SD_GetRasInfo(JNIEnv *env,
...
@@ -978,7 +1001,7 @@ static void X11SD_GetRasInfo(JNIEnv *env,
int
scan
=
xpriv
->
img
->
bytes_per_line
;
int
scan
=
xpriv
->
img
->
bytes_per_line
;
xpriv
->
x
=
x
;
xpriv
->
x
=
x
;
xpriv
->
y
=
y
;
xpriv
->
y
=
y
;
pRasInfo
->
rasBase
=
xpriv
->
img
->
data
-
x
*
mult
-
y
*
scan
;
pRasInfo
->
rasBase
=
xpriv
->
img
->
data
-
x
*
mult
-
(
intptr_t
)
y
*
scan
;
pRasInfo
->
pixelStride
=
mult
;
pRasInfo
->
pixelStride
=
mult
;
pRasInfo
->
pixelBitOffset
=
0
;
pRasInfo
->
pixelBitOffset
=
0
;
pRasInfo
->
scanStride
=
scan
;
pRasInfo
->
scanStride
=
scan
;
...
@@ -1140,8 +1163,8 @@ X11SD_FindClip(SurfaceDataBounds *b, SurfaceDataBounds *bounds, X11SDOps *xsdo)
...
@@ -1140,8 +1163,8 @@ X11SD_FindClip(SurfaceDataBounds *b, SurfaceDataBounds *bounds, X11SDOps *xsdo)
static
void
static
void
X11SD_SwapBytes
(
X11SDOps
*
xsdo
,
XImage
*
img
,
int
depth
,
int
bpp
)
{
X11SD_SwapBytes
(
X11SDOps
*
xsdo
,
XImage
*
img
,
int
depth
,
int
bpp
)
{
int
lengthInBytes
=
img
->
height
*
img
->
bytes_per_line
;
jlong
lengthInBytes
=
(
jlong
)
img
->
height
*
img
->
bytes_per_line
;
int
i
;
jlong
i
;
switch
(
depth
)
{
switch
(
depth
)
{
case
12
:
case
12
:
...
@@ -1214,7 +1237,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1214,7 +1237,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
Drawable
drawable
;
Drawable
drawable
;
int
depth
=
xsdo
->
depth
;
int
depth
=
xsdo
->
depth
;
int
mult
=
xsdo
->
configData
->
pixelStride
;
int
mult
=
xsdo
->
configData
->
pixelStride
;
int
pad
=
(
mult
==
3
)
?
32
:
mult
*
8
;
// pad must be 8, 16, or 32
int
pad
=
X11SD_GetBitmapPad
(
mult
);
jboolean
readBits
=
lockFlags
&
SD_LOCK_NEED_PIXELS
;
jboolean
readBits
=
lockFlags
&
SD_LOCK_NEED_PIXELS
;
x
=
bounds
->
x1
;
x
=
bounds
->
x1
;
...
@@ -1280,7 +1303,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1280,7 +1303,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
}
}
scan
=
img
->
bytes_per_line
;
scan
=
img
->
bytes_per_line
;
img
->
data
=
malloc
(
h
*
scan
);
img
->
data
=
malloc
(
(
size_t
)
h
*
scan
);
if
(
img
->
data
==
NULL
)
{
if
(
img
->
data
==
NULL
)
{
XFree
(
img
);
XFree
(
img
);
return
NULL
;
return
NULL
;
...
@@ -1315,7 +1338,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1315,7 +1338,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
int
i
;
int
i
;
img_addr
=
img
->
data
+
img_addr
=
img
->
data
+
(
temp
.
y1
-
y
)
*
scan
+
(
temp
.
x1
-
x
)
*
mult
;
(
intptr_t
)
(
temp
.
y1
-
y
)
*
scan
+
(
temp
.
x1
-
x
)
*
mult
;
temp_scan
=
temp_image
->
bytes_per_line
;
temp_scan
=
temp_image
->
bytes_per_line
;
temp_addr
=
temp_image
->
data
;
temp_addr
=
temp_image
->
data
;
bytes_to_copy
=
(
temp
.
x2
-
temp
.
x1
)
*
mult
;
bytes_to_copy
=
(
temp
.
x2
-
temp
.
x1
)
*
mult
;
...
@@ -1349,7 +1372,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
...
@@ -1349,7 +1372,7 @@ static XImage * X11SD_GetImage(JNIEnv *env, X11SDOps *xsdo,
return
NULL
;
return
NULL
;
}
}
img
->
data
=
malloc
(
h
*
img
->
bytes_per_line
);
img
->
data
=
malloc
(
(
size_t
)
h
*
img
->
bytes_per_line
);
if
(
img
->
data
==
NULL
)
{
if
(
img
->
data
==
NULL
)
{
XFree
(
img
);
XFree
(
img
);
return
NULL
;
return
NULL
;
...
@@ -1532,6 +1555,11 @@ X11SD_ReleasePixmapWithBg(JNIEnv *env, X11SDOps *xsdo)
...
@@ -1532,6 +1555,11 @@ X11SD_ReleasePixmapWithBg(JNIEnv *env, X11SDOps *xsdo)
#endif
/* MITSHM */
#endif
/* MITSHM */
}
}
static
int
X11SD_GetBitmapPad
(
int
pixelStride
)
{
// pad must be 8, 16, or 32
return
(
pixelStride
==
3
)
?
32
:
pixelStride
*
8
;
}
#endif
/* !HEADLESS */
#endif
/* !HEADLESS */
/*
/*
...
...
src/solaris/native/sun/java2d/x11/X11SurfaceData.h
浏览文件 @
ce00db43
...
@@ -81,7 +81,7 @@ typedef struct {
...
@@ -81,7 +81,7 @@ typedef struct {
XShmSegmentInfo
*
shmSegInfo
;
/* Shared Memory Segment Info */
XShmSegmentInfo
*
shmSegInfo
;
/* Shared Memory Segment Info */
jint
bytesPerLine
;
/* needed for ShMem lock */
jint
bytesPerLine
;
/* needed for ShMem lock */
jboolean
xRequestSent
;
/* true if x request is sent w/o XSync */
jboolean
xRequestSent
;
/* true if x request is sent w/o XSync */
j
int
pmSize
;
j
long
pmSize
;
jboolean
usingShmPixmap
;
jboolean
usingShmPixmap
;
Drawable
pixmap
;
Drawable
pixmap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录