Begun to use structs for the BView<->app_server communication. This makes
the protocoll less prone to errors, reduces possible points of failure and most importantly, reduces the number of function calls to the link API. I only know the numbers for StrokeLine(), which I tested via the Benchmark test app. With this change, drawing random colored and positioned lines actually doubled in speed. On the BView side, the calls to ServerLink::Attach() only halfed, while on the app_server side, the number of calls to ServerLink::Read() is now 1/4th. It will also be worth investigating why the link stuff is so slow at all. I also optimized BView::DrawString() a lot in this change, but I don't have any numbers yet. Some other commands which used multiple Attach()/Read() calls were also optimized, at least the most important ones. Begin/EndLineArray() was also pretty bad on the app_server side. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29937 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <Point.h>
|
||||
#include <Rect.h>
|
||||
#include <Region.h>
|
||||
#include <ServerProtocolStructs.h>
|
||||
|
||||
const static uint32 kDeleteReplicant = 'JAHA';
|
||||
|
||||
@@ -121,21 +122,13 @@ ViewState::IsAllValid() const
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
struct _array_hdr_{
|
||||
float startX;
|
||||
float startY;
|
||||
float endX;
|
||||
float endY;
|
||||
rgb_color color;
|
||||
};
|
||||
|
||||
struct _array_data_{
|
||||
// the max number of points in the array
|
||||
uint32 maxCount;
|
||||
uint32 maxCount;
|
||||
// the current number of points in the array
|
||||
uint32 count;
|
||||
uint32 count;
|
||||
// the array of points
|
||||
_array_hdr_* array;
|
||||
ViewLineArrayInfo* array;
|
||||
};
|
||||
|
||||
#endif /* VIEW_PRIVATE_H */
|
||||
|
||||
Reference in New Issue
Block a user