Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
41949a31
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看板
提交
41949a31
编写于
10月 29, 2012
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7198229: Painting during resizing of the frame should be more smooth
Reviewed-by: anthony, denis, skovatch
上级
914fcc31
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
65 addition
and
35 deletion
+65
-35
src/macosx/classes/sun/lwawt/LWWindowPeer.java
src/macosx/classes/sun/lwawt/LWWindowPeer.java
+11
-18
src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
+5
-7
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+15
-3
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+20
-1
src/macosx/native/sun/awt/AWTView.m
src/macosx/native/sun/awt/AWTView.m
+7
-4
src/macosx/native/sun/java2d/opengl/CGLLayer.m
src/macosx/native/sun/java2d/opengl/CGLLayer.m
+7
-2
未找到文件。
src/macosx/classes/sun/lwawt/LWWindowPeer.java
浏览文件 @
41949a31
...
...
@@ -598,29 +598,21 @@ public class LWWindowPeer
}
/**
* Called by the delegate when any part of the window should be repainted.
* Called by the {@code PlatformWindow} when any part of the window should
* be repainted.
*/
public
void
notifyExpose
(
final
int
x
,
final
int
y
,
final
int
w
,
final
int
h
)
{
// TODO: there's a serious problem with Swing here: it handles
// the exposition internally, so SwingPaintEventDispatcher always
// return null from createPaintEvent(). However, we flush the
// back buffer here unconditionally, so some flickering may appear.
// A possible solution is to split postPaintEvent() into two parts,
// and override that part which is only called after if
// createPaintEvent() returned non-null value and flush the buffer
// from the overridden method
flushOnscreenGraphics
();
repaintPeer
(
new
Rectangle
(
x
,
y
,
w
,
h
));
public
final
void
notifyExpose
(
final
Rectangle
r
)
{
repaintPeer
(
r
);
}
/**
* Called by the
delegate when this window is moved/resized by user.
* There's no notifyReshape() in LWComponentPeer as the only
* Called by the
{@code PlatformWindow} when this window is moved/resized by
*
user.
There's no notifyReshape() in LWComponentPeer as the only
* components which could be resized by user are top-level windows.
*/
public
final
void
notifyReshape
(
int
x
,
int
y
,
int
w
,
int
h
)
{
boolean
moved
=
false
;
boolean
resized
=
false
;
final
boolean
moved
;
final
boolean
resized
;
synchronized
(
getStateLock
())
{
moved
=
(
x
!=
sysX
)
||
(
y
!=
sysY
);
resized
=
(
w
!=
sysW
)
||
(
h
!=
sysH
);
...
...
@@ -644,12 +636,13 @@ public class LWWindowPeer
flushOnscreenGraphics
();
}
// Third, COMPONENT_MOVED/COMPONENT_RESIZED events
// Third, COMPONENT_MOVED/COMPONENT_RESIZED
/PAINT
events
if
(
moved
)
{
handleMove
(
x
,
y
,
true
);
}
if
(
resized
)
{
handleResize
(
w
,
h
,
true
);
handleResize
(
w
,
h
,
true
);
repaintPeer
();
}
}
...
...
src/macosx/classes/sun/lwawt/macosx/CPlatformView.java
浏览文件 @
41949a31
...
...
@@ -26,7 +26,6 @@
package
sun.lwawt.macosx
;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.awt.image.VolatileImage
;
import
sun.awt.CGraphicsConfig
;
...
...
@@ -202,12 +201,11 @@ public class CPlatformView extends CFRetainedResource {
event
.
getCharactersIgnoringModifiers
(),
event
.
getKeyCode
(),
true
);
}
/**
* Called by the native delegate in layer backed view mode or in the simple
* NSView mode. See NSView.drawRect().
*/
private
void
deliverWindowDidExposeEvent
()
{
Rectangle
r
=
peer
.
getBounds
();
peer
.
notifyExpose
(
0
,
0
,
r
.
width
,
r
.
height
);
}
private
void
deliverWindowDidExposeEvent
(
float
x
,
float
y
,
float
w
,
float
h
)
{
peer
.
notifyExpose
((
int
)
x
,
(
int
)
y
,
(
int
)
w
,
(
int
)
h
);
peer
.
notifyExpose
(
peer
.
getSize
());
}
}
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
41949a31
...
...
@@ -46,7 +46,7 @@ import com.apple.laf.*;
import
com.apple.laf.ClientPropertyApplicator.Property
;
import
com.sun.awt.AWTUtilities
;
public
class
CPlatformWindow
extends
CFRetainedResource
implements
PlatformWindow
{
public
final
class
CPlatformWindow
extends
CFRetainedResource
implements
PlatformWindow
{
private
native
long
nativeCreateNSWindow
(
long
nsViewPtr
,
long
styleBits
,
double
x
,
double
y
,
double
w
,
double
h
);
private
static
native
void
nativeSetNSWindowStyleBits
(
long
nsWindowPtr
,
int
mask
,
int
data
);
private
static
native
void
nativeSetNSWindowMenuBar
(
long
nsWindowPtr
,
long
menuBarPtr
);
...
...
@@ -199,7 +199,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// In order to keep it up-to-date we will update them on
// 1) setting native bounds via nativeSetBounds() call
// 2) getting notification from the native level via deliverMoveResizeEvent()
private
Rectangle
nativeBounds
;
private
Rectangle
nativeBounds
=
new
Rectangle
(
0
,
0
,
0
,
0
)
;
private
volatile
boolean
isFullScreenMode
=
false
;
private
Window
target
;
...
...
@@ -869,6 +869,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
}
}
private
void
flushBuffers
()
{
if
(
isVisible
()
&&
!
nativeBounds
.
isEmpty
())
{
LWCToolkit
.
getLWCToolkit
().
flushPendingEventsOnAppkit
(
target
);
}
}
/*************************************************************
* Callbacks from the AWTWindow and AWTView objc classes.
*************************************************************/
...
...
@@ -886,10 +892,16 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
// move/resize notifications contain a bounds smaller than
// the whole screen and therefore we ignore the native notifications
// and the content view itself creates correct synthetic notifications
if
(
isFullScreenMode
)
return
;
if
(
isFullScreenMode
)
{
return
;
}
final
Rectangle
oldB
=
nativeBounds
;
nativeBounds
=
new
Rectangle
(
x
,
y
,
width
,
height
);
peer
.
notifyReshape
(
x
,
y
,
width
,
height
);
if
(!
oldB
.
getSize
().
equals
(
nativeBounds
.
getSize
())
)
{
flushBuffers
();
}
//TODO validateSurface already called from notifyReshape
validateSurface
();
}
...
...
src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
浏览文件 @
41949a31
...
...
@@ -150,6 +150,10 @@ public final class LWCToolkit extends LWToolkit {
});
}
public
static
LWCToolkit
getLWCToolkit
()
{
return
(
LWCToolkit
)
Toolkit
.
getDefaultToolkit
();
}
@Override
protected
PlatformWindow
createPlatformWindow
(
PeerType
peerType
)
{
if
(
peerType
==
PeerType
.
EMBEDDEDFRAME
)
{
...
...
@@ -407,7 +411,6 @@ public final class LWCToolkit extends LWToolkit {
return
BUTTONS
;
}
@Override
public
boolean
isTraySupported
()
{
return
true
;
...
...
@@ -489,6 +492,22 @@ public final class LWCToolkit extends LWToolkit {
synchronized
(
ret
)
{
return
ret
[
0
];
}
}
/**
* Just a wrapper for LWCToolkit.invokeAndWait. Posts an empty event to the
* appropriate event queue and waits for it to finish.
*/
public
static
void
flushPendingEventsOnAppkit
(
final
Component
component
)
{
try
{
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
}
},
component
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
// Kicks an event over to the appropriate eventqueue and waits for it to finish
// To avoid deadlocking, we manually run the NSRunLoop while waiting
// Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
...
...
src/macosx/native/sun/awt/AWTView.m
浏览文件 @
41949a31
...
...
@@ -86,11 +86,14 @@ AWT_ASSERT_APPKIT_THREAD;
if
(
windowLayer
!=
nil
)
{
self
.
cglLayer
=
windowLayer
;
//Layer hosting view
[
self
setLayer
:
cglLayer
];
[
self
setWantsLayer
:
YES
];
[
self
.
layer
addSublayer
:
(
CALayer
*
)
cglLayer
];
[
self
setLayerContentsRedrawPolicy
:
NSViewLayerContentsRedrawDuringViewResize
];
[
self
setLayerContentsPlacement
:
NSViewLayerContentsPlacementTopLeft
];
[
self
setAutoresizingMask
:
NSViewHeightSizable
|
NSViewWidthSizable
];
//Layer backed view
//[self.layer addSublayer: (CALayer *)cglLayer];
//[self setLayerContentsRedrawPolicy: NSViewLayerContentsRedrawDuringViewResize];
//[self setLayerContentsPlacement: NSViewLayerContentsPlacementTopLeft];
//[self setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
#ifdef REMOTELAYER
CGLLayer
*
parentLayer
=
(
CGLLayer
*
)
self
.
cglLayer
;
...
...
src/macosx/native/sun/java2d/opengl/CGLLayer.m
浏览文件 @
41949a31
...
...
@@ -57,9 +57,10 @@ AWT_ASSERT_APPKIT_THREAD;
// NOTE: async=YES means that the layer is re-cached periodically
self
.
asynchronous
=
FALSE
;
self
.
autoresizingMask
=
kCALayerWidthSizable
|
kCALayerHeightSizable
;
self
.
contentsGravity
=
kCAGravityTopLeft
;
self
.
needsDisplayOnBoundsChange
=
YES
;
//Layer backed view
//self.needsDisplayOnBoundsChange = YES;
//self.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable;
textureID
=
0
;
// texture will be created by rendering pipe
target
=
0
;
...
...
@@ -109,6 +110,10 @@ AWT_ASSERT_APPKIT_THREAD;
glDisable
(
target
);
}
-
(
BOOL
)
canDrawInCGLContext
:(
CGLContextObj
)
glContext
pixelFormat
:(
CGLPixelFormatObj
)
pixelFormat
forLayerTime
:(
CFTimeInterval
)
timeInterval
displayTime
:(
const
CVTimeStamp
*
)
timeStamp
{
return
textureID
==
0
?
NO
:
YES
;
}
-
(
void
)
drawInCGLContext
:(
CGLContextObj
)
glContext
pixelFormat
:(
CGLPixelFormatObj
)
pixelFormat
forLayerTime
:(
CFTimeInterval
)
timeInterval
displayTime
:(
const
CVTimeStamp
*
)
timeStamp
{
AWT_ASSERT_APPKIT_THREAD
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录