Small cleanup. Use BitmapFlags() also in the other condition (don't

hardcode overlay color space).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28518 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-11-05 16:10:59 +00:00
parent 897a2e2113
commit 19b75ed8a8
+7 -4
View File
@@ -92,9 +92,12 @@ VideoView::SetBitmap(const BBitmap* bitmap)
// we're going to deadlock when the window tells the node manager to // we're going to deadlock when the window tells the node manager to
// stop the nodes (Window -> NodeManager -> VideoConsumer -> VideoView // stop the nodes (Window -> NodeManager -> VideoConsumer -> VideoView
// -> Window). // -> Window).
if (bitmap && LockLooperWithTimeout(10000) == B_OK) { if (!bitmap || LockLooperWithTimeout(10000) != B_OK)
return;
if (LockBitmap()) { if (LockBitmap()) {
if (fOverlayMode || (BitmapFlags(bitmap) & B_BITMAP_WILL_OVERLAY)) { if (fOverlayMode
|| (BitmapFlags(bitmap) & B_BITMAP_WILL_OVERLAY) != 0) {
if (!fOverlayMode) { if (!fOverlayMode) {
// init overlay // init overlay
rgb_color key; rgb_color key;
@@ -131,7 +134,8 @@ VideoView::SetBitmap(const BBitmap* bitmap)
| B_OVERLAY_FILTER_VERTICAL | B_OVERLAY_FILTER_VERTICAL
| B_OVERLAY_TRANSFER_CHANNEL); | B_OVERLAY_TRANSFER_CHANNEL);
} }
} else if (fOverlayMode && bitmap->ColorSpace() != B_YCbCr422) { } else if (fOverlayMode
&& (BitmapFlags(bitmap) & B_BITMAP_WILL_OVERLAY) == 0) {
fOverlayMode = false; fOverlayMode = false;
ClearViewOverlay(); ClearViewOverlay();
SetViewColor(B_TRANSPARENT_COLOR); SetViewColor(B_TRANSPARENT_COLOR);
@@ -143,7 +147,6 @@ VideoView::SetBitmap(const BBitmap* bitmap)
} }
UnlockLooper(); UnlockLooper();
} }
}
void void