diff --git a/Platform/OpenCanopy/OpenCanopy.c b/Platform/OpenCanopy/OpenCanopy.c index 246da7b0..b7311ea1 100644 --- a/Platform/OpenCanopy/OpenCanopy.c +++ b/Platform/OpenCanopy/OpenCanopy.c @@ -466,7 +466,6 @@ GuiDrawToBuffer ( } } -STATIC VOID GuiRequestDraw ( IN UINT32 PosX, @@ -604,26 +603,6 @@ GuiRequestDrawCrop ( GuiRequestDraw (PosX, PosY, (UINT32) EffWidth, (UINT32) EffHeight); } -VOID -GuiRedrawObject ( - IN OUT GUI_OBJ *This, - IN OUT GUI_DRAWING_CONTEXT *DrawContext, - IN INT64 BaseX, - IN INT64 BaseY - ) -{ - ASSERT (This != NULL); - ASSERT (DrawContext != NULL); - - GuiRequestDrawCrop ( - DrawContext, - BaseX, - BaseY, - This->Width, - This->Height - ); -} - VOID GuiOverlayPointer ( IN OUT GUI_DRAWING_CONTEXT *DrawContext diff --git a/Platform/OpenCanopy/OpenCanopy.h b/Platform/OpenCanopy/OpenCanopy.h index 19a2fcc2..c83d1860 100644 --- a/Platform/OpenCanopy/OpenCanopy.h +++ b/Platform/OpenCanopy/OpenCanopy.h @@ -217,6 +217,14 @@ GuiDrawToBufferFill ( IN UINT32 Height ); +VOID +GuiRequestDraw ( + IN UINT32 PosX, + IN UINT32 PosY, + IN UINT32 Width, + IN UINT32 Height + ); + VOID GuiRequestDrawCrop ( IN OUT GUI_DRAWING_CONTEXT *DrawContext, @@ -226,14 +234,6 @@ GuiRequestDrawCrop ( IN UINT32 Height ); -VOID -GuiRedrawObject ( - IN OUT GUI_OBJ *Obj, - IN OUT GUI_DRAWING_CONTEXT *DrawContext, - IN INT64 BaseX, - IN INT64 BaseY - ); - VOID GuiViewInitialize ( OUT GUI_DRAWING_CONTEXT *DrawContext, diff --git a/Platform/OpenCanopy/Views/BootPicker.c b/Platform/OpenCanopy/Views/BootPicker.c index 8dce1074..fe43cc12 100644 --- a/Platform/OpenCanopy/Views/BootPicker.c +++ b/Platform/OpenCanopy/Views/BootPicker.c @@ -344,11 +344,15 @@ InternalBootPickerScroll ( ASSERT (ScrollY >= BaseY); ASSERT (ScrollY + mBootPickerRightScroll.Hdr.Obj.Height <= BaseY + This->Hdr.Obj.Height); DEBUG_CODE_END (); + // + // The container is constructed such that it is always fully visible. + // + ASSERT (This->Hdr.Obj.Height <= mBootPickerContainer.Obj.Height); + ASSERT (BaseY + This->Hdr.Obj.Height <= DrawContext->Screen->Height); - GuiRequestDrawCrop ( - DrawContext, + GuiRequestDraw ( 0, - BaseY, + (UINT32) BaseY, DrawContext->Screen->Width, This->Hdr.Obj.Height ); @@ -885,7 +889,14 @@ InternalBootPickerSelectorPtrEvent ( if (Clickable->CurrentImage != ButtonImage) { Clickable->CurrentImage = ButtonImage; - GuiRedrawObject (This, DrawContext, BaseX, BaseY); + // + // The view is constructed such that the selector is always fully visible. + // + ASSERT (BaseX >= 0); + ASSERT (BaseY >= 0); + ASSERT (BaseX + This->Width <= DrawContext->Screen->Width); + ASSERT (BaseY + This->Height <= DrawContext->Screen->Height); + GuiRequestDraw ((UINT32) BaseX, (UINT32) BaseY, This->Width, This->Height); } return This; @@ -983,7 +994,15 @@ InternalBootPickerLeftScrollPtrEvent ( if (Clickable->CurrentImage != ButtonImage) { Clickable->CurrentImage = ButtonImage; - GuiRedrawObject (This, DrawContext, BaseX, BaseY); + // + // The view is constructed such that the scroll buttons are always fully + // visible. + // + ASSERT (BaseX >= 0); + ASSERT (BaseY >= 0); + ASSERT (BaseX + This->Width <= DrawContext->Screen->Width); + ASSERT (BaseY + This->Height <= DrawContext->Screen->Height); + GuiRequestDraw ((UINT32) BaseX, (UINT32) BaseY, This->Width, This->Height); } return This; @@ -1079,7 +1098,15 @@ InternalBootPickerRightScrollPtrEvent ( if (Clickable->CurrentImage != ButtonImage) { Clickable->CurrentImage = ButtonImage; - GuiRedrawObject (This, DrawContext, BaseX, BaseY); + // + // The view is constructed such that the scroll buttons are always fully + // visible. + // + ASSERT (BaseX >= 0); + ASSERT (BaseY >= 0); + ASSERT (BaseX + This->Width <= DrawContext->Screen->Width); + ASSERT (BaseY + This->Height <= DrawContext->Screen->Height); + GuiRequestDraw ((UINT32) BaseX, (UINT32) BaseY, This->Width, This->Height); } return This;