Made copying into overlay save, by locking the bits.

This could be further optimized, by always hloding the lock,
and only unlocking when app-server requests it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17481 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen 2006-05-16 19:00:25 +00:00
parent 94e881ade0
commit 46daa6672e

View File

@ -299,7 +299,14 @@ VideoNode::HandleBuffer(BBuffer *buffer)
LockBitmap();
if (fBitmap) {
// bigtime_t start = system_time();
memcpy(fBitmap->Bits(), buffer->Data(), fBitmap->BitsLength());
if (fOverlayActive) {
if (B_OK == fBitmap->LockBits()) {
memcpy(fBitmap->Bits(), buffer->Data(), fBitmap->BitsLength());
fBitmap->UnlockBits();
}
} else {
memcpy(fBitmap->Bits(), buffer->Data(), fBitmap->BitsLength());
}
// printf("overlay copy: %Ld usec\n", system_time() - start);
}
UnlockBitmap();