Made copying into overlay save, by locking the bits.

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


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen
2006-05-16 19:07:25 +00:00
parent 46daa6672e
commit afc66bbbc3
+8 -1
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();