Use a flag in BWindow to store whether an update to a view (Invalidate()) has
been requested. The first call to a BView::Invalidate() will flush the link so that app_server is notified as soon as possible. It makes no sense for further calls to Invalidate() to flush also, since Flush() is not cheap. This trick makes Invalidate() about 3.2 times faster, making it a cheaper operation. I could not see any negative effects, I tested with apps that invalidate multiple different parts inside a window in reaction to something. Thanks go to Ingo who had the idea. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26020 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1245,6 +1245,7 @@ FrameMoved(origin);
|
||||
fLink->StartMessage(AS_END_UPDATE);
|
||||
fLink->Flush();
|
||||
fInTransaction = false;
|
||||
fUpdateRequested = false;
|
||||
|
||||
//printf("BWindow(%s) - UPDATE took %lld usecs\n", Title(), system_time() - now);
|
||||
break;
|
||||
@@ -2460,6 +2461,7 @@ BWindow::_InitData(BRect frame, const char* title, window_look look,
|
||||
fFlags = flags | B_ASYNCHRONOUS_CONTROLS;
|
||||
|
||||
fInTransaction = false;
|
||||
fUpdateRequested = false;
|
||||
fActive = false;
|
||||
fShowLevel = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user