For the Carbon widgetset, Lazarus uses HIViews for many objects, including, for example, objects of type TPanel. Given the disappointing drawing speed I measured, the question is how to optimize drawing performance.
In the HiView Programming Guide, chapter HIView Tasks, Apple writes under "Handling Draw Events" the following <http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/HIViewDoc/HIView_tasks/HIView_tasks.html>. "In addition, whether you use QuickDraw or Quartz, the kEventControlDraw event also contains a kEventParamRgnHandle parameter. This region defines the visible portion of the view, and in most cases you should restrict your drawing to this area; any part of the view outside this area is presumably covered by another view and will be overwritten. The HIView compositor determines the size of this region." So, for good drawing performance, we should only draw into the visible porting of the view. However, Lazarus doesn't use the kEventParamRgnHandle parameter and consequently the application can't do the optimization. I suggest to add the region to the TCarbonContext class. The next question is how this region, or at least its bounding box, should be known to the application. We have, for example, a GetClipRect method attached to various objects. A further question is how to invalidate part of a user interface object, e.g. a TPanel. A good example is scrolling, were we only want to redraw that part of the object that really needs it. If the optimization is impossible using controls/HiViews, than maybe a TPanel shouldn't be a control/HiView ? Regards, Adriaan van Os -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
