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:
Axel Dörfler
2006-05-04 11:21:36 +00:00
parent f8915230d5
commit fe19cff624
3 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ class ServerBitmap {
uint32 AreaOffset() const; uint32 AreaOffset() const;
void SetOverlay(::Overlay* cookie); void SetOverlay(::Overlay* cookie);
::Overlay* Overlay() const; ::Overlay* Overlay() const;
//! Does a shallow copy of the bitmap passed to it //! Does a shallow copy of the bitmap passed to it
inline void ShallowCopy(const ServerBitmap *from); inline void ShallowCopy(const ServerBitmap *from);
+12 -2
View File
@@ -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);
BRegion dirty(fCurrentLayer->Bounds()); // TODO: if we revert the view color overlay handling
fWindowLayer->InvalidateView(fCurrentLayer, dirty); // 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) if (bitmap != NULL && bitmap->Overlay() != NULL)
colorKey = bitmap->Overlay()->Color().GetColor32(); colorKey = bitmap->Overlay()->Color().GetColor32();
+3
View File
@@ -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);