提交 31c82e3b 编写于 作者: M Marvin Häuser

OpenCanopy: Small optimisations

上级 378fb8ab
......@@ -98,11 +98,11 @@ GuiClipChildBounds (
ASSERT (ReqOffset != NULL);
ASSERT (ReqLength != NULL);
if (ChildLength == 0) {
return FALSE;
}
if (ChildOffset >= 0) {
if (ChildLength == 0) {
return FALSE;
}
PosChildOffset = (UINT32)ChildOffset;
} else {
if ((INT64)ChildLength - (-ChildOffset) <= 0) {
......@@ -113,6 +113,8 @@ GuiClipChildBounds (
ChildLength = (UINT32)(ChildLength - (-ChildOffset));
}
ASSERT (ChildLength > 0);
NewOffset = *ReqOffset;
NewLength = *ReqLength;
......@@ -637,6 +639,8 @@ GuiDrawScreen (
{
UINT32 PosX;
UINT32 PosY;
INT64 EffWidth;
INT64 EffHeight;
ASSERT (DrawContext != NULL);
ASSERT (DrawContext->Screen != NULL);
......@@ -665,15 +669,10 @@ GuiDrawScreen (
PosY = 0;
}
if (PosX >= DrawContext->Screen->Width
|| PosY >= DrawContext->Screen->Height) {
return;
}
EffWidth = MIN (Width, (INT64) DrawContext->Screen->Width - PosX);
EffHeight = MIN (Height, (INT64) DrawContext->Screen->Height - PosY);
Width = MIN (Width, DrawContext->Screen->Width - PosX);
Height = MIN (Height, DrawContext->Screen->Height - PosY);
if (Width == 0 || Height == 0) {
if (EffWidth <= 0 || EffHeight <= 0) {
return;
}
......
......@@ -191,8 +191,8 @@ GuiObjDelegatePtrEvent (
BOOLEAN
GuiClipChildBounds (
IN INT64 ObjectOffset,
IN UINT32 ObjectLength,
IN INT64 ChildOffset,
IN UINT32 ChildLength,
IN OUT UINT32 *ReqOffset,
IN OUT UINT32 *ReqLength
);
......
......@@ -773,7 +773,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mBootPickerSelector = {
INITIALIZE_LIST_HEAD_VARIABLE (mBootPickerSelector.Hdr.Obj.Children)
}
},
NULL,
NULL
};
......@@ -1280,7 +1279,6 @@ BootPickerViewInitialize (
NULL
);
mBootPickerSelector.ClickImage = &GuiContext->Icons[ICON_SELECTOR][ICON_TYPE_BASE];
mBootPickerSelector.CurrentImage = &GuiContext->Icons[ICON_SELECTOR][ICON_TYPE_BASE];
mBootPickerSelector.Hdr.Obj.OffsetX = 0;
mBootPickerSelector.Hdr.Obj.OffsetY = 0;
......
......@@ -12,7 +12,6 @@
typedef struct {
GUI_OBJ_CHILD Hdr;
CONST GUI_IMAGE *ClickImage;
CONST GUI_IMAGE *CurrentImage;
} GUI_OBJ_CLICKABLE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册