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:
parent
f8915230d5
commit
fe19cff624
@ -67,7 +67,7 @@ class ServerBitmap {
|
||||
uint32 AreaOffset() const;
|
||||
|
||||
void SetOverlay(::Overlay* cookie);
|
||||
::Overlay* Overlay() const;
|
||||
::Overlay* Overlay() const;
|
||||
|
||||
//! Does a shallow copy of the bitmap passed to it
|
||||
inline void ShallowCopy(const ServerBitmap *from);
|
||||
|
@ -1514,13 +1514,23 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
if (status == B_OK) {
|
||||
ServerBitmap* bitmap = fServerApp->FindBitmap(bitmapToken);
|
||||
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
|
||||
// deleted in the mean time!!
|
||||
fCurrentLayer->SetViewBitmap(bitmap, srcRect, dstRect,
|
||||
resizingMode, options);
|
||||
|
||||
BRegion dirty(fCurrentLayer->Bounds());
|
||||
fWindowLayer->InvalidateView(fCurrentLayer, dirty);
|
||||
// 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());
|
||||
fWindowLayer->InvalidateView(fCurrentLayer, dirty);
|
||||
}
|
||||
|
||||
if (bitmap != NULL && bitmap->Overlay() != NULL)
|
||||
colorKey = bitmap->Overlay()->Color().GetColor32();
|
||||
|
@ -141,6 +141,9 @@ class ViewLayer {
|
||||
{ return fViewColor; }
|
||||
void SetViewColor(const RGBColor& color)
|
||||
{ fViewColor = color; }
|
||||
|
||||
ServerBitmap* ViewBitmap() const
|
||||
{ return fViewBitmap; }
|
||||
void SetViewBitmap(ServerBitmap* bitmap, BRect sourceRect,
|
||||
BRect destRect, int32 resizingMode, int32 options);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user