diff --git a/src/porting/common/graph_dfb.c b/src/porting/common/graph_dfb.c index 8bc73bd5..21507cee 100644 --- a/src/porting/common/graph_dfb.c +++ b/src/porting/common/graph_dfb.c @@ -58,14 +58,14 @@ int32_t GFXGetDisplaySize(int32_t disp,uint32_t*width,uint32_t*height) { return E_OK; } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { IDirectFBSurface*surf=(IDirectFBSurface*)surface; int ret=surf->Lock(surf,DSLF_READ | DSLF_WRITE,buffer,pitch); LOGV_IF(ret,"surface=%p buffer=%p pitch=%d",surf,buffer,*pitch); return ret; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { IDirectFBSurface*surf=(IDirectFBSurface*)surface; if(NULL==width||NULL==height) return E_INVALID_PARA; @@ -75,14 +75,14 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return ret==0?E_OK:E_ERROR; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { IDirectFBSurface*surf=(IDirectFBSurface*)surface; int ret=surf->Unlock(surf); LOGV_IF(ret,"surface=%p ret=%d",surface,ret); return ret; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,int8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,int8_t alpha) { LOGV("setopacity=%d",alpha); IDirectFBSurface*surf=(IDirectFBSurface*)surface; IDirectFBDisplayLayer *dispLayer; @@ -91,7 +91,7 @@ int32_t GFXSurfaceSetOpacity(HANDLE surface,int8_t alpha) { return dispLayer->SetOpacity(dispLayer,alpha); } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rec,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rec,uint32_t color) { IDirectFBSurface*surf=(IDirectFBSurface*)surface; GFXRect r= {0,0,0,0}; if(NULL==rec) @@ -103,7 +103,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rec,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { IDirectFBSurface*dfbsrc=(IDirectFBSurface*)surface; IDirectFBSurface*dfbdst=primarySurface; DFBRegion clip; @@ -112,7 +112,7 @@ int32_t GFXFlip(HANDLE surface) { return ret; } -int32_t GFXCreateSurface(int32_t dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int32_t dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { int i,ret; DFBSurfaceDescription desc; IDirectFBSurface*dfbsurface; @@ -138,15 +138,15 @@ int32_t GFXCreateSurface(int32_t dispid,HANDLE*surface,uint32_t width,uint32_t h LOGD_IF(ret,"surface=%x ishw=%d",dfbsurface,hwsurface); if(!hwsurface)dfbsurface->MakeClient(dfbsurface); dfbsurface->Clear(dfbsurface,0,0,0,0); - *surface=(HANDLE)dfbsurface; + *surface=(GFXHANDLE)dfbsurface; return E_OK; } -int32_t GFXSetSurfaceColorKey(HANDLE surface,uint32_t color) { +int32_t GFXSetSurfaceColorKey(GFXHANDLE surface,uint32_t color) { IDirectFBSurface*dfbsrc=(IDirectFBSurface*)surface; } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { int ret,dstwidth,dstheight; GFXRect rs= {0,0},rd; IDirectFBSurface*dfbsrc=(IDirectFBSurface*)srcsurface; @@ -190,7 +190,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return ret; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { LOGV("surface=%p",surface); IDirectFBSurface*dfbsurface=(IDirectFBSurface*)surface; return dfbsurface->Release(dfbsurface); diff --git a/src/porting/common/graph_fb.c b/src/porting/common/graph_fb.c index d0c89c15..ea63d391 100644 --- a/src/porting/common/graph_fb.c +++ b/src/porting/common/graph_fb.c @@ -105,14 +105,14 @@ int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height) { } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { FBSURFACE*ngs=(FBSURFACE*)surface; *buffer=ngs->buffer; *pitch=ngs->pitch; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { FBSURFACE*ngs=(FBSURFACE*)surface; *width = ngs->width; *height= ngs->height; @@ -120,15 +120,15 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return 0; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { return 0;//dispLayer->SetOpacity(dispLayer,alpha); } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { FBSURFACE*ngs=(FBSURFACE*)surface; uint32_t x,y; GFXRect rec= {0,0,0,0}; @@ -149,7 +149,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; FBDEVICE*dev=devs+surf->dispid; if(surf->ishw) { @@ -210,7 +210,7 @@ static FBSURFACE*getFreeSurface(){ return NULL; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { FBSURFACE*surf=getFreeSurface(); FBDEVICE*dev = &devs[dispid]; surf->dispid=dispid; @@ -236,7 +236,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { unsigned int x,y,sw,sh; FBSURFACE*ndst=(FBSURFACE*)dstsurface; FBSURFACE*nsrc=(FBSURFACE*)srcsurface; @@ -281,7 +281,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; FBDEVICE*dev=devs+surf->dispid; if(surf->used && (surf->kbuffer==NULL)){ diff --git a/src/porting/common/graph_sdl.c b/src/porting/common/graph_sdl.c index f6a70c8b..e7a698fb 100644 --- a/src/porting/common/graph_sdl.c +++ b/src/porting/common/graph_sdl.c @@ -71,14 +71,14 @@ int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height) { return E_OK; } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { FBSURFACE*ngs=(FBSURFACE*)surface; *buffer=ngs->surface->pixels; *pitch=ngs->pitch; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { FBSURFACE*ngs=(FBSURFACE*)surface; *width = ngs->width; *height= ngs->height; @@ -86,15 +86,15 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return 0; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { return 0;//dispLayer->SetOpacity(dispLayer,alpha); } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { FBSURFACE*ngs=(FBSURFACE*)surface; GFXRect rec= {0,0,0,0}; rec.w=ngs->width; @@ -105,11 +105,11 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { return 0; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { FBSURFACE*surf=(FBSURFACE*)malloc(sizeof(FBSURFACE)); surf->dispid=dispid; surf->width=width; @@ -143,7 +143,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh return E_OK; } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { FBSURFACE*ndst=(FBSURFACE*)dstsurface; FBSURFACE*nsrc=(FBSURFACE*)srcsurface; GFXRect rs= {0,0}; @@ -180,7 +180,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; SDL_FreeSurface(surf->surface); SDL_DestroyTexture(surf->texture); diff --git a/src/porting/common/graph_xlib.c b/src/porting/common/graph_xlib.c index ef11ab1b..0c1eeddc 100644 --- a/src/porting/common/graph_xlib.c +++ b/src/porting/common/graph_xlib.c @@ -160,14 +160,14 @@ int32_t GFXGetDisplayCount() { return 1; } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { XImage*img=(XImage*)surface; *buffer=img->data; *pitch=img->bytes_per_line; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { XImage*img=(XImage*)surface; *width=img->width; *height=img->height; @@ -175,11 +175,11 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return 0; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { return 0;//dispLayer->SetOpacity(dispLayer,alpha); } @@ -201,7 +201,7 @@ static void X11Expose(int x,int y,int w,int h) { //XPutBackEvent(x11Display,(XEvent*)&e); } } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { XImage*img=(XImage*)surface; uint32_t x,y; GFXRect rec= {0,0,0,0}; @@ -222,7 +222,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { XImage *img=(XImage*)surface; if(mainSurface==surface) { GFXRect rect= {0,0,img->width,img->height}; @@ -231,7 +231,7 @@ int32_t GFXFlip(HANDLE surface) { return 0; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { XImage*img=NULL; if(x11Display) { int imagedepth = DefaultDepth(x11Display,DefaultScreen(x11Display)); @@ -257,7 +257,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect* srcrect) { XImage *ndst=(XImage*)dstsurface; XImage *nsrc=(XImage*)srcsurface; GFXRect rs= {0,0}; @@ -302,7 +302,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { XDestroyImage((XImage*)surface); return 0; } diff --git a/src/porting/include/cdgraph.h b/src/porting/include/cdgraph.h index 2aaabe9e..e665ff93 100755 --- a/src/porting/include/cdgraph.h +++ b/src/porting/include/cdgraph.h @@ -1,7 +1,6 @@ #ifndef __CDROID_GRAPH_H__ #define __CDROID_GRAPH_H__ -#include - +#include /** @ingroup std_drivers */ @@ -12,8 +11,10 @@ @{ */ - -BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif +typedef void* GFXHANDLE; /** @defgroup graphFormat PIXEL Format @brief This enum list the surface format . @@ -32,11 +33,11 @@ typedef enum { @defgroup graphStruct Structs @brief . @{ */ -typedef struct _GFXPoint{ +typedef struct _GFXPoint { int32_t x; int32_t y; }GFXPoint; -typedef struct _GFXRect{ +typedef struct _GFXRect { int32_t x; int32_t y; uint32_t w; @@ -50,20 +51,20 @@ typedef struct _GFXRect{ @{ */ -/*This function init the graph dirver .*/ + /*This function init the graph dirver .*/ -/** - @retval E_OK If init success. - @retval E_ERROR If init failed. + /** + @retval E_OK If init success. + @retval E_ERROR If init failed. - For more information refer to @ref nglCreateSurface.*/ + For more information refer to @ref nglCreateSurface.*/ int32_t GFXInit(); /**This function get the graph resolution * @param [in]dispid displayid ,count as 0,1,2... @param [out]width The value return screen width in pixels. @param [out]height The value return screen height in pixels. - @retval E_OK + @retval E_OK @retval E_ERROR For more information refer to @ref nglCreateSurface and @ref nglGetSurfaceInfo. */ @@ -71,19 +72,19 @@ int32_t GFXInit(); int32_t GFXGetDisplayCount(); /**GFXGetDisplaySize return phisical display size in no rotation*/ -int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height); +int32_t GFXGetDisplaySize(int dispid, uint32_t* width, uint32_t* height); /**This function create an OSD Surface which we can used to draw sth. @param [out]surface The value used to return surface handle. @param [in]width The value give the surface width in pixels. @param [in]height The value give the surface height in pixels. @param [in]format surface format @ref NGLPIXELFORMAT - @param [in]hwsurface + @param [in]hwsurface @retval E_OK @retval E_ERROR For more information refer to @ref nglCreateSurface and @ref nglGetSurfaceInfo. */ -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface); +int32_t GFXCreateSurface(int dispid, GFXHANDLE* surface, uint32_t width, uint32_t height, int32_t format, BOOL hwsurface); /**This function create an OSD Surface which we can used to draw sth. @param [in]surface The surface handle which is created by @ref nglCreateSurface. @@ -95,32 +96,32 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh For more information refer to @ref nglCreateSurface and @ref nglGetSurfaceInfo. */ -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format); -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch); -int32_t GFXUnlockSurface(HANDLE surface); -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha); -/**Thie function fill the surface area with color - @param [in]surface +int32_t GFXGetSurfaceInfo(GFXHANDLE surface, uint32_t* width, uint32_t* height, int32_t* format); +int32_t GFXLockSurface(GFXHANDLE surface, void** buffer, uint32_t* pitch); +int32_t GFXUnlockSurface(GFXHANDLE surface); +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface, uint8_t alpha); +/**Thie function fill the surface area with color + @param [in]surface @param [in]rect if rect is NULL fill whole surface area @param [in]color color with format as A8R8G8B8 @retval E_OK @retval E_ERROR */ -int32_t GFXFillRect(HANDLE dstsurface,const GFXRect*rect,uint32_t color); +int32_t GFXFillRect(GFXHANDLE dstsurface, const GFXRect* rect, uint32_t color); /**This function Blit source surface to dest surface . @param [in]dstsurface The dest surface which used to blit to. @param [in]dx The position x which source surface blit to @param [in]dy The position y which source surface blit to - @param [in]srcsurface The source surface - @param [in]srcrect The rectange(area) in source surface we want to blit + @param [in]srcsurface The source surface + @param [in]srcrect The rectange(area) in source surface we want to blit @retval E_OK @retval E_ERROR For more information refer to @ref nglCreateSurface . */ -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect); -int32_t GFXBatchBlit(HANDLE dstsurface,const GFXPoint*dest_point,HANDLE srcsurface,const GFXRect*srcrects); -int32_t GFXFlip(HANDLE dstsurface); +int32_t GFXBlit(GFXHANDLE dstsurface, int dx, int dy, GFXHANDLE srcsurface, const GFXRect* srcrect); +int32_t GFXBatchBlit(GFXHANDLE dstsurface, const GFXPoint* dest_point, GFXHANDLE srcsurface, const GFXRect* srcrects); +int32_t GFXFlip(GFXHANDLE dstsurface); /**This functionDestroy the surface @param [in]dstsurface The dest surface we want to destroied @@ -128,10 +129,12 @@ int32_t GFXFlip(HANDLE dstsurface); @retval E_ERROR For more information refer to @ref nglCreateSurface */ -int32_t GFXDestroySurface(HANDLE surface); +int32_t GFXDestroySurface(GFXHANDLE surface); /**}*///raphfunctions -END_DECLS +#ifdef __cplusplus +} +#endif #endif diff --git a/src/porting/sigma/graph_gfx.c b/src/porting/sigma/graph_gfx.c index 56ef6c90..9496c35e 100644 --- a/src/porting/sigma/graph_gfx.c +++ b/src/porting/sigma/graph_gfx.c @@ -201,14 +201,14 @@ int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height) { return E_OK; } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { FBSURFACE*ngs=(FBSURFACE*)surface; *buffer=ngs->buffer; *pitch=ngs->pitch; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { FBSURFACE*ngs=(FBSURFACE*)surface; *width = ngs->width; *height= ngs->height; @@ -216,11 +216,11 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return E_OK; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { FBSURFACE*ngs=(FBSURFACE*)surface; if(ngs)ngs->alpha=alpha; return E_OK;//dispLayer->SetOpacity(dispLayer,alpha); @@ -234,7 +234,7 @@ static void toMIGFX(const FBSURFACE*fb,MI_GFX_Surface_t*gfx) { gfx->phyAddr = fb->kbuffer; } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { FBSURFACE*ngs=(FBSURFACE*)surface; uint32_t x,y; MI_S32 ret; @@ -273,7 +273,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { #define DMAFLIP 1//uncomment this line to use GFXFLIP -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; const size_t screen_size=surf->height*surf->pitch; if(surf->ishw && (surf->msize>screen_size) ) { @@ -345,7 +345,7 @@ static FBSURFACE*getFreeFace(){ return NULL; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { FBSURFACE*surf=getFreeFace(); FBDEVICE*dev = &devs[dispid]; surf->dispid = dispid; @@ -385,7 +385,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh } #define MIN(x,y) ((x)>(y)?(y):(x)) -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { unsigned int x,y,sw,sh; FBSURFACE*ndst=(FBSURFACE*)dstsurface; FBSURFACE*nsrc=(FBSURFACE*)srcsurface; @@ -480,11 +480,11 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXBatchBlit(HANDLE dstsurface,const GFXPoint*dest_point,HANDLE srcsurface,const GFXRect*srcrects) { +int32_t GFXBatchBlit(GFXHANDLE dstsurface,const GFXPoint*dest_point,GFXHANDLE srcsurface,const GFXRect*srcrects) { return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; LOGI("GFXDestroySurface %p:%llx/%p",surf,surf->kbuffer,surf->buffer); if( surf->used && (surf->kbuffer==NULL) ) { //user space memory surface diff --git a/src/porting/tinat113/graph_g2d.c b/src/porting/tinat113/graph_g2d.c index 69036f43..0c4c3586 100644 --- a/src/porting/tinat113/graph_g2d.c +++ b/src/porting/tinat113/graph_g2d.c @@ -109,14 +109,14 @@ int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height) { } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { FBSURFACE*ngs=(FBSURFACE*)surface; *buffer=ngs->buffer; *pitch=ngs->pitch; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { FBSURFACE*ngs=(FBSURFACE*)surface; *width = ngs->width; *height= ngs->height; @@ -124,15 +124,15 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return 0; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { return 0;//dispLayer->SetOpacity(dispLayer,alpha); } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { FBSURFACE*ngs=(FBSURFACE*)surface; uint32_t x,y; GFXRect rec= {0,0,0,0}; @@ -153,7 +153,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; FBDEVICE*dev=devs+surf->dispid; if(surf->ishw) { @@ -214,7 +214,7 @@ static FBSURFACE*getFreeSurface(){ return NULL; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { FBSURFACE*surf=getFreeSurface(); FBDEVICE*dev = &devs[dispid]; surf->dispid=dispid; @@ -240,7 +240,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { unsigned int x,y,sw,sh; FBSURFACE*ndst=(FBSURFACE*)dstsurface; FBSURFACE*nsrc=(FBSURFACE*)srcsurface; @@ -316,7 +316,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; FBDEVICE*dev=devs+surf->dispid; if(surf->used && (surf->kbuffer==NULL)){ diff --git a/src/porting/win32/graph_wgl.c b/src/porting/win32/graph_wgl.c index 23aee43f..a04399ce 100644 --- a/src/porting/win32/graph_wgl.c +++ b/src/porting/win32/graph_wgl.c @@ -198,14 +198,14 @@ int32_t GFXGetDisplaySize(int dispid,uint32_t*width,uint32_t*height) { } -int32_t GFXLockSurface(HANDLE surface,void**buffer,uint32_t*pitch) { +int32_t GFXLockSurface(GFXHANDLE surface,void**buffer,uint32_t*pitch) { FBSURFACE*ngs=(FBSURFACE*)surface; *buffer=ngs->buffer; *pitch=ngs->pitch; return 0; } -int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { +int32_t GFXGetSurfaceInfo(GFXHANDLE surface,uint32_t*width,uint32_t*height,int32_t *format) { FBSURFACE*ngs=(FBSURFACE*)surface; *width = ngs->width; *height= ngs->height; @@ -213,15 +213,15 @@ int32_t GFXGetSurfaceInfo(HANDLE surface,uint32_t*width,uint32_t*height,int32_t return E_OK; } -int32_t GFXUnlockSurface(HANDLE surface) { +int32_t GFXUnlockSurface(GFXHANDLE surface) { return 0; } -int32_t GFXSurfaceSetOpacity(HANDLE surface,uint8_t alpha) { +int32_t GFXSurfaceSetOpacity(GFXHANDLE surface,uint8_t alpha) { return 0;//dispLayer->SetOpacity(dispLayer,alpha); } -int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { +int32_t GFXFillRect(GFXHANDLE surface,const GFXRect*rect,uint32_t color) { FBSURFACE*ngs=(FBSURFACE*)surface; uint32_t x,y; GFXRect rec= {0,0,0,0}; @@ -240,7 +240,7 @@ int32_t GFXFillRect(HANDLE surface,const GFXRect*rect,uint32_t color) { return E_OK; } -int32_t GFXFlip(HANDLE surface) { +int32_t GFXFlip(GFXHANDLE surface) { FBSURFACE*surf=(FBSURFACE*)surface; FBDEVICE*dev=devs+surf->dispid; if(surf->ishw) { @@ -250,7 +250,7 @@ int32_t GFXFlip(HANDLE surface) { return 0; } -int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { +int32_t GFXCreateSurface(int dispid,GFXHANDLE*surface,uint32_t width,uint32_t height,int32_t format,BOOL hwsurface) { FBSURFACE*surf=(FBSURFACE*)malloc(sizeof(FBSURFACE)); FBDEVICE*dev = &devs[dispid]; surf->dispid=dispid; @@ -273,7 +273,7 @@ int32_t GFXCreateSurface(int dispid,HANDLE*surface,uint32_t width,uint32_t heigh } -int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcrect) { +int32_t GFXBlit(GFXHANDLE dstsurface,int dx,int dy,GFXHANDLE srcsurface,const GFXRect*srcrect) { unsigned int x,y,sw,sh; FBSURFACE*ndst=(FBSURFACE*)dstsurface; FBSURFACE*nsrc=(FBSURFACE*)srcsurface; @@ -320,7 +320,7 @@ int32_t GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect* return 0; } -int32_t GFXDestroySurface(HANDLE surface) { +int32_t GFXDestroySurface(GFXHANDLE surface) { FBSURFACE* surf = (FBSURFACE*)surface; FBDEVICE* dev = devs + surf->dispid; if (!surf->ishw) {