whoa - how did this even work?

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12094 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-03-28 14:29:18 +00:00
parent 197f82a8fe
commit e0bb2421ea
2 changed files with 6 additions and 34 deletions

View File

@ -132,14 +132,15 @@ void Desktop::Init(void)
void Desktop::AddDriver(DisplayDriver *driver)
{
if(driver->Initialize())
{
if (driver->Initialize()) {
// TODO: be careful of screen initialization - monitor may not support 640x480
Screen *sc = new Screen(driver, BPoint(640, 480), B_RGB32, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_CMAP8, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_GRAY8, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_RGB15, fScreenList.CountItems()+1);
// Screen *sc = new Screen(driver, BPoint(640, 480), B_RGB16, fScreenList.CountItems()+1);
fScreenList.AddItem(sc);
}
else
{
} else {
driver->Shutdown();
delete driver;
}

View File

@ -831,35 +831,6 @@ ViewHWInterface::CopyBackToFront(const BRect& frame)
break;
}
int32 pixelSize = 0;
color_space dstFormat = into->ColorSpace();
// NOTE: there is no check if the bitmaps
// are of the same format, because they are
if (dstFormat == B_RGBA32 || dstFormat == B_RGB32) {
pixelSize = 4;
} else if (dstFormat == B_RGB24) {
pixelSize = 3;
} else if (dstFormat == B_RGB15 || dstFormat == B_RGB16) {
pixelSize = 2;
} else if (dstFormat == B_GRAY8 || dstFormat == B_CMAP8) {
pixelSize = 1;
}
int32 bytes = (right - x + 1) * pixelSize;
if (bytes > 0) {
// offset pointers to left top of area
dst += y * dstBPR + x * pixelSize;
src += y * srcBPR + x * pixelSize;
// copy
for (; y <= bottom; y++) {
memcpy(dst, src, bytes);
dst += dstBPR;
src += srcBPR;
}
}
// update the region on screen
fWindow->Invalidate(area);
}