Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
126cbf6a
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
126cbf6a
编写于
1月 06, 2021
作者:
M
Marvin Häuser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCanopy: Fix inconsistent initialisation issues
上级
a377110d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
50 deletion
+69
-50
Platform/OpenCanopy/GuiApp.c
Platform/OpenCanopy/GuiApp.c
+69
-50
未找到文件。
Platform/OpenCanopy/GuiApp.c
浏览文件 @
126cbf6a
...
...
@@ -180,7 +180,17 @@ LoadImageFileFromStorage (
Icon
,
Status
));
return
Index
==
ICON_TYPE_BASE
?
EFI_NOT_FOUND
:
EFI_SUCCESS
;
if
(
Index
==
ICON_TYPE_BASE
)
{
STATIC_ASSERT
(
ICON_TYPE_BASE
==
0
,
"Memory may be leaked due to previously loaded images."
);
return
EFI_NOT_FOUND
;
}
Images
[
Index
].
Width
=
0
;
Images
[
Index
].
Height
=
0
;
Images
[
Index
].
Buffer
=
NULL
;
}
}
...
...
@@ -276,9 +286,11 @@ InternalContextConstruct (
UINT32
FontDataSize
;
UINTN
UiScaleSize
;
UINT32
Index
;
UINT32
ImageDimension
;
UINT32
ImageWidth
;
UINT32
ImageHeight
;
CONST
CHAR8
*
Prefix
;
BOOLEAN
Result
;
BOOLEAN
AllowLessSize
;
ASSERT
(
Context
!=
NULL
);
...
...
@@ -355,19 +367,25 @@ InternalContextConstruct (
+
Context
->
BackgroundColor
.
Pixel
.
Blue
*
114U
)
>=
186000
;
}
Status
=
EFI_SUCCESS
;
for
(
Index
=
0
;
Index
<
ICON_NUM_TOTAL
;
++
Index
)
{
AllowLessSize
=
FALSE
;
if
(
Index
==
ICON_CURSOR
)
{
ImageDimension
=
MAX_CURSOR_DIMENSION
;
ImageWidth
=
MAX_CURSOR_DIMENSION
;
ImageHeight
=
MAX_CURSOR_DIMENSION
;
AllowLessSize
=
TRUE
;
}
else
if
(
Index
==
ICON_SELECTED
)
{
ImageDimension
=
BOOT_SELECTOR_BACKGROUND_DIMENSION
;
ImageWidth
=
BOOT_SELECTOR_BACKGROUND_DIMENSION
;
ImageHeight
=
BOOT_SELECTOR_BACKGROUND_DIMENSION
;
}
else
if
(
Index
==
ICON_SELECTOR
)
{
ImageDimension
=
BOOT_SELECTOR_BUTTON_DIMENSION
;
ImageWidth
=
BOOT_SELECTOR_BUTTON_WIDTH
;
ImageHeight
=
BOOT_SELECTOR_BUTTON_HEIGHT
;
AllowLessSize
=
TRUE
;
}
else
if
(
Index
==
ICON_LEFT
||
Index
==
ICON_RIGHT
)
{
ImageDimension
=
BOOT_SCROLL_BUTTON_DIMENSION
;
ImageWidth
=
BOOT_SCROLL_BUTTON_DIMENSION
;
ImageHeight
=
BOOT_SCROLL_BUTTON_DIMENSION
;
}
else
{
ImageDimension
=
BOOT_ENTRY_ICON_DIMENSION
;
ImageWidth
=
BOOT_ENTRY_ICON_DIMENSION
;
ImageHeight
=
BOOT_ENTRY_ICON_DIMENSION
;
}
Status
=
LoadImageFileFromStorage
(
...
...
@@ -375,59 +393,60 @@ InternalContextConstruct (
Storage
,
mIconNames
[
Index
],
Context
->
Scale
,
Image
Dimension
,
Image
Dimension
,
Image
Width
,
Image
Height
,
Index
>=
ICON_NUM_SYS
,
Prefix
,
Index
==
ICON_CURSOR
AllowLessSize
);
if
(
!
EFI_ERROR
(
Status
)
&&
(
Index
==
ICON_SELECTOR
||
Index
==
ICON_LEFT
||
Index
==
ICON_RIGHT
))
{
Status
=
GuiCreateHighlightedImage
(
&
Context
->
Icons
[
Index
][
ICON_TYPE_HELD
],
&
Context
->
Icons
[
Index
][
ICON_TYPE_BASE
],
&
mHighlightPixel
);
}
//
// For generic disk icon being able to distinguish internal and external
// disk icons is a security requirement. These icons are used whenever
// 'typed' external icons are not available.
//
if
(
!
EFI_ERROR
(
Status
)
&&
Index
==
ICON_GENERIC_HDD
&&
Context
->
Icons
[
Index
][
ICON_TYPE_EXTERNAL
].
Buffer
==
NULL
)
{
Status
=
EFI_NOT_FOUND
;
DEBUG
((
DEBUG_WARN
,
"OCUI: Missing external disk icon
\n
"
));
break
;
if
(
!
EFI_ERROR
(
Status
))
{
if
(
Index
==
ICON_SELECTOR
||
Index
==
ICON_LEFT
||
Index
==
ICON_RIGHT
)
{
Status
=
GuiCreateHighlightedImage
(
&
Context
->
Icons
[
Index
][
ICON_TYPE_HELD
],
&
Context
->
Icons
[
Index
][
ICON_TYPE_BASE
],
&
mHighlightPixel
);
}
else
if
(
Index
==
ICON_GENERIC_HDD
&&
Context
->
Icons
[
Index
][
ICON_TYPE_EXTERNAL
].
Buffer
==
NULL
)
{
//
// For generic disk icon being able to distinguish internal and external
// disk icons is a security requirement. These icons are used whenever
// 'typed' external icons are not available.
//
Status
=
EFI_NOT_FOUND
;
DEBUG
((
DEBUG_WARN
,
"OCUI: Missing external disk icon
\n
"
));
STATIC_ASSERT
(
ICON_GENERIC_HDD
<
ICON_NUM_MANDATORY
,
"The base icon should must be cleaned up explicitly."
);
}
}
else
{
ZeroMem
(
&
Context
->
Icons
[
Index
],
sizeof
(
Context
->
Icons
[
Index
]));
}
if
(
EFI_ERROR
(
Status
)
&&
Index
<
ICON_NUM_MANDATORY
)
{
break
;
DEBUG
((
DEBUG_WARN
,
"OCUI: Failed to load images
\n
"
));
InternalContextDestruct
(
Context
);
return
EFI_UNSUPPORTED
;
}
Status
=
EFI_SUCCESS
;
}
if
(
!
EFI_ERROR
(
Status
))
{
for
(
Index
=
0
;
Index
<
LABEL_NUM_TOTAL
;
++
Index
)
{
Status
|=
LoadLabelFromStorage
(
Storage
,
mLabelNames
[
Index
],
Context
->
Scale
,
Context
->
LightBackground
,
&
Context
->
Labels
[
Index
]
);
for
(
Index
=
0
;
Index
<
LABEL_NUM_TOTAL
;
++
Index
)
{
Status
=
LoadLabelFromStorage
(
Storage
,
mLabelNames
[
Index
],
Context
->
Scale
,
Context
->
LightBackground
,
&
Context
->
Labels
[
Index
]
);
if
(
EFI_ERROR
(
Status
))
{
Context
->
Labels
[
Index
].
Buffer
=
NULL
;
DEBUG
((
DEBUG_WARN
,
"OCUI: Failed to load images
\n
"
));
InternalContextDestruct
(
Context
);
return
EFI_UNSUPPORTED
;
}
}
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OCUI: Failed to load images
\n
"
));
InternalContextDestruct
(
Context
);
return
EFI_UNSUPPORTED
;
}
if
(
Context
->
Scale
==
2
)
{
FontImage
=
OcStorageReadFileUnicode
(
Storage
,
OPEN_CORE_FONT_PATH
L"Font_2x.png"
,
&
FontImageSize
);
FontData
=
OcStorageReadFileUnicode
(
Storage
,
OPEN_CORE_FONT_PATH
L"Font_2x.bin"
,
&
FontDataSize
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录