Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
28eb1cc6
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,发现更多精彩内容 >>
提交
28eb1cc6
编写于
3月 06, 2021
作者:
M
Marvin Häuser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCanopy: Simplify draw requests
上级
71536e6d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
76 deletion
+55
-76
Platform/OpenCanopy/OpenCanopy.c
Platform/OpenCanopy/OpenCanopy.c
+55
-76
未找到文件。
Platform/OpenCanopy/OpenCanopy.c
浏览文件 @
28eb1cc6
...
...
@@ -30,10 +30,10 @@
#include "Views/BootPicker.h"
typedef
struct
{
UINT32
Min
X
;
UINT32
Min
Y
;
UINT32
MaxX
;
UINT32
MaxY
;
UINT32
X
;
UINT32
Y
;
UINT32
Width
;
UINT32
Height
;
}
GUI_DRAW_REQUEST
;
//
...
...
@@ -475,29 +475,24 @@ GuiRequestDraw (
IN
UINT32
Height
)
{
GUI_DRAW_REQUEST
ThisReq
;
UINTN
Index
;
UINT32
ThisArea
;
UINT32
ReqWidth
;
UINT32
ReqHeight
;
UINT32
ReqArea
;
UINT32
CombMinX
;
UINT32
CombMaxX
;
UINT32
CombMinY
;
UINT32
CombMaxY
;
UINT32
CombWidth
;
UINT32
CombHeight
;
UINT32
CombArea
;
//
// Update the coordinates of the smallest rectangle covering all changes.
//
ThisReq
.
MinX
=
PosX
;
ThisReq
.
MinY
=
PosY
;
ThisReq
.
MaxX
=
PosX
+
Width
-
1
;
ThisReq
.
MaxY
=
PosY
+
Height
-
1
;
UINTN
Index
;
UINT32
ThisArea
;
UINT32
ThisMaxX
;
UINT32
ThisMaxY
;
UINT32
ReqMaxX
;
UINT32
ReqMaxY
;
UINT32
ReqArea
;
UINT32
CombX
;
UINT32
CombY
;
UINT32
CombWidth
;
UINT32
CombHeight
;
UINT32
CombArea
;
ThisMaxX
=
PosX
+
Width
-
1
;
ThisMaxY
=
PosY
+
Height
-
1
;
ThisArea
=
Width
*
Height
;
...
...
@@ -506,37 +501,35 @@ GuiRequestDraw (
// Calculate several dimensions to determine whether to merge the two
// draw requests for improved flushing performance.
//
Req
Width
=
mDrawRequests
[
Index
].
MaxX
-
mDrawRequests
[
Index
].
MinX
+
1
;
Req
Height
=
mDrawRequests
[
Index
].
MaxY
-
mDrawRequests
[
Index
].
MinY
+
1
;
ReqArea
=
ReqWidth
*
Req
Height
;
Req
MaxX
=
mDrawRequests
[
Index
].
X
+
mDrawRequests
[
Index
].
Width
-
1
;
Req
MaxY
=
mDrawRequests
[
Index
].
Y
+
mDrawRequests
[
Index
].
Height
-
1
;
ReqArea
=
mDrawRequests
[
Index
].
Width
*
mDrawRequests
[
Index
].
Height
;
if
(
mDrawRequests
[
Index
].
MinX
<
ThisReq
.
Min
X
)
{
Comb
MinX
=
mDrawRequests
[
Index
].
Min
X
;
if
(
mDrawRequests
[
Index
].
X
<
Pos
X
)
{
Comb
X
=
mDrawRequests
[
Index
].
X
;
}
else
{
Comb
MinX
=
ThisReq
.
Min
X
;
Comb
X
=
Pos
X
;
}
if
(
mDrawRequests
[
Index
].
MaxX
>
ThisReq
.
MaxX
)
{
Comb
MaxX
=
mDrawRequests
[
Index
].
MaxX
;
if
(
ReqMaxX
>
This
MaxX
)
{
Comb
Width
=
ReqMaxX
-
CombX
+
1
;
}
else
{
Comb
MaxX
=
ThisReq
.
MaxX
;
Comb
Width
=
ThisMaxX
-
CombX
+
1
;
}
if
(
mDrawRequests
[
Index
].
MinY
<
ThisReq
.
Min
Y
)
{
Comb
MinY
=
mDrawRequests
[
Index
].
Min
Y
;
if
(
mDrawRequests
[
Index
].
Y
<
Pos
Y
)
{
Comb
Y
=
mDrawRequests
[
Index
].
Y
;
}
else
{
Comb
MinY
=
ThisReq
.
Min
Y
;
Comb
Y
=
Pos
Y
;
}
if
(
mDrawRequests
[
Index
].
MaxY
>
ThisReq
.
MaxY
)
{
Comb
MaxY
=
mDrawRequests
[
Index
].
MaxY
;
if
(
ReqMaxY
>
This
MaxY
)
{
Comb
Height
=
ReqMaxY
-
CombY
+
1
;
}
else
{
Comb
MaxY
=
ThisReq
.
MaxY
;
Comb
Height
=
ThisMaxY
-
CombY
+
1
;
}
CombWidth
=
CombMaxX
-
CombMinX
+
1
;
CombHeight
=
CombMaxY
-
CombMinY
+
1
;
CombArea
=
CombWidth
*
CombHeight
;
CombArea
=
CombWidth
*
CombHeight
;
//
// Two requests are merged when the overarching rectangle is not bigger than
// the two separate rectangles (not accounting for the overlap, as it would
...
...
@@ -545,10 +538,10 @@ GuiRequestDraw (
// TODO: Profile a good constant factor?
//
if
(
ThisArea
+
ReqArea
>=
CombArea
)
{
mDrawRequests
[
Index
].
MinX
=
CombMin
X
;
mDrawRequests
[
Index
].
MaxX
=
CombMaxX
;
mDrawRequests
[
Index
].
MinY
=
CombMinY
;
mDrawRequests
[
Index
].
MaxY
=
CombMaxY
;
mDrawRequests
[
Index
].
X
=
Comb
X
;
mDrawRequests
[
Index
].
Y
=
CombY
;
mDrawRequests
[
Index
].
Width
=
CombWidth
;
mDrawRequests
[
Index
].
Height
=
CombHeight
;
return
;
}
}
...
...
@@ -558,7 +551,10 @@ GuiRequestDraw (
return
;
}
CopyMem
(
&
mDrawRequests
[
mNumValidDrawReqs
],
&
ThisReq
,
sizeof
(
ThisReq
));
mDrawRequests
[
mNumValidDrawReqs
].
X
=
PosX
;
mDrawRequests
[
mNumValidDrawReqs
].
Y
=
PosY
;
mDrawRequests
[
mNumValidDrawReqs
].
Width
=
Width
;
mDrawRequests
[
mNumValidDrawReqs
].
Height
=
Height
;
++
mNumValidDrawReqs
;
}
...
...
@@ -751,7 +747,6 @@ GuiFlushScreen (
{
EFI_TPL
OldTpl
;
UINTN
NumValidDrawReqs
;
UINTN
Index
;
UINT64
EndTsc
;
...
...
@@ -765,21 +760,6 @@ GuiFlushScreen (
if
(
mPointerContext
!=
NULL
)
{
GuiRedrawPointer
(
DrawContext
);
}
NumValidDrawReqs
=
mNumValidDrawReqs
;
ASSERT
(
NumValidDrawReqs
<=
ARRAY_SIZE
(
mDrawRequests
));
mNumValidDrawReqs
=
0
;
for
(
Index
=
0
;
Index
<
NumValidDrawReqs
;
++
Index
)
{
ASSERT
(
mDrawRequests
[
Index
].
MaxX
>=
mDrawRequests
[
Index
].
MinX
);
ASSERT
(
mDrawRequests
[
Index
].
MaxY
>=
mDrawRequests
[
Index
].
MinY
);
//
// Set MaxX/Y to Width and Height as the requests are invalidated anyway.
//
mDrawRequests
[
Index
].
MaxX
-=
mDrawRequests
[
Index
].
MinX
-
1
;
mDrawRequests
[
Index
].
MaxY
-=
mDrawRequests
[
Index
].
MinY
-
1
;
}
//
// Raise the TPL to not interrupt timing or flushing.
//
...
...
@@ -792,20 +772,17 @@ GuiFlushScreen (
EndTsc
=
InternalCpuDelayTsc
(
mDeltaTscTarget
-
DeltaTsc
);
}
for
(
Index
=
0
;
Index
<
NumValidDrawReqs
;
++
Index
)
{
//
// Due to above's loop, MaxX/Y correspond to Width and Height here.
//
for
(
Index
=
0
;
Index
<
mNumValidDrawReqs
;
++
Index
)
{
GuiOutputBlt
(
mOutputContext
,
mScreenBuffer
,
EfiBltBufferToVideo
,
mDrawRequests
[
Index
].
Min
X
,
mDrawRequests
[
Index
].
Min
Y
,
mDrawRequests
[
Index
].
Min
X
,
mDrawRequests
[
Index
].
Min
Y
,
mDrawRequests
[
Index
].
MaxX
,
mDrawRequests
[
Index
].
MaxY
,
mDrawRequests
[
Index
].
X
,
mDrawRequests
[
Index
].
Y
,
mDrawRequests
[
Index
].
X
,
mDrawRequests
[
Index
].
Y
,
mDrawRequests
[
Index
].
Width
,
mDrawRequests
[
Index
].
Height
,
mScreenBufferDelta
);
}
...
...
@@ -814,6 +791,8 @@ GuiFlushScreen (
EnableInterrupts
();
}
gBS
->
RestoreTPL
(
OldTpl
);
mNumValidDrawReqs
=
0
;
//
// Explicitly include BLT time in the timing calculation.
// FIXME: GOP takes inconsistently long depending on dimensions.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录