removed leftover code
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12157 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6447787693
commit
6283b1c6dd
@ -48,16 +48,6 @@
|
||||
# define ATRACE(x) ;
|
||||
#endif
|
||||
|
||||
const unsigned char kEmptyCursor[] = { 16, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
enum {
|
||||
MSG_UPDATE = 'updt',
|
||||
};
|
||||
|
||||
// constructor
|
||||
AccelerantHWInterface::AccelerantHWInterface()
|
||||
: HWInterface(),
|
||||
@ -528,7 +518,6 @@ AccelerantHWInterface::BackBuffer() const
|
||||
void
|
||||
AccelerantHWInterface::_DrawCursor(BRect area) const
|
||||
{
|
||||
return;
|
||||
#if 0
|
||||
BRect cf = _CursorFrame();
|
||||
if (cf.IsValid() && area.Intersects(cf)) {
|
||||
@ -594,174 +583,3 @@ AccelerantHWInterface::_DrawCursor(BRect area) const
|
||||
#endif
|
||||
}
|
||||
|
||||
/*void AccelerantHWInterface::CopyBitmap(ServerBitmap *bitmap, const BRect &source, const BRect &dest, const DrawData *d)
|
||||
{
|
||||
if(!is_initialized || !bitmap || !d)
|
||||
{
|
||||
printf("CopyBitmap returned - not init or NULL bitmap\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// DON't set draw data here! your existing clipping region will be deleted
|
||||
// SetDrawData(d);
|
||||
|
||||
// Oh, wow, is this going to be slow. Then again, AccelerantHWInterface was never meant to be very fast. It could
|
||||
// be made significantly faster by directly copying from the source to the destination, but that would
|
||||
// require implementing a lot of code. Eventually, this should be replaced, but for now, using
|
||||
// DrawBitmap will at least work with a minimum of effort.
|
||||
|
||||
BBitmap *mediator=new BBitmap(bitmap->Bounds(),bitmap->ColorSpace());
|
||||
memcpy(mediator->Bits(),bitmap->Bits(),bitmap->BitsLength());
|
||||
|
||||
screenwin->Lock();
|
||||
framebuffer->Lock();
|
||||
|
||||
drawview->DrawBitmap(mediator,source,dest);
|
||||
drawview->Sync();
|
||||
screenwin->view->Invalidate(dest);
|
||||
|
||||
framebuffer->Unlock();
|
||||
screenwin->Unlock();
|
||||
delete mediator;
|
||||
}
|
||||
|
||||
void AccelerantHWInterface::CopyToBitmap(ServerBitmap *destbmp, const BRect &sourcerect)
|
||||
{
|
||||
if(!is_initialized || !destbmp)
|
||||
{
|
||||
printf("CopyToBitmap returned - not init or NULL bitmap\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if(((uint32)destbmp->ColorSpace() & 0x000F) != (fDisplayMode.space & 0x000F))
|
||||
{
|
||||
printf("CopyToBitmap returned - unequal buffer pixel depth\n");
|
||||
return;
|
||||
}
|
||||
|
||||
BRect destrect(destbmp->Bounds()), source(sourcerect);
|
||||
|
||||
uint8 colorspace_size=destbmp->BitsPerPixel()/8;
|
||||
|
||||
// First, clip source rect to destination
|
||||
if(source.Width() > destrect.Width())
|
||||
source.right=source.left+destrect.Width();
|
||||
|
||||
if(source.Height() > destrect.Height())
|
||||
source.bottom=source.top+destrect.Height();
|
||||
|
||||
|
||||
// Second, check rectangle bounds against their own bitmaps
|
||||
BRect work_rect(destbmp->Bounds());
|
||||
|
||||
if( !(work_rect.Contains(destrect)) )
|
||||
{
|
||||
// something in selection must be clipped
|
||||
if(destrect.left < 0)
|
||||
destrect.left = 0;
|
||||
if(destrect.right > work_rect.right)
|
||||
destrect.right = work_rect.right;
|
||||
if(destrect.top < 0)
|
||||
destrect.top = 0;
|
||||
if(destrect.bottom > work_rect.bottom)
|
||||
destrect.bottom = work_rect.bottom;
|
||||
}
|
||||
|
||||
work_rect.Set(0,0,fDisplayMode.virtual_width-1,fDisplayMode.virtual_height-1);
|
||||
|
||||
if(!work_rect.Contains(sourcerect))
|
||||
return;
|
||||
|
||||
if( !(work_rect.Contains(source)) )
|
||||
{
|
||||
// something in selection must be clipped
|
||||
if(source.left < 0)
|
||||
source.left = 0;
|
||||
if(source.right > work_rect.right)
|
||||
source.right = work_rect.right;
|
||||
if(source.top < 0)
|
||||
source.top = 0;
|
||||
if(source.bottom > work_rect.bottom)
|
||||
source.bottom = work_rect.bottom;
|
||||
}
|
||||
|
||||
// Set pointers to the actual data
|
||||
uint8 *dest_bits = (uint8*) destbmp->Bits();
|
||||
uint8 *src_bits = (uint8*) framebuffer->Bits();
|
||||
|
||||
// Get row widths for offset looping
|
||||
uint32 dest_width = uint32 (destbmp->BytesPerRow());
|
||||
uint32 src_width = uint32 (framebuffer->BytesPerRow());
|
||||
|
||||
// Offset bitmap pointers to proper spot in each bitmap
|
||||
src_bits += uint32 ( (source.top * src_width) + (source.left * colorspace_size) );
|
||||
dest_bits += uint32 ( (destrect.top * dest_width) + (destrect.left * colorspace_size) );
|
||||
|
||||
|
||||
uint32 line_length = uint32 ((destrect.right - destrect.left+1)*colorspace_size);
|
||||
uint32 lines = uint32 (source.bottom-source.top+1);
|
||||
|
||||
for (uint32 pos_y=0; pos_y<lines; pos_y++)
|
||||
{
|
||||
memcpy(dest_bits,src_bits,line_length);
|
||||
|
||||
// Increment offsets
|
||||
src_bits += src_width;
|
||||
dest_bits += dest_width;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AccelerantHWInterface::ConstrainClippingRegion(BRegion *reg)
|
||||
{
|
||||
if(!is_initialized)
|
||||
{
|
||||
printf("ConstrainClippingRegion returned - not init\n");
|
||||
return;
|
||||
}
|
||||
|
||||
screenwin->Lock();
|
||||
framebuffer->Lock();
|
||||
|
||||
// screenwin->view->ConstrainClippingRegion(reg);
|
||||
drawview->ConstrainClippingRegion(reg);
|
||||
|
||||
framebuffer->Unlock();
|
||||
screenwin->Unlock();
|
||||
}
|
||||
|
||||
bool AccelerantHWInterface::AcquireBuffer(FBBitmap *bmp)
|
||||
{
|
||||
if(!bmp || !is_initialized)
|
||||
return false;
|
||||
|
||||
screenwin->Lock();
|
||||
framebuffer->Lock();
|
||||
|
||||
bmp->SetBytesPerRow(framebuffer->BytesPerRow());
|
||||
bmp->SetSpace(framebuffer->ColorSpace());
|
||||
bmp->SetSize(framebuffer->Bounds().IntegerWidth(), framebuffer->Bounds().IntegerHeight());
|
||||
bmp->SetBuffer(framebuffer->Bits());
|
||||
bmp->SetBitsPerPixel(framebuffer->ColorSpace(),framebuffer->BytesPerRow());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AccelerantHWInterface::ReleaseBuffer()
|
||||
{
|
||||
if(!is_initialized)
|
||||
return;
|
||||
framebuffer->Unlock();
|
||||
screenwin->Unlock();
|
||||
}
|
||||
|
||||
void AccelerantHWInterface::Invalidate(const BRect &r)
|
||||
{
|
||||
if(!is_initialized)
|
||||
return;
|
||||
|
||||
screenwin->Lock();
|
||||
screenwin->view->Draw(r);
|
||||
screenwin->Unlock();
|
||||
}
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user