OpenCanopy: Delay drawing based on draw requests

This commit is contained in:
Marvin Häuser 2021-03-06 22:41:31 +01:00
parent 7bb41aa2fd
commit addabab242
3 changed files with 28 additions and 25 deletions

View File

@ -290,7 +290,7 @@ GuiDrawToBufferFill (
ASSERT (Width > 0);
ASSERT (Height > 0);
//
// Screen cropping happens in GuiDrawScreen().
// Screen cropping happens in GuiRequestDrawCrop().
//
ASSERT (DrawContext->Screen->Width >= PosX);
ASSERT (DrawContext->Screen->Height >= PosY);
@ -387,7 +387,7 @@ GuiDrawToBuffer (
PosX = (UINT32) (BaseX + OffsetX);
PosY = (UINT32) (BaseY + OffsetY);
//
// Screen cropping happens in GuiDrawScreen().
// Screen cropping happens in GuiRequestDrawCrop().
//
ASSERT (DrawContext->Screen->Width >= PosX);
ASSERT (DrawContext->Screen->Height >= PosY);
@ -559,7 +559,7 @@ GuiRequestDraw (
}
VOID
GuiDrawScreen (
GuiRequestDrawCrop (
IN OUT GUI_DRAWING_CONTEXT *DrawContext,
IN INT64 X,
IN INT64 Y,
@ -606,20 +606,6 @@ GuiDrawScreen (
return;
}
ASSERT (DrawContext->Screen->OffsetX == 0);
ASSERT (DrawContext->Screen->OffsetY == 0);
ASSERT (DrawContext->Screen->Draw != NULL);
DrawContext->Screen->Draw (
DrawContext->Screen,
DrawContext,
DrawContext->GuiContext,
0,
0,
PosX,
PosY,
(UINT32) EffWidth,
(UINT32) EffHeight
);
GuiRequestDraw (PosX, PosY, (UINT32) EffWidth, (UINT32) EffHeight);
}
@ -634,7 +620,7 @@ GuiRedrawObject (
ASSERT (This != NULL);
ASSERT (DrawContext != NULL);
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
BaseX,
BaseY,
@ -760,6 +746,23 @@ GuiFlushScreen (
if (mPointerContext != NULL) {
GuiRedrawPointer (DrawContext);
}
ASSERT (DrawContext->Screen->OffsetX == 0);
ASSERT (DrawContext->Screen->OffsetY == 0);
ASSERT (DrawContext->Screen->Draw != NULL);
for (Index = 0; Index < mNumValidDrawReqs; ++Index) {
DrawContext->Screen->Draw (
DrawContext->Screen,
DrawContext,
DrawContext->GuiContext,
0,
0,
mDrawRequests[Index].X,
mDrawRequests[Index].Y,
mDrawRequests[Index].Width,
mDrawRequests[Index].Height
);
}
//
// Raise the TPL to not interrupt timing or flushing.
//
@ -810,7 +813,7 @@ GuiRedrawAndFlushScreen (
mStartTsc = AsmReadTsc ();
GuiRedrawObject (DrawContext->Screen, DrawContext, 0, 0);
GuiRequestDraw (0, 0, DrawContext->Screen->Width, DrawContext->Screen->Height);
GuiFlushScreen (DrawContext);
}
@ -1036,7 +1039,7 @@ GuiDrawLoop (
// Restore the rectangle previously covered by the cursor.
// The new cursor is drawn right before flushing the screen.
//
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
mCursorOldX,
mCursorOldY,

View File

@ -218,7 +218,7 @@ GuiDrawToBufferFill (
);
VOID
GuiDrawScreen (
GuiRequestDrawCrop (
IN OUT GUI_DRAWING_CONTEXT *DrawContext,
IN INT64 X,
IN INT64 Y,

View File

@ -345,7 +345,7 @@ InternalBootPickerScroll (
ASSERT (ScrollY + mBootPickerRightScroll.Hdr.Obj.Height <= BaseY + This->Hdr.Obj.Height);
DEBUG_CODE_END ();
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
0,
BaseY,
@ -388,7 +388,7 @@ InternalBootPickerChangeEntry (
// Picker object. For this, the height just reach from the top of the entries
// to the bottom of the selector.
//
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
BaseX + NewEntry->Hdr.Obj.OffsetX,
BaseY + NewEntry->Hdr.Obj.OffsetY,
@ -396,7 +396,7 @@ InternalBootPickerChangeEntry (
This->Hdr.Obj.Height
);
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
BaseX + PrevEntry->Hdr.Obj.OffsetX,
BaseY + PrevEntry->Hdr.Obj.OffsetY,
@ -1564,7 +1564,7 @@ InternalBootPickerAnimateIntro (
mBootPicker.Hdr.Obj.OffsetX -= DeltaSine;
PrevSine = InterpolVal;
GuiDrawScreen (
GuiRequestDrawCrop (
DrawContext,
mBootPickerContainer.Obj.OffsetX + mBootPicker.Hdr.Obj.OffsetX,
mBootPickerContainer.Obj.OffsetY + mBootPicker.Hdr.Obj.OffsetY,