Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b4069b63
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看板
提交
b4069b63
编写于
4月 20, 2017
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8169966: Larger AWT menus
Reviewed-by: azvegint, prr, rhalade, mschoene
上级
432e2cb5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
20 deletion
+39
-20
src/windows/native/sun/windows/CmdIDList.cpp
src/windows/native/sun/windows/CmdIDList.cpp
+23
-16
src/windows/native/sun/windows/CmdIDList.h
src/windows/native/sun/windows/CmdIDList.h
+2
-1
src/windows/native/sun/windows/awt_MenuItem.cpp
src/windows/native/sun/windows/awt_MenuItem.cpp
+5
-1
src/windows/native/sun/windows/awt_Toolkit.cpp
src/windows/native/sun/windows/awt_Toolkit.cpp
+6
-1
src/windows/native/sun/windows/awt_Toolkit.h
src/windows/native/sun/windows/awt_Toolkit.h
+3
-1
未找到文件。
src/windows/native/sun/windows/CmdIDList.cpp
浏览文件 @
b4069b63
...
...
@@ -61,29 +61,36 @@ INLINE void AwtCmdIDList::BuildFreeList(UINT first_index)
m_first_free
=
first_index
;
// head of the free list
}
jboolean
AwtCmdIDList
::
isFreeIDAvailable
()
{
CriticalSection
::
Lock
l
(
m_lock
);
if
(
m_first_free
==
-
1
)
{
// out of free ids
if
(
m_capacity
==
ARRAY_MAXIMUM_SIZE
)
{
return
JNI_FALSE
;
}
}
return
JNI_TRUE
;
}
// Assign an id to the object. Recycle the first free entry from the
// head of the free list or allocate more memory for a new free list.
UINT
AwtCmdIDList
::
Add
(
AwtObject
*
obj
)
{
CriticalSection
::
Lock
l
(
m_lock
);
if
(
!
isFreeIDAvailable
())
{
throw
std
::
bad_alloc
();
// fatal error
}
if
(
m_first_free
==
-
1
)
{
// out of free ids
if
(
m_capacity
==
ARRAY_MAXIMUM_SIZE
)
{
// Really bad - out of ids. Since we hardly can have *so*
// many items simultaneously in existence, we have an id
// leak somewhere.
DASSERT
(
FALSE
);
return
0
;
}
else
{
// snarf a bigger arena
UINT
old_capacity
=
m_capacity
;
// will be the first free entry
m_capacity
+=
ARRAY_SIZE_INCREMENT
;
if
(
m_capacity
>
ARRAY_MAXIMUM_SIZE
)
m_capacity
=
ARRAY_MAXIMUM_SIZE
;
m_array
=
(
CmdIDEntry
*
)
SAFE_SIZE_ARRAY_REALLOC
(
safe_Realloc
,
m_array
,
m_capacity
,
sizeof
(
CmdIDEntry
*
));
BuildFreeList
(
old_capacity
);
}
// snarf a bigger arena
UINT
old_capacity
=
m_capacity
;
// will be the first free entry
m_capacity
+=
ARRAY_SIZE_INCREMENT
;
if
(
m_capacity
>
ARRAY_MAXIMUM_SIZE
)
m_capacity
=
ARRAY_MAXIMUM_SIZE
;
m_array
=
(
CmdIDEntry
*
)
SAFE_SIZE_ARRAY_REALLOC
(
safe_Realloc
,
m_array
,
m_capacity
,
sizeof
(
CmdIDEntry
*
));
BuildFreeList
(
old_capacity
);
}
DASSERT
(
m_first_free
!=
-
1
);
...
...
src/windows/native/sun/windows/CmdIDList.h
浏览文件 @
b4069b63
/*
* Copyright (c) 1996,
1999
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996,
2017
, 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
...
...
@@ -38,6 +38,7 @@ public:
UINT
Add
(
AwtObject
*
obj
);
AwtObject
*
Lookup
(
UINT
id
);
void
Remove
(
UINT
id
);
jboolean
isFreeIDAvailable
();
CriticalSection
m_lock
;
...
...
src/windows/native/sun/windows/awt_MenuItem.cpp
浏览文件 @
b4069b63
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
7
, 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
...
...
@@ -217,6 +217,10 @@ AwtMenuItem* AwtMenuItem::Create(jobject peer, jobject menuPeer)
if
(
env
->
EnsureLocalCapacity
(
1
)
<
0
)
{
return
NULL
;
}
if
(
!
AwtToolkit
::
GetInstance
().
isFreeIDAvailable
())
{
return
NULL
;
}
JNI_CHECK_NULL_RETURN_NULL
(
menuPeer
,
"peer"
);
/* target is a java.awt.MenuItem */
...
...
src/windows/native/sun/windows/awt_Toolkit.cpp
浏览文件 @
b4069b63
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
7
, 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
...
...
@@ -1583,6 +1583,11 @@ void AwtToolkit::SyncCall(void (*ftn)(void)) {
}
}
jboolean
AwtToolkit
::
isFreeIDAvailable
()
{
return
m_cmdIDs
->
isFreeIDAvailable
();
}
UINT
AwtToolkit
::
CreateCmdID
(
AwtObject
*
object
)
{
return
m_cmdIDs
->
Add
(
object
);
...
...
src/windows/native/sun/windows/awt_Toolkit.h
浏览文件 @
b4069b63
/*
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
7
, 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
...
...
@@ -317,6 +317,8 @@ public:
BOOL
PreProcessMouseMsg
(
class
AwtComponent
*
p
,
MSG
&
msg
);
BOOL
PreProcessKeyMsg
(
class
AwtComponent
*
p
,
MSG
&
msg
);
/* Checks that an free ID exists. */
jboolean
isFreeIDAvailable
();
/* Create an ID which maps to an AwtObject pointer, such as a menu. */
UINT
CreateCmdID
(
AwtObject
*
object
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录