mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-29 18:59:14 +08:00
add surface global alpha support,fix idgen.strings
This commit is contained in:
parent
33a695cf2c
commit
5e57730e2e
@ -34,6 +34,7 @@ class CDROIDHandler( xml.sax.ContentHandler ):
|
||||
if pos<0 :
|
||||
return
|
||||
value=value[pos+1:].strip()
|
||||
if(value[0].isalpha() or (value[0]=='_')) and (value not in self.strings):
|
||||
self.strings.append(value)
|
||||
|
||||
def groupby(self):
|
||||
|
@ -31,6 +31,7 @@ typedef struct{
|
||||
int format;
|
||||
int ishw;
|
||||
int current;
|
||||
int alpha;
|
||||
size_t msize;
|
||||
char*buffer;//drawbuffer
|
||||
char*orig_buffer;//used only in double buffer*/
|
||||
@ -118,6 +119,8 @@ INT GFXUnlockSurface(HANDLE surface){
|
||||
}
|
||||
|
||||
INT GFXSurfaceSetOpacity(HANDLE surface,BYTE alpha){
|
||||
FBSURFACE*ngs=(FBSURFACE*)surface;
|
||||
ngs->alpha=alpha;
|
||||
return E_OK;//dispLayer->SetOpacity(dispLayer,alpha);
|
||||
}
|
||||
|
||||
@ -262,10 +265,11 @@ INT GFXCreateSurface(int dispid,HANDLE*surface,UINT width,UINT height,INT format
|
||||
surf->height=width;
|
||||
surf->pitch=height*4;
|
||||
}
|
||||
MI_SYS_MemsetPa(phaddr,0xFFFFFFFF,surf->msize);
|
||||
MI_SYS_MemsetPa(phaddr,0x000000,surf->msize);
|
||||
surf->orig_buffer=surf->buffer;
|
||||
if(hwsurface) setfbinfo(surf);
|
||||
surf->ishw=hwsurface;
|
||||
surf->alpha=255;
|
||||
//surf->image = pixman_image_create_bits_no_clear(PIXMAN_a8r8g8b8,surf->width,surf->height,surf->buffer,surf->pitch);
|
||||
LOGI("Surface=%x buf=%p/%p size=%dx%d/%d hw=%d\r\n",surf,surf->buffer,surf->kbuffer,width,height,surf->msize,hwsurface);
|
||||
*surface=surf;
|
||||
@ -327,10 +331,13 @@ INT GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcr
|
||||
bzero(&opt,sizeof(opt));
|
||||
|
||||
LOGV("Blit %p %d,%d-%d,%d -> %p %d,%d buffer=%p->%p",nsrc,rs.x,rs.y,rs.w,rs.h,ndst,dx,dy,pbs,pbd);
|
||||
opt.u32GlobalSrcConstColor = 0xFF000000;
|
||||
//nsrc->alpha=0x80;
|
||||
opt.u32GlobalSrcConstColor = nsrc->alpha<<24;
|
||||
opt.u32GlobalDstConstColor = 0xFF000000;
|
||||
opt.eSrcDfbBldOp = E_MI_GFX_DFB_BLD_ONE;
|
||||
opt.eDstDfbBldOp = E_MI_GFX_DFB_BLD_ZERO;
|
||||
opt.eDFBBlendFlag = (nsrc->alpha==255)?E_MI_GFX_DFB_BLEND_NOFX:E_MI_GFX_DFB_BLEND_SRC_PREMULTCOLOR;
|
||||
|
||||
opt.eMirror = E_MI_GFX_MIRROR_NONE;
|
||||
opt.eRotate=ndst->ishw?GFXGetRotation(nsrc->dispid):E_MI_GFX_ROTATE_0;
|
||||
stSrcRect.s32Xpos = rs.x;
|
||||
@ -342,7 +349,6 @@ INT GFXBlit(HANDLE dstsurface,int dx,int dy,HANDLE srcsurface,const GFXRect*srcr
|
||||
switch(GFXGetRotation(nsrc->dispid)){
|
||||
case ROTATE_0 :break;
|
||||
case ROTATE_90:
|
||||
tmp=dx;
|
||||
dx=ndst->width-dy-rs.h;
|
||||
dy=tmp;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user