From d0e89d5302eae7e398bfd3a969a338f95f6cfff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 30 Nov 2005 23:03:05 +0000 Subject: [PATCH] I couldn't resist playing some more with ezprof. I don't know if I can trust it's results though, revealing as they are. Somebody should explain to me why forgetting a return *this; in an operator= method works in the first place, and why it results in the constructor being called. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15255 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/servers/app/newerClipping/Desktop.cpp | 8 ++++---- .../servers/app/newerClipping/WindowLayer.cpp | 17 +++++++++++++++-- src/tests/servers/app/newerClipping/main.cpp | 4 ++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/tests/servers/app/newerClipping/Desktop.cpp b/src/tests/servers/app/newerClipping/Desktop.cpp index 797b6a7aa3..611f82a100 100644 --- a/src/tests/servers/app/newerClipping/Desktop.cpp +++ b/src/tests/servers/app/newerClipping/Desktop.cpp @@ -14,7 +14,7 @@ // constructor Desktop::Desktop(DrawView* drawView) - : BLooper("desktop"), + : BLooper("desktop", B_URGENT_DISPLAY_PRIORITY), fTracking(false), fLastMousePos(-1.0, -1.0), fClickedWindow(NULL), @@ -144,13 +144,13 @@ Desktop::MouseMoved(BPoint where, uint32 code, const BMessage* dragMessage) if (dx != 0 || dy != 0) { if (fClickedWindow) { -bigtime_t now = system_time(); +//bigtime_t now = system_time(); if (fResizing) { ResizeWindowBy(fClickedWindow, dx, dy); -printf("resizing: %lld\n", system_time() - now); +//printf("resizing: %lld\n", system_time() - now); } else { MoveWindowBy(fClickedWindow, dx, dy); -printf("moving: %lld\n", system_time() - now); +//printf("moving: %lld\n", system_time() - now); } } } diff --git a/src/tests/servers/app/newerClipping/WindowLayer.cpp b/src/tests/servers/app/newerClipping/WindowLayer.cpp index 04207d4d68..5e732a1893 100644 --- a/src/tests/servers/app/newerClipping/WindowLayer.cpp +++ b/src/tests/servers/app/newerClipping/WindowLayer.cpp @@ -155,7 +155,19 @@ void WindowLayer::GetBorderRegion(BRegion* region) { if (!fBorderRegionValid) { - // TODO: speed up by avoiding "Exclude()" + fBorderRegion.Set(BRect(fFrame.left - 4, fFrame.top - 20, + (fFrame.left + fFrame.right) / 2, fFrame.top - 5)); + fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top - 4, + fFrame.right + 4, fFrame.top - 1)); + fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.top, + fFrame.left - 1, fFrame.bottom)); + fBorderRegion.Include(BRect(fFrame.right + 1, fFrame.top, + fFrame.right + 4, fFrame.bottom - 11)); + fBorderRegion.Include(BRect(fFrame.left - 4, fFrame.bottom + 1, + fFrame.right - 11, fFrame.bottom + 4)); + fBorderRegion.Include(BRect(fFrame.right - 10, fFrame.bottom - 10, + fFrame.right + 4, fFrame.bottom + 4)); +/* // TODO: speed up by avoiding "Exclude()" // start from the frame, extend to include decorator border fBorderRegion.Set(BRect(fFrame.left - 4, fFrame.top - 4, fFrame.right + 4, fFrame.bottom + 4)); @@ -169,7 +181,7 @@ WindowLayer::GetBorderRegion(BRegion* region) // resize handle // if (B_DOCUMENT_WINDOW_LOOK) fBorderRegion.Include(BRect(fFrame.right - 10, fFrame.bottom - 10, - fFrame.right, fFrame.bottom)); + fFrame.right, fFrame.bottom));*/ fBorderRegionValid = true; } @@ -779,6 +791,7 @@ UpdateSession::operator=(const UpdateSession& other) { fDirtyRegion = other.fDirtyRegion; fInUse = other.fInUse; + return *this; } diff --git a/src/tests/servers/app/newerClipping/main.cpp b/src/tests/servers/app/newerClipping/main.cpp index 2eafcf1685..cb6221bbc2 100644 --- a/src/tests/servers/app/newerClipping/main.cpp +++ b/src/tests/servers/app/newerClipping/main.cpp @@ -181,14 +181,14 @@ Window::Test() AddWindow(frame, name.String()); } - frame.Set(10, 80, 320, 290); +/* frame.Set(10, 80, 320, 290); for (int32 i = 20; i < 40; i++) { BString name("Window "); frame.OffsetBy(20, 15); name << i + 1; AddWindow(frame, name.String()); } -/* + frame.Set(20, 140, 330, 230); for (int32 i = 40; i < 60; i++) { BString name("Window ");