blit from system memory in PIO mode

git-svn-id: svn://kolibrios.org@1002 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2009-01-27 00:31:09 +00:00
parent 76bc83bd66
commit 80c71dc52a
18 changed files with 986 additions and 706 deletions
+34 -36
View File
@@ -23,17 +23,17 @@ static void free_pixmap(pixmap_t *pixmap)
pixmap_t* CreatePixmap(unsigned width, unsigned height, u32_t format, u32_t flags)
{
pixmap_t *pixmap;
pixmap_t *pixmap;
if( (width == 0) || ( width > 2048)||
(height == 0) || (height > 2048)||
(format != PICT_a8r8g8b8))
if( (width == 0) || ( width > 2048)||
(height == 0) || (height > 2048)||
(format != PICT_a8r8g8b8))
return NULL;
pixmap = alloc_pixmap();
pixmap = alloc_pixmap();
if( pixmap )
{
if( pixmap )
{
void *raw;
int pitch;
@@ -43,45 +43,43 @@ pixmap_t* CreatePixmap(unsigned width, unsigned height, u32_t format, u32_t flag
pixmap->flags = flags;
if( (srv_hw2d != 0) &&
( (flags & PX_MEM_MASK)==PX_MEM_LOCAL) )
( (flags & PX_MEM_MASK)==PX_MEM_LOCAL) )
{
ioctl_t io;
io.handle = srv_hw2d;
io.io_code = PX_CREATE;
io.input = pixmap;
io.inp_size = 7;
io.output = NULL;
io.out_size = 0;
ioctl_t io;
io.handle = srv_hw2d;
io.io_code = PX_CREATE;
io.input = pixmap;
io.inp_size = 7;
io.output = NULL;
io.out_size = 0;
if (call_service(&io)==ERR_OK)
return pixmap;
else
{
free_pixmap(pixmap) ;
return NULL;
}
if (call_service(&io)==ERR_OK)
return pixmap;
else{
free_pixmap(pixmap) ;
return NULL;
}
}
else
{
{
/*
Only system memory
*/
pixmap->flags &= ~PX_MEM_MASK;
pixmap->flags &= ~PX_MEM_MASK;
pitch = ((width+8)&~8)*4;
raw = UserAlloc(pitch * height);
pitch = ((width+8)&~8)*4;
raw = UserAlloc(pitch * height);
if (! raw)
{
free_pixmap(pixmap);
return NULL;
if ( !raw ){
free_pixmap(pixmap);
return NULL;
};
pixmap->pitch = pitch;
pixmap->mapped = raw;
};
pixmap->pitch = pitch;
pixmap->mapped = raw;
};
return pixmap;
};
return NULL;
return pixmap;
};
return NULL;
};
int DestroyPixmap( pixmap_t *pixmap)