Remove SetHWColorKey, SetHWAlpha; Tune prototype of FillHWRect; Add CopyHWSurface()

This commit is contained in:
Vincent Wei
2023-07-23 12:01:18 +08:00
parent 6422cb8568
commit 6a83f2efbf
41 changed files with 83 additions and 2316 deletions
+4 -46
View File
@@ -165,28 +165,6 @@ typedef struct _DrmSurfaceBuffer {
uint8_t* buff;
} DrmSurfaceBuffer;
typedef enum {
BLIT_COPY_NORMAL = 0,
BLIT_COPY_SCALE,
BLIT_COPY_ROT_90,
BLIT_COPY_ROT_180,
BLIT_COPY_ROT_270,
BLIT_COPY_FLIP_H,
BLIT_COPY_FLIP_V,
BLIT_COPY_FLIP_H_V
} BlitCopyOperation;
typedef enum {
BLIT_COLORKEY_NONE = 0,
BLIT_COLORKEY_NORMAL,
BLIT_COLORKEY_INVERTED,
} BlitKeyOperation;
typedef enum {
BLIT_ALPHA_NONE = 0,
BLIT_ALPHA_SET,
} BlitAlphaOperation;
typedef struct _DrmBlitOperations {
BlitCopyOperation cpy;
BlitKeyOperation key;
@@ -335,35 +313,15 @@ typedef struct _DrmDriverOps {
const DrmBlitOperations *ops);
/**
* This operation copies the whole bits from a source buffer to
* a destination buffer.
* This operation copies the pixels from the source buffer to
* the destination buffer, with or without scaling, rotation, and flip.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated copy operation between buffers.
*/
int (* copy_buff) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
/**
* This operation rotates the bits from a source buffer to
* a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated rotation operation between buffers.
*/
int (* rotate_buff) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf,
BlitCopyOperation op);
/**
* This operation flips the bits from a source buffer to
* a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated flip operation between buffers.
*/
int (* flip_buff) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
BlitCopyOperation op);
} DrmDriverOps;
+21
View File
@@ -5162,6 +5162,27 @@ MG_EXPORT BOOL GUIAPI FillBitmapPartInBox (HDC hdc, int box_x, int box_y,
int box_w, int box_h, const BITMAP* pbmp, int bmp_x, int bmp_y,
int bmp_w, int bmp_h);
typedef enum {
BLIT_COPY_TRANSLATE = 0,
BLIT_COPY_ROT_90,
BLIT_COPY_ROT_180,
BLIT_COPY_ROT_270,
BLIT_COPY_FLIP_H,
BLIT_COPY_FLIP_V,
BLIT_COPY_FLIP_H_V
} BlitCopyOperation;
typedef enum {
BLIT_COLORKEY_NONE = 0,
BLIT_COLORKEY_NORMAL,
BLIT_COLORKEY_INVERTED,
} BlitKeyOperation;
typedef enum {
BLIT_ALPHA_NONE = 0,
BLIT_ALPHA_SET,
} BlitAlphaOperation;
/**
* The color blend mothed.
*
-2
View File
@@ -157,8 +157,6 @@ static GAL_VideoDevice *BF533_CreateDevice(int devindex)
device->AllocHWSurface = BF533_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = BF533_FreeHWSurface;
device->UpdateRects = BF533_UpdateRects;
-2
View File
@@ -236,8 +236,6 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->UpdateRects = NULL;
device->SyncUpdate = NULL;
+3 -4
View File
@@ -107,7 +107,7 @@ static int DFB_AllocHWSurface (_THIS, GAL_Surface *surface);
static void DFB_FreeHWSurface (_THIS, GAL_Surface *surface);
static int DFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
static int DFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst);
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
/* common dfb function address */
GAL_FunctionTable mgGALFuncTable = {
@@ -173,8 +173,6 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
device->AllocHWSurface = DFB_AllocHWSurface;
device->CheckHWBlit = DFB_CheckHWBlit;
device->FillHWRect = DFB_FillHWRect;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = DFB_FreeHWSurface;
device->free = DFB_DeleteDevice;
@@ -518,7 +516,8 @@ static void DFB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSUR
}
}
static int DFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int
DFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
if ((dst->hwdata == NULL && dst != GAL_VideoSurface)) {
fprintf(stderr, "NEWGAL>DFB: src_hwdata or dst_hwdata NULL\n");
+1 -1
View File
@@ -111,7 +111,7 @@ typedef struct _GAL_FunctionTable {
int (*AllocHWSurface)(_THIS, GAL_Surface *surface);
int (*CheckHWBlit)(_THIS, GAL_Surface *src, GAL_Surface *dst);
int (*HWAccelBlit)(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
int (*FillHWRect)(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
int (*FillHWRect)(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
void (*FreeHWSurface)(_THIS, GAL_Surface *surface);
+10 -12
View File
@@ -117,7 +117,7 @@ static int DRM_AllocHWSurface_Accl(_THIS, GAL_Surface *surface);
static void DRM_FreeHWSurface_Accl(_THIS, GAL_Surface *surface);
static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect,
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, const GAL_Rect *rect,
Uint32 color);
static void DRM_UpdateRects(_THIS, int numrects, GAL_Rect *rects);
@@ -125,9 +125,6 @@ static BOOL DRM_WaitVBlank(_THIS);
static BOOL DRM_SyncUpdate(_THIS);
static BOOL DRM_SyncUpdateAsync(_THIS);
static int DRM_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key);
static int DRM_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value);
#if IS_SHAREDFB_SCHEMA_PROCS
/* DRM engine methods for clients under sharedfb schema and MiniGUI-Processes */
static GAL_Surface *DRM_SetVideoMode_Client(_THIS, GAL_Surface *current,
@@ -1408,8 +1405,6 @@ static GAL_VideoDevice *DRM_CreateDevice(int devindex)
/* set accelerated methods in DRM_VideoInit */
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->Suspend = DRM_Suspend;
device->Resume = DRM_Resume;
device->free = DRM_DeleteDevice;
@@ -1666,8 +1661,10 @@ static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat)
if (this->hidden->driver_ops->check_blit) {
this->CheckHWBlit = DRM_CheckHWBlit_Accl;
#if 0
this->SetHWColorKey = DRM_SetHWColorKey_Accl;
this->SetHWAlpha = DRM_SetHWAlpha_Accl;
#endif
this->info.blit_hw = 1;
this->info.blit_hw_A = 1;
@@ -1675,8 +1672,6 @@ static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat)
}
else {
this->CheckHWBlit = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
}
}
@@ -3596,7 +3591,7 @@ static int DRM_HWBlit(GAL_Surface *src, GAL_Rect *src_rc,
assert(blitor);
DrmBlitOperations blit_ops = { };
blit_ops.cpy = BLIT_COPY_NORMAL;
blit_ops.cpy = BLIT_COPY_TRANSLATE;
if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
blit_ops.key = BLIT_COLORKEY_NORMAL;
@@ -3630,7 +3625,7 @@ static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
src->flags |= GAL_HWACCEL;
DrmBlitOperations blit_ops = { };
blit_ops.cpy = BLIT_COPY_NORMAL;
blit_ops.cpy = BLIT_COPY_TRANSLATE;
if ((src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) {
blit_ops.key = BLIT_COLORKEY_NORMAL;
@@ -3667,7 +3662,7 @@ static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
return !!(src->flags & GAL_HWACCEL);
}
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect,
static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, const GAL_Rect *rect,
Uint32 color)
{
DrmVideoData* vdata = this->hidden;
@@ -3920,7 +3915,9 @@ static BOOL DRM_SyncUpdateDMA (_THIS)
SetRectEmpty(&this->hidden->dirty_rc);
return TRUE;
}
#endif
static int DRM_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key);
static int DRM_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value);
static int DRM_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key)
{
@@ -3931,6 +3928,7 @@ static int DRM_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value)
{
return 0;
}
#endif
MG_EXPORT int drmGetDeviceFD (GHANDLE video)
{
-2
View File
@@ -139,8 +139,6 @@ static GAL_VideoDevice *DUMMY_CreateDevice(int devindex)
device->AllocHWSurface = DUMMY_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = DUMMY_FreeHWSurface;
device->free = DUMMY_DeleteDevice;
-2
View File
@@ -183,8 +183,6 @@ static GAL_VideoDevice *EM85XXOSD_CreateDevice(int devindex)
device->AllocHWSurface = EM85XXOSD_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = EM85XXOSD_FreeHWSurface;
device->UpdateRects = EM85XXOSD_UpdateRects;
-2
View File
@@ -454,8 +454,6 @@ static GAL_VideoDevice *EM85XXYUV_CreateDevice(int devindex)
device->AllocHWSurface = EM85XXYUV_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = EM85XXYUV_FreeHWSurface;
device->UpdateRects = EM85XXYUV_UpdateRects;
+3 -4
View File
@@ -69,7 +69,7 @@ static int GFX_VideoInit(_THIS, GAL_PixelFormat * vformat);
static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags);
static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags);
static void GFX_VideoQuit(_THIS);
static int GFX_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color);
static int GFX_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface);
static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface);
static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect);
@@ -112,8 +112,6 @@ static GAL_VideoDevice * GFX_CreateDevice(int devindex)
this->AllocHWSurface = GFX_AllocHWSurface;
this->CheckHWBlit = GFX_CheckHWBlit;
this->FillHWRect = GFX_FillHWRect;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->UpdateRects = NULL;
this->FreeHWSurface = GFX_FreeHWSurface;
@@ -298,7 +296,8 @@ static void GFX_VideoQuit (_THIS)
return;
}
static int GFX_FillHWRect(_THIS, GAL_Surface * surface, GAL_Rect * rect, Uint32 color)
static int
GFX_FillHWRect(_THIS, GAL_Surface *surface, const GAL_Rect *rect, Uint32 color)
{
struct GFXEngine_FillRectangle_type fill_param;
struct GFXEngine_Surface_type surface_param;
+1 -8
View File
@@ -68,13 +68,7 @@ static void WaitIdle(_THIS)
tdfx_waitidle();
}
/* Set video mem colorkey and accelerated blit function */
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
{
return(0);
}
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
int bpp;
char *dst_base;
@@ -230,5 +224,4 @@ void FB_3DfxAccel(_THIS, __u32 card)
/* The 3Dfx has accelerated normal and colorkey blits */
this->info.blit_hw = 1;
this->info.blit_hw_CC = 1;
this->SetHWColorKey = SetHWColorKey;
}
+1 -16
View File
@@ -74,21 +74,7 @@ static void WaitIdle(_THIS)
mga_waitidle();
}
/* Set video mem colorkey and accelerated blit function */
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
{
return(0);
}
/* Set per surface hardware alpha value */
#if 0
static int SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 value)
{
return(0);
}
#endif
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
int dstX, dstY;
Uint32 fxbndry;
@@ -279,7 +265,6 @@ void FB_MatroxAccel(_THIS, __u32 card)
*/
if ( card != FB_ACCEL_MATROX_MGA2064W ) {
this->info.blit_hw_CC = 1;
this->SetHWColorKey = SetHWColorKey;
}
#if 0 /* Not yet implemented? */
+1 -8
View File
@@ -95,12 +95,6 @@ static void WaitIdle(_THIS)
;
}
/* Set video mem colorkey and accelerated blit function */
static int SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
{
return 0;
}
static inline void validate_dst (_THIS, GAL_Surface* dst)
{
int bltMode = 0;
@@ -121,7 +115,7 @@ static inline void validate_dst (_THIS, GAL_Surface* dst)
neo2200->pitch = (dst->pitch << 16) | (dst->pitch & 0xFFFF);
}
static int FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
char *dst_base;
@@ -297,7 +291,6 @@ void FB_NeoMagicAccel(_THIS, __u32 card)
/* The NeoMagic has accelerated normal and colorkey blits */
this->info.blit_hw = 1;
this->info.blit_hw_CC = 1;
this->SetHWColorKey = SetHWColorKey;
}
#endif /* FB_ACCEL_NEOMAGIC_NM2070 */
-2
View File
@@ -294,8 +294,6 @@ static GAL_VideoDevice *FB_CreateDevice(int devindex)
this->AllocHWSurface = FB_AllocHWSurface;
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->UpdateRects = NULL;
#if 0
this->LockHWSurface = FB_LockHWSurface;
+1 -8
View File
@@ -715,7 +715,7 @@ static void SMI_SubsequentScreenToScreenCopy (int x1, int y1, int x2,
WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd);
}
static int SMI_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int SMI_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
SMIPtr pSmi = &smi_rec;
int x = rect->x;
@@ -825,12 +825,6 @@ static void SMI_WaitIdle (_THIS)
#endif
}
/* Set video mem colorkey and accelerated blit function */
static int SMI_SetHWColorKey (_THIS, GAL_Surface *surface, Uint32 key)
{
return 0;
}
static int SMI_CheckHWBlit (_THIS, GAL_Surface *src, const GAL_Rect *srcrc,
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op)
{
@@ -908,7 +902,6 @@ static int SMI_Init (_THIS, const GAL_Surface* current)
this->info.blit_hw = 1;
this->info.blit_hw_A = 0;
this->info.blit_hw_CC = 1;
this->SetHWColorKey = SMI_SetHWColorKey;
return 0;
}
-2
View File
@@ -116,8 +116,6 @@ static GAL_VideoDevice *GDL_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = GDL_DeleteDevice;
+1 -3
View File
@@ -242,8 +242,6 @@ static GAL_VideoDevice *HI3560A_CreateDevice(int devindex)
device->AllocHWSurface = HI3560A_AllocHWSurface;
device->CheckHWBlit = HI3560A_CheckHWBlit;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FillHWRect = HI3560A_FillHWRect;
device->FreeHWSurface = HI3560A_FreeHWSurface;
@@ -994,7 +992,7 @@ static int HI3560A_AllocHWSurface(_THIS, GAL_Surface *surface)
}
}
static int HI3560A_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int HI3560A_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
TDE_HANDLE tdeHandle;
int ret = 0;
+1 -3
View File
@@ -501,7 +501,7 @@ static int HI3510_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
}
/* Fills a surface rectangle with the given color */
static int HI3510_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int HI3510_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
Uint8 r,g,b;
Uint8* pvirtual_addr;
@@ -1863,8 +1863,6 @@ static GAL_VideoDevice *HI3510_CreateDevice (int devindex)
#endif
this->FreeHWSurface = HI3510_FreeHWSurface;
this->free = HI3510_DeleteDevice;
this->SetHWAlpha = NULL;
this->SetHWColorKey = NULL;
return this;
}
+1 -3
View File
@@ -675,7 +675,7 @@ static int HI3560_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst)
}
static Sint32 Hi3560_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static Sint32 Hi3560_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
TDE_SURFACE_S surface ={0};
TDE_OPT_S param;
@@ -1855,8 +1855,6 @@ static GAL_VideoDevice *HI3560_CreateDevice (int devindex)
//#endif
#endif
this->FreeHWSurface = HI3560_FreeHWSurface;
this->SetHWAlpha = NULL;
this->SetHWColorKey = NULL;
this->free = HI3560_DeleteDevice;
//this->SetAttr = HI3560_SetLayerAttr;
File diff suppressed because it is too large Load Diff
-2
View File
@@ -251,8 +251,6 @@ static GAL_VideoDevice *MB93493_CreateDevice(int devindex)
device->AllocHWSurface = MB93493_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = MB93493_FreeHWSurface;
device->UpdateRects = MB93493_UpdateRects;
device->free = MB93493_DeleteDevice;
-2
View File
@@ -335,8 +335,6 @@ static GAL_VideoDevice *MLSHADOW_CreateDevice (int devindex)
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
device->UpdateRects = MLSHADOW_UpdateRects;
device->DeleteSurface = MLSHADOW_DeleteSurface;
-2
View File
@@ -485,8 +485,6 @@ static GAL_VideoDevice *MLSHADOW_CreateDevice (int devindex)
device->AllocHWSurface = MLSHADOW_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = MLSHADOW_FreeHWSurface;
device->UpdateRects = MLSHADOW_UpdateRects;
device->DeleteSurface = MLSHADOW_DeleteSurface;
+6 -4
View File
@@ -106,12 +106,10 @@ static void MStar_VideoQuit(_THIS);
/* Hardware surface functions */
static int MStar_InitHWSurfaces(_THIS, GAL_Surface *screen, char *base, int size);
static int MStar_AllocHWSurface(_THIS, GAL_Surface *surface);
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *dstrect, Uint32 color);
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *dstrect, Uint32 color);
static void MStar_FreeHWSurface(_THIS, GAL_Surface *surface);
static int MStar_CheckHWBlit(_THIS, GAL_Surface *src, GAL_Surface *dst);
static int MStar_HWAccelBlit(GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
static int MStar_SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key);
static int MStar_SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 alpha);
/* Various screen update functions available */
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects);
@@ -190,8 +188,10 @@ static GAL_VideoDevice * MStar_CreateDevice(int devindex)
device->AllocHWSurface = MStar_AllocHWSurface;
device->CheckHWBlit = MStar_CheckHWBlit;
device->FillHWRect = MStar_FillHWRect;
#if 0
device->SetHWColorKey = MStar_SetHWColorKey;
device->SetHWAlpha = MStar_SetHWAlpha;
#endif
device->FreeHWSurface = MStar_FreeHWSurface;
device->UpdateRects = MStar_DirectUpdate;
device->UpdateSurfaceRects = NULL;
@@ -725,7 +725,7 @@ void cleanEngineState(MSTARDeviceData *sdev)
sdev->dst_ge_format = GFX_FMT_ARGB8888;
}
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int MStar_FillHWRect(_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
GFX_RectFillInfo rectInfo;
GFX_Point v0, v1;
@@ -773,6 +773,7 @@ static int MStar_FillHWRect(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 colo
return 0;
}
#if 0
static int MStar_SetHWColorKey(_THIS, GAL_Surface *src, Uint32 key)
{
FUNC_ENTER();
@@ -790,6 +791,7 @@ static int MStar_SetHWAlpha(_THIS, GAL_Surface *surface, Uint8 alpha)
FUNC_LEAVE();
return 0;
}
#endif
static void MStar_DirectUpdate(_THIS, int numrects, GAL_Rect *rects)
{
+6 -13
View File
@@ -83,9 +83,9 @@ static REP_NEXUS_GETSURFACE reply_primary_surface_info;
/* Initialization/Query functions */
static int NEXUS_VideoInit(_THIS, GAL_PixelFormat * vformat);
static GAL_Rect **NEXUS_ListModes(_THIS, GAL_PixelFormat * format,
Uint32 flags);
static GAL_Surface *NEXUS_SetVideoMode(_THIS, GAL_Surface * current, int width,
int height, int bpp, Uint32 flags);
Uint32 flags);
static GAL_Surface *NEXUS_SetVideoMode(_THIS, GAL_Surface *current,
int width, int height, int bpp, Uint32 flags);
static int NEXUS_SetColors(_THIS, int firstcolor, int ncolors,
GAL_Color * colors);
static void NEXUS_VideoQuit(_THIS);
@@ -93,8 +93,8 @@ static void NEXUS_VideoQuit(_THIS);
/* Hardware surface functions */
static int NEXUS_AllocHWSurface(_THIS, GAL_Surface * surface);
static void NEXUS_FreeHWSurface(_THIS, GAL_Surface * surface);
static int NEXUS_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect,
Uint32 color);
static int NEXUS_FillHWRect(_THIS, GAL_Surface * dst, const GAL_Rect * rect,
Uint32 color);
static void NEXUS_UpdateSurfaceRects(_THIS, GAL_Surface* surface,
int numrects, GAL_Rect *rects);
static int NEXUS_CheckHWBlit(_THIS, GAL_Surface * src, GAL_Surface * dst);
@@ -114,11 +114,6 @@ NEXUS_DeleteDevice(GAL_VideoDevice * device)
free(device);
}
static int NEXUS_SetHWColorKey(_THIS, GAL_Surface *surface, Uint32 key)
{
return 0;
}
static GAL_VideoDevice *
NEXUS_CreateDevice(int devindex)
{
@@ -152,8 +147,6 @@ NEXUS_CreateDevice(int devindex)
device->AllocHWSurface = NEXUS_AllocHWSurface;
device->CheckHWBlit = NEXUS_CheckHWBlit;
device->FillHWRect = NEXUS_FillHWRect;
device->SetHWColorKey = NEXUS_SetHWColorKey;
device->SetHWAlpha = NULL;
device->FreeHWSurface = NEXUS_FreeHWSurface;
device->UpdateRects = NULL;
device->UpdateSurfaceRects = NEXUS_UpdateSurfaceRects;
@@ -455,7 +448,7 @@ NEXUS_FreeHWSurface(_THIS, GAL_Surface * surface)
}
static int
NEXUS_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color)
NEXUS_FillHWRect(_THIS, GAL_Surface * dst, const GAL_Rect * rect, Uint32 color)
{
return NexusPrivate_FillRect(this->hidden->privateData,
(NexusPrivate_HWSurface_hwdata *) dst->hwdata,
-2
View File
@@ -350,8 +350,6 @@ static GAL_VideoDevice *PCXVFB_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = PCXVFB_DeleteDevice;
-2
View File
@@ -171,8 +171,6 @@ static GAL_VideoDevice *QVFB_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = QVFB_DeleteDevice;
-2
View File
@@ -208,8 +208,6 @@ static GAL_VideoDevice *RTOS_XVFB_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = RTOS_XVFB_DeleteDevice;
-2
View File
@@ -196,8 +196,6 @@ static GAL_VideoDevice *S3C6410_CreateDevice(int devindex)
device->AllocHWSurface = S3C6410_AllocHWSurface;
device->CheckHWBlit = S3C6410_CheckHWBlit;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = S3C6410_FreeHWSurface;
device->free = S3C6410_DeleteDevice;
-2
View File
@@ -376,8 +376,6 @@ static GAL_VideoDevice *SHADOW_CreateDevice(int devindex)
device->AllocHWSurface = SHADOW_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = SHADOW_FreeHWSurface;
device->UpdateRects = SHADOW_UpdateRects;
#ifdef _MGRM_PROCESSES
+2 -4
View File
@@ -173,7 +173,7 @@ static int GFX_VideoInit(_THIS, GAL_PixelFormat * vformat);
static GAL_Rect ** GFX_ListModes(_THIS, GAL_PixelFormat * format, Uint32 flags);
static GAL_Surface * GFX_SetVideoMode(_THIS, GAL_Surface * current, int width, int height, int bpp, Uint32 flags);
static void GFX_VideoQuit(_THIS);
static int GFX_FillHWRect(_THIS, GAL_Surface * dst, GAL_Rect * rect, Uint32 color);
static int GFX_FillHWRect(_THIS, GAL_Surface * dst, const GAL_Rect * rect, Uint32 color);
static int GFX_AllocHWSurface(_THIS, GAL_Surface * surface);
static void GFX_FreeHWSurface(_THIS, GAL_Surface * surface);
static int GFX_HWAccelBlit(GAL_Surface * src, GAL_Rect * srcrect, GAL_Surface * dst, GAL_Rect * dstrect);
@@ -217,8 +217,6 @@ static GAL_VideoDevice * GFX_CreateDevice(int devindex)
this->AllocHWSurface = GFX_AllocHWSurface;
this->CheckHWBlit = GFX_CheckHWBlit;
this->FillHWRect = GFX_FillHWRect;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->UpdateRects = NULL;
this->FreeHWSurface = GFX_FreeHWSurface;
@@ -846,7 +844,7 @@ static void GFX_VideoQuit (_THIS)
return;
}
static int GFX_FillHWRect(_THIS, GAL_Surface * surface, GAL_Rect * rect, Uint32 color)
static int GFX_FillHWRect(_THIS, GAL_Surface * surface, const GAL_Rect * rect, Uint32 color)
{
FUNC_ENTER();
struct GFXEngine_FillRectangle_type fill_param;
+2 -4
View File
@@ -123,7 +123,7 @@ static int STGFB_AllocHWSurface (_THIS, GAL_Surface *surface);
static void STGFB_FreeHWSurface (_THIS, GAL_Surface *surface);
static int STGFB_HWAccelBlit (GAL_Surface *src, GAL_Rect *srcrect, GAL_Surface *dst, GAL_Rect *dstrect);
static int STGFB_CheckHWBlit (_THIS, GAL_Surface * src, GAL_Surface * dst);
static int STGFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
static int STGFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color);
/* STAPI functions */
static int STAPI_Init (_THIS);
@@ -854,8 +854,6 @@ static GAL_VideoDevice *STGFB_CreateDevice (int devindex)
this->FreeHWSurface = STGFB_FreeHWSurface;
this->CheckHWBlit = STGFB_CheckHWBlit;
this->FillHWRect = STGFB_FillHWRect;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = STGFB_DeleteDevice;
return this;
@@ -1211,7 +1209,7 @@ static void STGFB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWS
}
static int STGFB_FillHWRect (_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color)
static int STGFB_FillHWRect (_THIS, GAL_Surface *dst, const GAL_Rect *rect, Uint32 color)
{
if (dst == NULL || rect == NULL) {
fprintf(stderr, "STGFB_FillHWRect >> dst or dstrect NULL\n");
+5 -1
View File
@@ -247,12 +247,14 @@ int GAL_SetColorKey (GAL_Surface *surface, Uint32 flag, Uint32 key)
surface->flags |= GAL_SRCCOLORKEY;
surface->format->colorkey = key;
#if 0
if ((surface->flags & GAL_HWACCEL) == GAL_HWACCEL) {
if ((video->SetHWColorKey == NULL) ||
(video->SetHWColorKey(this, surface, key) < 0)) {
surface->flags &= ~GAL_HWACCEL;
}
}
#endif
if (flag & GAL_RLEACCELOK) {
surface->flags |= GAL_RLEACCELOK;
} else {
@@ -307,13 +309,15 @@ int GAL_SetAlpha (GAL_Surface *surface, Uint32 flag, Uint8 value)
surface->flags |= GAL_SRCPIXELALPHA;
}
#if 0
if ((surface->flags & GAL_HWACCEL) == GAL_HWACCEL) {
if ((video->SetHWAlpha == NULL) ||
(video->SetHWAlpha(this, surface, value) < 0)) {
surface->flags &= ~GAL_HWACCEL;
}
}
#endif
if (flag & GAL_RLEACCELOK) {
surface->flags |= GAL_RLEACCELOK;
} else {
-2
View File
@@ -137,8 +137,6 @@ static GAL_VideoDevice * SVPXXOSD_CreateDevice (int devindex)
device->AllocHWSurface = SVPXXOSD_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = SVPXXOSD_FreeHWSurface;
device->UpdateRects = NULL;
+13 -6
View File
@@ -205,19 +205,26 @@ struct GAL_VideoDevice {
GAL_Surface *dst, const GAL_Rect *dstrc, DWORD op);
/* Fills a surface rectangle with the given color */
int (*FillHWRect)(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color);
int (*FillHWRect)(_THIS, GAL_Surface *dst, const GAL_Rect *dstrc,
Uint32 color);
/* Set video mem colorkey and accelerated blit function */
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
/* Set per surface hardware alpha value */
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
/* Copies pixles in the source surface to the destination surface
with or without scaling, rotation, or flip; nullable. */
int (*CopyHWSurface)(_THIS,
GAL_Surface *src, const GAL_Rect *srcrc,
GAL_Surface *dst, const GAL_Rect *dstrc, BlitCopyOperation op);
/* Returns a readable/writable surface; nullable. */
int (*LockHWSurface)(_THIS, GAL_Surface *surface);
void (*UnlockHWSurface)(_THIS, GAL_Surface *surface);
#if 0
/* Set video mem colorkey and accelerated blit function */
int (*SetHWColorKey)(_THIS, GAL_Surface *surface, Uint32 key);
/* Set per surface hardware alpha value */
int (*SetHWAlpha)(_THIS, GAL_Surface *surface, Uint8 value);
/* Performs hardware flipping */
int (*FlipHWSurface)(_THIS, GAL_Surface *surface);
#endif
-2
View File
@@ -383,8 +383,6 @@ static GAL_VideoDevice *USVFB_CreateDevice (int devindex)
device->AllocHWSurface = USVFB_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = USVFB_FreeHWSurface;
device->UpdateRects = USVFB_UpdateRects;
-2
View File
@@ -350,8 +350,6 @@ static GAL_VideoDevice *UTPMC_CreateDevice (int devindex)
device->AllocHWSurface = UTPMC_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = UTPMC_FreeHWSurface;
device->UpdateRects = UTPMC_UpdateRects;
-2
View File
@@ -508,8 +508,6 @@ static GAL_VideoDevice *UTPMC_CreateDevice (int devindex)
device->AllocHWSurface = UTPMC_AllocHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = UTPMC_FreeHWSurface;
device->UpdateRects = UTPMC_UpdateRects;
-2
View File
@@ -148,8 +148,6 @@ static GAL_VideoDevice *WVFB_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = WVFB_DeleteDevice;
-2
View File
@@ -261,8 +261,6 @@ static GAL_VideoDevice *XXVFB_CreateDevice (int devindex)
this->CheckHWBlit = NULL;
this->FillHWRect = NULL;
this->SetHWColorKey = NULL;
this->SetHWAlpha = NULL;
this->free = XXVFB_DeleteDevice;