Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
dd54493c
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,发现更多精彩内容 >>
提交
dd54493c
编写于
8月 15, 2012
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7172187: [macosx] JAWT native CALayer not positioned over Canvas
Reviewed-by: art, anthony
上级
e962c8a5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
32 deletion
+52
-32
src/macosx/classes/sun/lwawt/LWComponentPeer.java
src/macosx/classes/sun/lwawt/LWComponentPeer.java
+1
-1
src/macosx/classes/sun/lwawt/PlatformComponent.java
src/macosx/classes/sun/lwawt/PlatformComponent.java
+28
-5
src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
+2
-2
src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java
src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java
+19
-21
src/macosx/native/sun/awt/AWTSurfaceLayers.m
src/macosx/native/sun/awt/AWTSurfaceLayers.m
+2
-3
未找到文件。
src/macosx/classes/sun/lwawt/LWComponentPeer.java
浏览文件 @
dd54493c
...
@@ -282,7 +282,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
...
@@ -282,7 +282,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
* Note that we call setVisible() at the end of initialization.
* Note that we call setVisible() at the end of initialization.
*/
*/
public
final
void
initialize
()
{
public
final
void
initialize
()
{
platformComponent
.
initialize
(
target
,
this
,
getPlatformWindow
());
platformComponent
.
initialize
(
getPlatformWindow
());
initializeImpl
();
initializeImpl
();
setVisible
(
target
.
isVisible
());
setVisible
(
target
.
isVisible
());
}
}
...
...
src/macosx/classes/sun/lwawt/PlatformComponent.java
浏览文件 @
dd54493c
...
@@ -23,15 +23,38 @@
...
@@ -23,15 +23,38 @@
* questions.
* questions.
*/
*/
package
sun.lwawt
;
import
java.awt.Componen
t
;
package
sun.lwaw
t
;
/**
* Can be used to store information about native resource related to the
* lightweight component.
*/
public
interface
PlatformComponent
{
public
interface
PlatformComponent
{
public
void
initialize
(
Component
target
,
LWComponentPeer
peer
,
PlatformWindow
platformWindow
);
/**
* Initializes platform component.
*
* @param platformWindow already initialized {@code PlatformWindow}.
*/
void
initialize
(
PlatformWindow
platformWindow
);
public
void
setBounds
(
int
x
,
int
y
,
int
w
,
int
h
);
/**
* Moves and resizes this component. The new location of the top-left corner
* is specified by {@code x} and {@code y}, and the new size is specified by
* {@code w} and {@code h}. The location is specified relative to the {@code
* platformWindow}.
*
* @param x the X location of the component
* @param y the Y location of the component
* @param w the width of the component
* @param h the height of the component
*/
void
setBounds
(
int
x
,
int
y
,
int
w
,
int
h
);
public
void
dispose
();
/**
* Releases all of the native resources used by this {@code
* PlatformComponent}.
*/
void
dispose
();
}
}
src/macosx/classes/sun/lwawt/macosx/CFRetainedResource.java
浏览文件 @
dd54493c
...
@@ -33,8 +33,8 @@ package sun.lwawt.macosx;
...
@@ -33,8 +33,8 @@ package sun.lwawt.macosx;
public
class
CFRetainedResource
{
public
class
CFRetainedResource
{
private
static
native
void
nativeCFRelease
(
final
long
ptr
,
final
boolean
disposeOnAppKitThread
);
private
static
native
void
nativeCFRelease
(
final
long
ptr
,
final
boolean
disposeOnAppKitThread
);
final
boolean
disposeOnAppKitThread
;
private
final
boolean
disposeOnAppKitThread
;
protected
long
ptr
;
protected
volatile
long
ptr
;
/**
/**
* @param ptr CFRetained native object pointer
* @param ptr CFRetained native object pointer
...
...
src/macosx/classes/sun/lwawt/macosx/CPlatformComponent.java
浏览文件 @
dd54493c
...
@@ -23,27 +23,24 @@
...
@@ -23,27 +23,24 @@
* questions.
* questions.
*/
*/
package
sun.lwawt.macosx
;
package
sun.lwawt.macosx
;
import
java.awt.Component
;
import
java.awt.Insets
;
import
java.awt.Insets
;
import
sun.lwawt.PlatformComponent
;
import
sun.lwawt.PlatformComponent
;
import
sun.lwawt.PlatformWindow
;
import
sun.lwawt.PlatformWindow
;
import
sun.lwawt.LWComponentPeer
;
import
sun.lwawt.macosx.CFRetainedResource
;
public
class
CPlatformComponent
extends
CFRetainedResource
implements
PlatformComponent
{
Component
target
;
/**
LWComponentPeer
peer
;
* On OSX {@code CPlatformComponent} stores pointer to the native CAlayer which
PlatformWindow
platformWindow
;
* can be used from JAWT.
*/
final
class
CPlatformComponent
extends
CFRetainedResource
implements
PlatformComponent
{
private
native
long
nativeCreateComponent
(
long
windowLayer
);
private
volatile
PlatformWindow
platformWindow
;
private
native
long
nativeSetBounds
(
long
ptr
,
int
x
,
int
y
,
int
width
,
int
height
);
public
CPlatformComponent
()
{
CPlatformComponent
()
{
super
(
0
,
true
);
super
(
0
,
true
);
}
}
...
@@ -51,27 +48,28 @@ public class CPlatformComponent extends CFRetainedResource implements PlatformCo
...
@@ -51,27 +48,28 @@ public class CPlatformComponent extends CFRetainedResource implements PlatformCo
return
ptr
;
return
ptr
;
}
}
public
void
initialize
(
Component
target
,
LWComponentPeer
peer
,
PlatformWindow
platformWindow
)
{
@Override
this
.
target
=
target
;
public
void
initialize
(
final
PlatformWindow
platformWindow
)
{
this
.
peer
=
peer
;
this
.
platformWindow
=
platformWindow
;
this
.
platformWindow
=
platformWindow
;
setPtr
(
nativeCreateComponent
(
platformWindow
.
getLayerPtr
()));
long
windowLayerPtr
=
platformWindow
.
getLayerPtr
();
setPtr
(
nativeCreateComponent
(
windowLayerPtr
));
}
}
// TODO: visibility, z-order
// TODO: visibility, z-order
@Override
@Override
public
void
setBounds
(
int
x
,
int
y
,
int
width
,
int
height
)
{
public
void
setBounds
(
final
int
x
,
final
int
y
,
final
int
w
,
final
int
h
)
{
// translates values from the coordinate system of the top-level window
// translates values from the coordinate system of the top-level window
// to the coordinate system of the content view
// to the coordinate system of the content view
Insets
insets
=
platformWindow
.
getPeer
().
getInsets
();
final
Insets
insets
=
platformWindow
.
getPeer
().
getInsets
();
nativeSetBounds
(
getPointer
(),
x
-
insets
.
left
,
y
-
insets
.
top
,
w
idth
,
height
);
nativeSetBounds
(
getPointer
(),
x
-
insets
.
left
,
y
-
insets
.
top
,
w
,
h
);
}
}
@Override
@Override
public
void
dispose
()
{
public
void
dispose
()
{
super
.
dispose
();
super
.
dispose
();
}
}
private
native
long
nativeCreateComponent
(
long
windowLayer
);
private
native
void
nativeSetBounds
(
long
ptr
,
int
x
,
int
y
,
int
w
,
int
h
);
}
}
src/macosx/native/sun/awt/AWTSurfaceLayers.m
浏览文件 @
dd54493c
...
@@ -78,11 +78,10 @@
...
@@ -78,11 +78,10 @@
// translates values to the coordinate system of the "root" layer
// translates values to the coordinate system of the "root" layer
CGFloat
newY
=
windowLayer
.
bounds
.
size
.
height
-
rect
.
origin
.
y
-
rect
.
size
.
height
;
CGFloat
newY
=
windowLayer
.
bounds
.
size
.
height
-
rect
.
origin
.
y
-
rect
.
size
.
height
;
CGRect
newRect
=
CGRectMake
(
rect
.
origin
.
x
,
newY
,
rect
.
size
.
width
,
rect
.
size
.
height
);
// REMIND: why do we need to inverse position?
layer
.
frame
=
newRect
;
CGRect
newRect
=
CGRectMake
(
-
rect
.
origin
.
x
,
-
newY
,
rect
.
size
.
width
,
rect
.
size
.
height
);
layer
.
bounds
=
newRect
;
[
AWTSurfaceLayers
repaintLayersRecursively
:
layer
];
[
AWTSurfaceLayers
repaintLayersRecursively
:
layer
];
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录