No longer invalidates the view when an overlay bitmap is updated.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1514,13 +1514,23 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
|||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
ServerBitmap* bitmap = fServerApp->FindBitmap(bitmapToken);
|
ServerBitmap* bitmap = fServerApp->FindBitmap(bitmapToken);
|
||||||
if (bitmapToken == -1 || bitmap != NULL) {
|
if (bitmapToken == -1 || bitmap != NULL) {
|
||||||
|
bool wasOverlay = fCurrentLayer->ViewBitmap() != NULL
|
||||||
|
&& fCurrentLayer->ViewBitmap()->Overlay() != NULL;
|
||||||
|
|
||||||
// TODO: this is a race condition: the bitmap could have been
|
// TODO: this is a race condition: the bitmap could have been
|
||||||
// deleted in the mean time!!
|
// deleted in the mean time!!
|
||||||
fCurrentLayer->SetViewBitmap(bitmap, srcRect, dstRect,
|
fCurrentLayer->SetViewBitmap(bitmap, srcRect, dstRect,
|
||||||
resizingMode, options);
|
resizingMode, options);
|
||||||
|
|
||||||
|
// TODO: if we revert the view color overlay handling
|
||||||
|
// in ViewLayer::Draw() to the R5 version, we never
|
||||||
|
// need to invalidate the view for overlays.
|
||||||
|
|
||||||
|
// invalidate view - but only if this is a non-overlay switch
|
||||||
|
if (bitmap == NULL || bitmap->Overlay() == NULL || !wasOverlay) {
|
||||||
BRegion dirty(fCurrentLayer->Bounds());
|
BRegion dirty(fCurrentLayer->Bounds());
|
||||||
fWindowLayer->InvalidateView(fCurrentLayer, dirty);
|
fWindowLayer->InvalidateView(fCurrentLayer, dirty);
|
||||||
|
}
|
||||||
|
|
||||||
if (bitmap != NULL && bitmap->Overlay() != NULL)
|
if (bitmap != NULL && bitmap->Overlay() != NULL)
|
||||||
colorKey = bitmap->Overlay()->Color().GetColor32();
|
colorKey = bitmap->Overlay()->Color().GetColor32();
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ class ViewLayer {
|
|||||||
{ return fViewColor; }
|
{ return fViewColor; }
|
||||||
void SetViewColor(const RGBColor& color)
|
void SetViewColor(const RGBColor& color)
|
||||||
{ fViewColor = color; }
|
{ fViewColor = color; }
|
||||||
|
|
||||||
|
ServerBitmap* ViewBitmap() const
|
||||||
|
{ return fViewBitmap; }
|
||||||
void SetViewBitmap(ServerBitmap* bitmap, BRect sourceRect,
|
void SetViewBitmap(ServerBitmap* bitmap, BRect sourceRect,
|
||||||
BRect destRect, int32 resizingMode, int32 options);
|
BRect destRect, int32 resizingMode, int32 options);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user