Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
866f7bd5
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
866f7bd5
编写于
9月 04, 2013
作者:
C
ceisserer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7159455: Nimbus scrollbar rendering glitch with xrender enabled on i945GM
Reviewed-by: prr, bae
上级
39bc336a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
46 addition
and
52 deletion
+46
-52
src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
+46
-52
未找到文件。
src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java
浏览文件 @
866f7bd5
...
...
@@ -225,6 +225,9 @@ class XRPMScaledBlit extends ScaledBlit {
* @author Clemens Eisserer
*/
class
XRPMTransformedBlit
extends
TransformBlit
{
final
Rectangle
compositeBounds
=
new
Rectangle
();
final
double
[]
srcCoords
=
new
double
[
8
];
final
double
[]
dstCoords
=
new
double
[
8
];
public
XRPMTransformedBlit
(
SurfaceType
srcType
,
SurfaceType
dstType
)
{
super
(
srcType
,
CompositeType
.
AnyAlpha
,
dstType
);
...
...
@@ -235,61 +238,68 @@ class XRPMTransformedBlit extends TransformBlit {
* method is functionally equal to: Shape shp =
* xform.createTransformedShape(rect); Rectangle bounds = shp.getBounds();
* but performs significantly better.
* Returns true if the destination shape is parallel to x/y axis
*/
public
Rectangle
getCompositeBounds
(
AffineTransform
tr
,
int
dstx
,
int
dsty
,
int
width
,
int
height
)
{
double
[]
compBounds
=
new
double
[
8
];
compBounds
[
0
]
=
dstx
;
compBounds
[
1
]
=
dsty
;
compBounds
[
2
]
=
dstx
+
width
;
compBounds
[
3
]
=
dsty
;
compBounds
[
4
]
=
dstx
+
width
;
compBounds
[
5
]
=
dsty
+
height
;
compBounds
[
6
]
=
dstx
;
compBounds
[
7
]
=
dsty
+
height
;
tr
.
transform
(
compBounds
,
0
,
compBounds
,
0
,
4
);
double
minX
=
Math
.
min
(
compBounds
[
0
],
Math
.
min
(
compBounds
[
2
],
Math
.
min
(
compBounds
[
4
],
compBounds
[
6
])));
double
minY
=
Math
.
min
(
compBounds
[
1
],
Math
.
min
(
compBounds
[
3
],
Math
.
min
(
compBounds
[
5
],
compBounds
[
7
])));
double
maxX
=
Math
.
max
(
compBounds
[
0
],
Math
.
max
(
compBounds
[
2
],
Math
.
max
(
compBounds
[
4
],
compBounds
[
6
])));
double
maxY
=
Math
.
max
(
compBounds
[
1
],
Math
.
max
(
compBounds
[
3
],
Math
.
max
(
compBounds
[
5
],
compBounds
[
7
])));
minX
=
Math
.
floor
(
minX
);
minY
=
Math
.
floor
(
minY
);
maxX
=
Math
.
ceil
(
maxX
);
maxY
=
Math
.
ceil
(
maxY
);
return
new
Rectangle
((
int
)
minX
,
(
int
)
minY
,
(
int
)
(
maxX
-
minX
),
(
int
)
(
maxY
-
minY
));
protected
boolean
adjustCompositeBounds
(
AffineTransform
tr
,
int
dstx
,
int
dsty
,
int
width
,
int
height
)
{
srcCoords
[
0
]
=
dstx
;
srcCoords
[
1
]
=
dsty
;
srcCoords
[
2
]
=
dstx
+
width
;
srcCoords
[
3
]
=
dsty
;
srcCoords
[
4
]
=
dstx
+
width
;
srcCoords
[
5
]
=
dsty
+
height
;
srcCoords
[
6
]
=
dstx
;
srcCoords
[
7
]
=
dsty
+
height
;
tr
.
transform
(
srcCoords
,
0
,
dstCoords
,
0
,
4
);
double
minX
=
Math
.
min
(
dstCoords
[
0
],
Math
.
min
(
dstCoords
[
2
],
Math
.
min
(
dstCoords
[
4
],
dstCoords
[
6
])));
double
minY
=
Math
.
min
(
dstCoords
[
1
],
Math
.
min
(
dstCoords
[
3
],
Math
.
min
(
dstCoords
[
5
],
dstCoords
[
7
])));
double
maxX
=
Math
.
max
(
dstCoords
[
0
],
Math
.
max
(
dstCoords
[
2
],
Math
.
max
(
dstCoords
[
4
],
dstCoords
[
6
])));
double
maxY
=
Math
.
max
(
dstCoords
[
1
],
Math
.
max
(
dstCoords
[
3
],
Math
.
max
(
dstCoords
[
5
],
dstCoords
[
7
])));
minX
=
Math
.
round
(
minX
);
minY
=
Math
.
round
(
minY
);
maxX
=
Math
.
round
(
maxX
);
maxY
=
Math
.
round
(
maxY
);
compositeBounds
.
x
=
(
int
)
minX
;
compositeBounds
.
y
=
(
int
)
minY
;
compositeBounds
.
width
=
(
int
)
(
maxX
-
minX
);
compositeBounds
.
height
=
(
int
)
(
maxY
-
minY
);
boolean
is0or180
=
(
dstCoords
[
1
]
==
dstCoords
[
3
])
&&
(
dstCoords
[
2
]
==
dstCoords
[
4
]);
boolean
is90or270
=
(
dstCoords
[
0
]
==
dstCoords
[
2
])
&&
(
dstCoords
[
3
]
==
dstCoords
[
5
]);
return
is0or180
||
is90or270
;
}
public
void
Transform
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
AffineTransform
xform
,
int
hint
,
int
srcx
,
int
srcy
,
int
dstx
,
int
dsty
,
int
width
,
int
height
)
{
public
void
Transform
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
AffineTransform
xform
,
int
hint
,
int
srcx
,
int
srcy
,
int
dstx
,
int
dsty
,
int
width
,
int
height
)
{
try
{
SunToolkit
.
awtLock
();
XRSurfaceData
x11sdDst
=
(
XRSurfaceData
)
dst
;
XRSurfaceData
x11sdSrc
=
(
XRSurfaceData
)
src
;
int
filter
=
XRUtils
.
ATransOpToXRQuality
(
hint
);
boolean
isAxisAligned
=
adjustCompositeBounds
(
xform
,
dstx
,
dsty
,
width
,
height
);
XRSurfaceData
x11sdDst
=
(
XRSurfaceData
)
dst
;
x11sdDst
.
validateAsDestination
(
null
,
clip
);
XRSurfaceData
x11sdSrc
=
(
XRSurfaceData
)
src
;
x11sdDst
.
maskBuffer
.
validateCompositeState
(
comp
,
null
,
null
,
null
);
Rectangle
bounds
=
getCompositeBounds
(
xform
,
dstx
,
dsty
,
width
,
height
);
AffineTransform
trx
=
AffineTransform
.
getTranslateInstance
((-
bounds
.
x
),
(-
bounds
.
y
));
AffineTransform
trx
=
AffineTransform
.
getTranslateInstance
(-
compositeBounds
.
x
,
-
compositeBounds
.
y
);
trx
.
concatenate
(
xform
);
AffineTransform
maskTX
=
(
AffineTransform
)
trx
.
clone
();
trx
.
translate
(-
srcx
,
-
srcy
);
try
{
trx
.
invert
();
}
catch
(
NoninvertibleTransformException
ex
)
{
trx
.
setToIdentity
();
System
.
err
.
println
(
"Reseted to identity!"
);
}
boolean
omitMask
=
isMaskOmittable
(
trx
,
comp
,
filter
);
boolean
omitMask
=
(
filter
==
XRUtils
.
FAST
)
||
(
isAxisAligned
&&
((
AlphaComposite
)
comp
).
getAlpha
()
==
1.0f
);
if
(!
omitMask
)
{
XRMaskImage
mask
=
x11sdSrc
.
maskBuffer
.
getMaskImage
();
...
...
@@ -297,33 +307,17 @@ class XRPMTransformedBlit extends TransformBlit {
x11sdSrc
.
validateAsSource
(
trx
,
XRUtils
.
RepeatPad
,
filter
);
int
maskPicture
=
mask
.
prepareBlitMask
(
x11sdDst
,
maskTX
,
width
,
height
);
x11sdDst
.
maskBuffer
.
con
.
renderComposite
(
XRCompositeManager
.
getInstance
(
x11sdSrc
).
getCompRule
(),
x11sdSrc
.
picture
,
maskPicture
,
x11sdDst
.
picture
,
0
,
0
,
0
,
0
,
bounds
.
x
,
bounds
.
y
,
bounds
.
width
,
b
ounds
.
height
);
0
,
0
,
0
,
0
,
compositeBounds
.
x
,
compositeBounds
.
y
,
compositeBounds
.
width
,
compositeB
ounds
.
height
);
}
else
{
int
repeat
=
filter
==
XRUtils
.
FAST
?
XRUtils
.
RepeatNone
:
XRUtils
.
RepeatPad
;
x11sdSrc
.
validateAsSource
(
trx
,
repeat
,
filter
);
x11sdDst
.
maskBuffer
.
compositeBlit
(
x11sdSrc
,
x11sdDst
,
0
,
0
,
bounds
.
x
,
bounds
.
y
,
bounds
.
width
,
b
ounds
.
height
);
x11sdDst
.
maskBuffer
.
compositeBlit
(
x11sdSrc
,
x11sdDst
,
0
,
0
,
compositeBounds
.
x
,
compositeBounds
.
y
,
compositeBounds
.
width
,
compositeB
ounds
.
height
);
}
}
finally
{
SunToolkit
.
awtUnlock
();
}
}
/* TODO: Is mask ever omitable??? ... should be for 90 degree rotation and no shear, but we always need to use RepeatPad */
protected
static
boolean
isMaskOmittable
(
AffineTransform
trx
,
Composite
comp
,
int
filter
)
{
return
(
filter
==
XRUtils
.
FAST
||
trx
.
getTranslateX
()
==
(
int
)
trx
.
getTranslateX
()
/*
* If
* translate
* is
* integer
* only
*/
&&
trx
.
getTranslateY
()
==
(
int
)
trx
.
getTranslateY
()
&&
(
trx
.
getShearX
()
==
0
&&
trx
.
getShearY
()
==
0
// Only
// 90 degree
// rotation
||
trx
.
getShearX
()
==
-
trx
.
getShearY
()))
&&
((
AlphaComposite
)
comp
).
getAlpha
()
==
1.0f
;
// No
// ExtraAlpha!=1
}
}
class
XrSwToPMBlit
extends
Blit
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录