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:
@@ -299,7 +299,14 @@ VideoNode::HandleBuffer(BBuffer *buffer)
|
|||||||
LockBitmap();
|
LockBitmap();
|
||||||
if (fBitmap) {
|
if (fBitmap) {
|
||||||
// bigtime_t start = system_time();
|
// 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);
|
// printf("overlay copy: %Ld usec\n", system_time() - start);
|
||||||
}
|
}
|
||||||
UnlockBitmap();
|
UnlockBitmap();
|
||||||
|
|||||||
Reference in New Issue
Block a user