提交 6f3329a2 编写于 作者: M Marvin Häuser

OpenCanopy: Merge the intro animations

上级 28eb1cc6
......@@ -1466,56 +1466,6 @@ InternalBootPickerExitLoop (
STATIC GUI_INTERPOLATION mBpAnimInfoOpacity;
VOID
InitBpAnimOpacity (
IN GUI_INTERPOL_TYPE Type,
IN UINT64 StartTime,
IN UINT64 Duration
)
{
mBpAnimInfoOpacity.Type = Type;
mBpAnimInfoOpacity.StartTime = StartTime;
mBpAnimInfoOpacity.Duration = Duration;
mBpAnimInfoOpacity.StartValue = 0;
mBpAnimInfoOpacity.EndValue = 0xFF;
mBootPickerOpacity = 0;
}
BOOLEAN
InternalBootPickerAnimateOpacity (
IN BOOT_PICKER_GUI_CONTEXT *Context,
IN OUT GUI_DRAWING_CONTEXT *DrawContext,
IN UINT64 CurrentTime
)
{
ASSERT (DrawContext != NULL);
mBootPickerOpacity = (UINT8)GuiGetInterpolatedValue (&mBpAnimInfoOpacity, CurrentTime);
//
// The screen is drawn by the offset animation, which is always called after
// this one. Do not draw here to not cause pointless overhead.
//
// FIXME: Investigate and opt for one of the two.
// 1. Merge the offset and opacity animations into one.
// 2. Add a layer of literal 'draw requests' to merge and process drawing
// requests after all animations and events have been processed.
//
/*GuiDrawScreen (
DrawContext,
mBootPickerContainer.Obj.OffsetX,
mBootPickerContainer.Obj.OffsetY,
DrawContext->Screen->Width,
mBootPickerContainer.Obj.Height
);*/
if (mBootPickerOpacity == mBpAnimInfoOpacity.EndValue) {
return TRUE;
}
return FALSE;
}
STATIC GUI_INTERPOLATION mBpAnimInfoImageList;
VOID
......@@ -1569,15 +1519,21 @@ InternalBootPickerAnimateImageList (
STATIC GUI_INTERPOLATION mBpAnimInfoSinMove;
VOID
InitBpAnimSinMov (
IN GUI_INTERPOL_TYPE Type,
IN UINT64 StartTime,
IN UINT64 Duration
InitBpAnimIntro (
VOID
)
{
mBpAnimInfoSinMove.Type = Type;
mBpAnimInfoSinMove.StartTime = StartTime;
mBpAnimInfoSinMove.Duration = Duration;
mBpAnimInfoOpacity.Type = GuiInterpolTypeSmooth;
mBpAnimInfoOpacity.StartTime = 0;
mBpAnimInfoOpacity.Duration = 25;
mBpAnimInfoOpacity.StartValue = 0;
mBpAnimInfoOpacity.EndValue = 0xFF;
mBootPickerOpacity = 0;
mBpAnimInfoSinMove.Type = GuiInterpolTypeSmooth;
mBpAnimInfoSinMove.StartTime = 0;
mBpAnimInfoSinMove.Duration = 25;
mBpAnimInfoSinMove.StartValue = 0;
mBpAnimInfoSinMove.EndValue = 35;
//
......@@ -1588,7 +1544,7 @@ InitBpAnimSinMov (
}
BOOLEAN
InternalBootPickerAnimateSinMov (
InternalBootPickerAnimateIntro (
IN BOOT_PICKER_GUI_CONTEXT *Context,
IN OUT GUI_DRAWING_CONTEXT *DrawContext,
IN UINT64 CurrentTime
......@@ -1601,6 +1557,8 @@ InternalBootPickerAnimateSinMov (
ASSERT (DrawContext != NULL);
mBootPickerOpacity = (UINT8)GuiGetInterpolatedValue (&mBpAnimInfoOpacity, CurrentTime);
InterpolVal = GuiGetInterpolatedValue (&mBpAnimInfoSinMove, CurrentTime);
DeltaSine = InterpolVal - PrevSine;
mBootPicker.Hdr.Obj.OffsetX -= DeltaSine;
......@@ -1613,12 +1571,9 @@ InternalBootPickerAnimateSinMov (
(UINT32)(mBootPicker.Hdr.Obj.Width + DeltaSine),
mBootPicker.Hdr.Obj.Height
);
if (InterpolVal == mBpAnimInfoSinMove.EndValue) {
return TRUE;
}
return FALSE;
ASSERT (mBpAnimInfoSinMove.Duration == mBpAnimInfoOpacity.Duration);
return CurrentTime - mBpAnimInfoSinMove.StartTime >= mBpAnimInfoSinMove.Duration;
}
EFI_STATUS
......@@ -1709,16 +1664,10 @@ BootPickerViewInitialize (
//
if (!GuiContext->DoneIntroAnimation) {
InitBpAnimOpacity (GuiInterpolTypeSmooth, 0, 25);
STATIC GUI_ANIMATION PickerAnim2;
PickerAnim2.Context = NULL;
PickerAnim2.Animate = InternalBootPickerAnimateOpacity;
InsertHeadList (&DrawContext->Animations, &PickerAnim2.Link);
InitBpAnimSinMov (GuiInterpolTypeSmooth, 0, 25);
InitBpAnimIntro ();
STATIC GUI_ANIMATION PickerAnim;
PickerAnim.Context = NULL;
PickerAnim.Animate = InternalBootPickerAnimateSinMov;
PickerAnim.Animate = InternalBootPickerAnimateIntro;
InsertHeadList (&DrawContext->Animations, &PickerAnim.Link);
GuiContext->DoneIntroAnimation = TRUE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册