forked from KolibriOS/kolibrios
blit from system memory in PIO mode
git-svn-id: svn://kolibrios.org@1002 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user