To allow testing the ViewHWInterface (used in the test environment) with

both double buffering and single buffering, Invalidate() needs to be
virtual and ViewHWInterface needs to decide where to invalidate it's host
window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28480 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-11-03 19:31:26 +00:00
parent 3cbd4a09f7
commit 6198dc0e17
3 changed files with 13 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class HWInterface : protected MultiLocker {
virtual bool IsDoubleBuffered() const;
// Invalidate is used for scheduling an area for updating
status_t Invalidate(const BRect& frame);
virtual status_t Invalidate(const BRect& frame);
// while as CopyBackToFront() actually performs the operation
// either directly or asynchronously by the UpdateQueue thread
virtual status_t CopyBackToFront(const BRect& frame);

View File

@ -758,6 +758,17 @@ ViewHWInterface::IsDoubleBuffered() const
return HWInterface::IsDoubleBuffered();
}
// Invalidate
status_t
ViewHWInterface::Invalidate(const BRect& frame)
{
status_t ret = HWInterface::Invalidate(frame);
if (ret >= B_OK && fWindow && !IsDoubleBuffered())
fWindow->Invalidate(frame);
return ret;
}
// CopyBackToFront
status_t
ViewHWInterface::CopyBackToFront(const BRect& frame)

View File

@ -53,6 +53,7 @@ class ViewHWInterface : public HWInterface {
virtual RenderingBuffer* BackBuffer() const;
virtual bool IsDoubleBuffered() const;
virtual status_t Invalidate(const BRect& frame);
virtual status_t CopyBackToFront(const BRect& frame);
private: