Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
37a41245
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看板
提交
37a41245
编写于
2月 06, 2009
作者:
B
bae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6800846: REGRESSION: Printing quality degraded with Java 6 compared to 5.0
Reviewed-by: igor, prr
上级
39e40cb8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
81 addition
and
5 deletion
+81
-5
src/share/native/sun/awt/image/dither.c
src/share/native/sun/awt/image/dither.c
+6
-5
test/sun/awt/image/DrawByteBinary.java
test/sun/awt/image/DrawByteBinary.java
+75
-0
未找到文件。
src/share/native/sun/awt/image/dither.c
浏览文件 @
37a41245
...
...
@@ -169,6 +169,7 @@ initCubemap(int* cmap,
int
cubesize
=
cube_dim
*
cube_dim
*
cube_dim
;
unsigned
char
*
useFlags
;
unsigned
char
*
newILut
=
(
unsigned
char
*
)
malloc
(
cubesize
);
int
cmap_mid
=
(
cmap_len
>>
1
)
+
(
cmap_len
&
0x1
);
if
(
newILut
)
{
useFlags
=
(
unsigned
char
*
)
calloc
(
cubesize
,
1
);
...
...
@@ -188,7 +189,7 @@ initCubemap(int* cmap,
currentState
.
iLUT
=
newILut
;
currentState
.
rgb
=
(
unsigned
short
*
)
malloc
(
256
*
sizeof
(
unsigned
short
));
malloc
(
cmap_len
*
sizeof
(
unsigned
short
));
if
(
currentState
.
rgb
==
NULL
)
{
free
(
newILut
);
free
(
useFlags
);
...
...
@@ -199,7 +200,7 @@ initCubemap(int* cmap,
}
currentState
.
indices
=
(
unsigned
char
*
)
malloc
(
256
*
sizeof
(
unsigned
char
));
malloc
(
cmap_len
*
sizeof
(
unsigned
char
));
if
(
currentState
.
indices
==
NULL
)
{
free
(
currentState
.
rgb
);
free
(
newILut
);
...
...
@@ -210,18 +211,18 @@ initCubemap(int* cmap,
return
NULL
;
}
for
(
i
=
0
;
i
<
128
;
i
++
)
{
for
(
i
=
0
;
i
<
cmap_mid
;
i
++
)
{
unsigned
short
rgb
;
int
pixel
=
cmap
[
i
];
rgb
=
(
pixel
&
0x00f80000
)
>>
9
;
rgb
|=
(
pixel
&
0x0000f800
)
>>
6
;
rgb
|=
(
pixel
&
0xf8
)
>>
3
;
INSERTNEW
(
currentState
,
rgb
,
i
);
pixel
=
cmap
[
255
-
i
];
pixel
=
cmap
[
cmap_len
-
i
-
1
];
rgb
=
(
pixel
&
0x00f80000
)
>>
9
;
rgb
|=
(
pixel
&
0x0000f800
)
>>
6
;
rgb
|=
(
pixel
&
0xf8
)
>>
3
;
INSERTNEW
(
currentState
,
rgb
,
255
-
i
);
INSERTNEW
(
currentState
,
rgb
,
cmap_len
-
i
-
1
);
}
if
(
!
recurseLevel
(
&
currentState
))
{
...
...
test/sun/awt/image/DrawByteBinary.java
0 → 100644
浏览文件 @
37a41245
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**
* @test
* @bug 6800846
*
* @summary Test verifes that images with short palette are rendered
* withourt artifacts.
*
* @run main DrawByteBinary
*/
import
java.awt.*
;
import
java.awt.color.*
;
import
java.awt.image.*
;
import
static
java
.
awt
.
image
.
BufferedImage
.*;
public
class
DrawByteBinary
{
public
static
void
main
(
String
args
[])
{
int
w
=
100
,
h
=
30
;
int
x
=
10
;
byte
[]
arr
=
{(
byte
)
0xff
,
(
byte
)
0x0
,
(
byte
)
0x00
};
IndexColorModel
newCM
=
new
IndexColorModel
(
1
,
2
,
arr
,
arr
,
arr
);
BufferedImage
orig
=
new
BufferedImage
(
w
,
h
,
TYPE_BYTE_BINARY
,
newCM
);
Graphics2D
g2d
=
orig
.
createGraphics
();
g2d
.
setColor
(
Color
.
white
);
g2d
.
fillRect
(
0
,
0
,
w
,
h
);
g2d
.
setColor
(
Color
.
black
);
g2d
.
drawLine
(
x
,
0
,
x
,
h
);
g2d
.
dispose
();
IndexColorModel
origCM
=
(
IndexColorModel
)
orig
.
getColorModel
();
BufferedImage
test
=
new
BufferedImage
(
w
,
h
,
TYPE_BYTE_BINARY
,
origCM
);
g2d
=
test
.
createGraphics
();
g2d
.
drawImage
(
orig
,
0
,
0
,
null
);
g2d
.
dispose
();
int
y
=
h
/
2
;
// we expect white color outside the line
if
(
test
.
getRGB
(
x
-
1
,
y
)
!=
0xffffffff
)
{
throw
new
RuntimeException
(
"Invalid color outside the line."
);
}
// we expect black color on the line
if
(
test
.
getRGB
(
x
,
y
)
!=
0xff000000
)
{
throw
new
RuntimeException
(
"Invalid color on the line."
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录