Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
af34e26f
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,发现更多精彩内容 >>
提交
af34e26f
编写于
10月 10, 2013
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8024864: [macosx] Problems with rendering of controls
Reviewed-by: serb, leonidr
上级
0a32b7c7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
23 deletion
+99
-23
src/macosx/classes/sun/lwawt/LWWindowPeer.java
src/macosx/classes/sun/lwawt/LWWindowPeer.java
+15
-23
test/java/awt/Paint/bug8024864.java
test/java/awt/Paint/bug8024864.java
+84
-0
未找到文件。
src/macosx/classes/sun/lwawt/LWWindowPeer.java
浏览文件 @
af34e26f
...
...
@@ -56,15 +56,6 @@ public class LWWindowPeer
private
final
PlatformWindow
platformWindow
;
// Window bounds reported by the native system (as opposed to
// regular bounds inherited from LWComponentPeer which are
// requested by user and may haven't been applied yet because
// of asynchronous requests to the windowing system)
private
int
sysX
;
private
int
sysY
;
private
int
sysW
;
private
int
sysH
;
private
static
final
int
MINIMUM_WIDTH
=
1
;
private
static
final
int
MINIMUM_HEIGHT
=
1
;
...
...
@@ -320,10 +311,18 @@ public class LWWindowPeer
// Don't post ComponentMoved/Resized and Paint events
// until we've got a notification from the delegate
Rectangle
cb
=
constrainBounds
(
x
,
y
,
w
,
h
);
setBounds
(
cb
.
x
,
cb
.
y
,
cb
.
width
,
cb
.
height
,
op
,
false
,
false
);
// Get updated bounds, so we don't have to handle 'op' here manually
Rectangle
r
=
getBounds
();
platformWindow
.
setBounds
(
r
.
x
,
r
.
y
,
r
.
width
,
r
.
height
);
Rectangle
newBounds
=
new
Rectangle
(
getBounds
());
if
((
op
&
(
SET_LOCATION
|
SET_BOUNDS
))
!=
0
)
{
newBounds
.
x
=
cb
.
x
;
newBounds
.
y
=
cb
.
y
;
}
if
((
op
&
(
SET_SIZE
|
SET_BOUNDS
))
!=
0
)
{
newBounds
.
width
=
cb
.
width
;
newBounds
.
height
=
cb
.
height
;
}
// Native system could constraint bounds, so the peer wold be updated in the callback
platformWindow
.
setBounds
(
newBounds
.
x
,
newBounds
.
y
,
newBounds
.
width
,
newBounds
.
height
);
}
public
Rectangle
constrainBounds
(
Rectangle
bounds
)
{
...
...
@@ -614,17 +613,10 @@ public class LWWindowPeer
*/
@Override
public
void
notifyReshape
(
int
x
,
int
y
,
int
w
,
int
h
)
{
final
boolean
moved
;
final
boolean
resized
;
Rectangle
oldBounds
=
getBounds
();
final
boolean
invalid
=
updateInsets
(
platformWindow
.
getInsets
());
synchronized
(
getStateLock
())
{
moved
=
(
x
!=
sysX
)
||
(
y
!=
sysY
);
resized
=
(
w
!=
sysW
)
||
(
h
!=
sysH
);
sysX
=
x
;
sysY
=
y
;
sysW
=
w
;
sysH
=
h
;
}
final
boolean
moved
=
(
x
!=
oldBounds
.
x
)
||
(
y
!=
oldBounds
.
y
);
final
boolean
resized
=
(
w
!=
oldBounds
.
width
)
||
(
h
!=
oldBounds
.
height
);
// Check if anything changed
if
(!
moved
&&
!
resized
&&
!
invalid
)
{
...
...
test/java/awt/Paint/bug8024864.java
0 → 100644
浏览文件 @
af34e26f
/*
* Copyright (c) 2013, 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
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 8024864
* @summary [macosx] Problems with rendering of controls
* @author Petr Pchelko
* @library ../regtesthelpers
* @build Util
* @run main bug8024864
*/
import
javax.swing.*
;
import
java.awt.*
;
import
test.java.awt.regtesthelpers.Util
;
public
class
bug8024864
{
private
static
final
int
REPEATS
=
30
;
private
static
volatile
JFrame
frame
;
private
static
void
showTestUI
()
{
frame
=
new
JFrame
();
frame
.
setBackground
(
Color
.
green
);
JPanel
p
=
new
JPanel
();
p
.
setBackground
(
Color
.
red
);
JLabel
l
=
new
JLabel
(
"Test!"
);
p
.
add
(
l
);
frame
.
add
(
p
);
frame
.
pack
();
frame
.
setLocation
(
100
,
100
);
frame
.
setVisible
(
true
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Robot
r
=
new
Robot
();
for
(
int
i
=
0
;
i
<
REPEATS
;
i
++)
{
try
{
SwingUtilities
.
invokeAndWait
(
bug8024864:
:
showTestUI
);
//Thread.sleep(100);
Util
.
waitTillShown
(
frame
);
Util
.
waitForIdle
(
r
);
Dimension
frameSize
=
frame
.
getSize
();
Point
loc
=
new
Point
(
frameSize
.
width
-
5
,
frameSize
.
height
-
5
);
SwingUtilities
.
convertPointToScreen
(
loc
,
frame
);
Color
c
=
r
.
getPixelColor
(
loc
.
x
,
loc
.
y
);
if
(
c
.
getGreen
()
>
200
)
{
throw
new
RuntimeException
(
"TEST FAILED. Unexpected pixel color "
+
c
);
}
}
finally
{
if
(
frame
!=
null
)
{
frame
.
dispose
();
}
Util
.
waitForIdle
(
r
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录