Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d6ace729
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看板
提交
d6ace729
编写于
10月 23, 2014
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8059941: [D3D] The fix for JDK-8029253 should be ported to d3d pipeline
Reviewed-by: bae, prr
上级
64bf9ff3
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
54 addition
and
8 deletion
+54
-8
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
+53
-7
test/java/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
...va/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
+1
-1
未找到文件。
src/windows/classes/sun/java2d/d3d/D3DBlitLoops.java
浏览文件 @
d6ace729
/*
* Copyright (c) 2007, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -48,7 +48,7 @@ import sun.java2d.pipe.RenderQueue;
import
static
sun
.
java2d
.
pipe
.
BufferedOpCodes
.*;
import
sun.java2d.windows.GDIWindowSurfaceData
;
class
D3DBlitLoops
{
final
class
D3DBlitLoops
{
static
void
register
()
{
Blit
blitIntArgbPreToSurface
=
...
...
@@ -57,7 +57,9 @@ class D3DBlitLoops {
Blit
blitIntArgbPreToTexture
=
new
D3DSwToTextureBlit
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
);
TransformBlit
transformBlitIntArgbPreToSurface
=
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
);
GraphicsPrimitive
[]
primitives
=
{
// prevent D3DSurface -> Screen blits
new
D3DSurfaceToGDIWindowSurfaceBlit
(),
...
...
@@ -123,8 +125,6 @@ class D3DBlitLoops {
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgb
,
D3DSurfaceData
.
ST_INT_ARGB
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntArgbPre
,
D3DSurfaceData
.
ST_INT_ARGB_PRE
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntRgb
,
D3DSurfaceData
.
ST_INT_RGB
),
new
D3DSwToSurfaceTransform
(
SurfaceType
.
IntBgr
,
...
...
@@ -140,6 +140,9 @@ class D3DBlitLoops {
// REMIND: we don't have a native sw loop to back this loop up
// new D3DSwToSurfaceTransform(SurfaceType.ByteIndexedBm,
// D3DSurfaceData.ST_BYTE_INDEXED_BM),
transformBlitIntArgbPreToSurface
,
new
D3DGeneralTransformedBlit
(
transformBlitIntArgbPreToSurface
),
// texture->surface ops
new
D3DTextureToSurfaceBlit
(),
...
...
@@ -712,11 +715,11 @@ class D3DTextureToSurfaceTransform extends TransformBlit {
* This general Blit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->D3DSurface/Texture loop to get the intermediate
* (premultiplied) surface down to D3D.
* (premultiplied) surface down to D3D
using simple blit
.
*/
class
D3DGeneralBlit
extends
Blit
{
private
Blit
performop
;
private
final
Blit
performop
;
private
WeakReference
srcTmp
;
D3DGeneralBlit
(
SurfaceType
dstType
,
...
...
@@ -757,6 +760,49 @@ class D3DGeneralBlit extends Blit {
}
}
/**
* This general TransformedBlit implementation converts any source surface to an
* intermediate IntArgbPre surface, and then uses the more specific
* IntArgbPre->D3DSurface/Texture loop to get the intermediate
* (premultiplied) surface down to D3D using simple transformBlit.
*/
final
class
D3DGeneralTransformedBlit
extends
TransformBlit
{
private
final
TransformBlit
performop
;
private
WeakReference
<
SurfaceData
>
srcTmp
;
D3DGeneralTransformedBlit
(
final
TransformBlit
performop
)
{
super
(
SurfaceType
.
Any
,
CompositeType
.
AnyAlpha
,
D3DSurfaceData
.
D3DSurface
);
this
.
performop
=
performop
;
}
@Override
public
synchronized
void
Transform
(
SurfaceData
src
,
SurfaceData
dst
,
Composite
comp
,
Region
clip
,
AffineTransform
at
,
int
hint
,
int
srcx
,
int
srcy
,
int
dstx
,
int
dsty
,
int
width
,
int
height
){
Blit
convertsrc
=
Blit
.
getFromCache
(
src
.
getSurfaceType
(),
CompositeType
.
SrcNoEa
,
SurfaceType
.
IntArgbPre
);
// use cached intermediate surface, if available
final
SurfaceData
cachedSrc
=
srcTmp
!=
null
?
srcTmp
.
get
()
:
null
;
// convert source to IntArgbPre
src
=
convertFrom
(
convertsrc
,
src
,
srcx
,
srcy
,
width
,
height
,
cachedSrc
,
BufferedImage
.
TYPE_INT_ARGB_PRE
);
// transform IntArgbPre intermediate surface to D3D surface
performop
.
Transform
(
src
,
dst
,
comp
,
clip
,
at
,
hint
,
0
,
0
,
dstx
,
dsty
,
width
,
height
);
if
(
src
!=
cachedSrc
)
{
// cache the intermediate surface
srcTmp
=
new
WeakReference
<>(
src
);
}
}
}
/*
* The following classes prohibit copying D3DSurfaces to the screen
* (the D3D->sysmem->GDI path is known to be very very slow).
...
...
test/java/awt/image/DrawImage/UnmanagedDrawImagePerformance.java
浏览文件 @
d6ace729
...
...
@@ -41,7 +41,7 @@ import static java.awt.image.BufferedImage.*;
/*
* @test
* @bug 8029253
* @bug 8029253
8059941
* @summary Unmanaged images should be drawn fast.
* @author Sergey Bylokhov
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录