merge conflicts

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-03-02 22:02:28 +03:00
commit 3b49178480
5 changed files with 28 additions and 29 deletions

View File

@ -1,6 +1 @@
EFI_STATUS
WaitForInputEventPoll (
REFIT_MENU_SCREEN *Screen,
UINTN TimeoutDefault
);

View File

@ -145,7 +145,7 @@ const XArray<TYPE> &XArray<TYPE>::operator =(const XArray<TYPE> &anArray)
xsize ui; xsize ui;
setEmpty(); setEmpty();
for ( ui=0 ; ui<anArray.Length() ; ui+=1 ) AddCopy(anArray.Data() ); for ( ui=0 ; ui<anArray.Length() ; ui+=1 ) Add(anArray[ui] );
return *this; return *this;
} }

View File

@ -5,10 +5,15 @@ This class will replace EG_IMAGE structure and methods
#if !defined(__XIMAGE_H__) #if !defined(__XIMAGE_H__)
#define __XIMAGE_H__ #define __XIMAGE_H__
#include <Platform.h> //#include <Platform.h>
// //
//#include "../cpp_foundation/XToolsCommon.h"
//#include "../cpp_foundation/XArray.h" extern "C" {
#include <Protocol/GraphicsOutput.h>
}
#include "../cpp_foundation/XToolsCommon.h"
#include "../cpp_foundation/XArray.h"
#include "../libeg/libeg.h"
//#include "lodepng.h" //#include "lodepng.h"
// //
//#include "nanosvg.h" //#include "nanosvg.h"
@ -63,6 +68,10 @@ public:
UINTN GetWidth() const; UINTN GetWidth() const;
UINTN GetHeight() const; UINTN GetHeight() const;
void setEmpty() { PixelData.setEmpty(); }
bool isEmpty() const { return PixelData.size() == 0; }
void Fill(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color = { 0, 0, 0, 0 }); void Fill(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color = { 0, 0, 0, 0 });
void FillArea(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color, const EgRect& Rect); void FillArea(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color, const EgRect& Rect);
void CopyScaled(const XImage& Image, float scale); void CopyScaled(const XImage& Image, float scale);

View File

@ -31,25 +31,21 @@ extern "C" {
#define POINTER_HEIGHT 32 #define POINTER_HEIGHT 32
XPointer::XPointer() XPointer::XPointer()
: PointerImage(BuiltinIcon(BUILTIN_ICON_POINTER)),
newImage(POINTER_WIDTH, POINTER_HEIGHT),
oldImage(POINTER_WIDTH, POINTER_HEIGHT)
{ {
PointerImage = new XImage(BuiltinIcon(BUILTIN_ICON_POINTER));
oldImage = new XImage(POINTER_WIDTH, POINTER_HEIGHT);
newImage = new XImage(POINTER_WIDTH, POINTER_HEIGHT);
} }
XPointer::~XPointer() XPointer::~XPointer()
{ {
delete PointerImage;
delete newImage;
delete oldImage;
} }
void XPointer::Hide() void XPointer::Hide()
{ {
if (SimplePointerProtocol) { if (SimplePointerProtocol) {
oldImage->Draw(oldPlace.XPos, oldPlace.YPos, 1.f); oldImage.Draw(oldPlace.XPos, oldPlace.YPos, 1.f);
} }
} }
@ -84,8 +80,7 @@ EFI_STATUS XPointer::MouseBirth()
return Status; return Status;
} }
PointerImage = new XImage(BuiltinIcon(BUILTIN_ICON_POINTER)); if ( PointerImage.isEmpty() ) {
if (!PointerImage) {
//this is impossible after BuiltinIcon //this is impossible after BuiltinIcon
DBG("No pointer image!\n"); DBG("No pointer image!\n");
SimplePointerProtocol = NULL; SimplePointerProtocol = NULL;
@ -110,14 +105,14 @@ VOID XPointer::DrawPointer()
{ {
// take background image // take background image
oldImage->GetArea(newPlace); oldImage.GetArea(newPlace);
CopyMem(&oldPlace, &newPlace, sizeof(EG_RECT)); //can we use oldPlace = newPlace; ? CopyMem(&oldPlace, &newPlace, sizeof(EG_RECT)); //can we use oldPlace = newPlace; ?
// CopyMem(newImage->PixelData, oldImage->PixelData, (UINTN)(POINTER_WIDTH * POINTER_HEIGHT * sizeof(EG_PIXEL))); // CopyMem(newImage->PixelData, oldImage->PixelData, (UINTN)(POINTER_WIDTH * POINTER_HEIGHT * sizeof(EG_PIXEL)));
newImage->CopyScaled(*oldImage, 1.f); newImage.CopyScaled(oldImage, 1.f);
newImage->Compose(0, 0, *PointerImage, true); newImage.Compose(0, 0, PointerImage, true);
newImage->Draw(newPlace.XPos, newPlace.YPos, 1.f); newImage.Draw(newPlace.XPos, newPlace.YPos, 1.f);
} }
VOID XPointer::KillMouse() VOID XPointer::KillMouse()
@ -127,10 +122,10 @@ VOID XPointer::KillMouse()
return; return;
} }
delete newImage; newImage.setEmpty();
delete oldImage; oldImage.setEmpty();
delete PointerImage; // delete PointerImage;
MouseEvent = NoEvents; MouseEvent = NoEvents;
SimplePointerProtocol = NULL; SimplePointerProtocol = NULL;

View File

@ -14,9 +14,9 @@ public:
protected: protected:
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol; EFI_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol;
XImage *PointerImage; XImage PointerImage;
XImage *newImage; XImage newImage;
XImage *oldImage; XImage oldImage;
EG_RECT newPlace; EG_RECT newPlace;
EG_RECT oldPlace; EG_RECT oldPlace;