On Fri, 12 Dec 2008 19:38:55 +1000 "Alexander Klenin" <[email protected]> wrote:
> In issue http://bugs.freepascal.org/view.php?id=12377, reporter said: > > > Painting to an Bitmap and paint this on the Canvas would be much > > faster > > This assertion is, of course, incorrect. I assume that the reporter's > problem is actually that the TChart flickers when repainted. > > The flickering is caused by two sources: > 1) The TChart is TGraphicControl, so Parent control erases chart's > background before every repaint. > 2) TChart itself draws directly to screen, first clearing the canvas. > > First source obviously needs fixing, and I attached to the issue a > patch which fixes it. > The only caveat is that TChart is now TWinControl -- can it lead to > some undesirable consequences I am not aware of? All direct TWinControl descendants must be implemented in all widgetsets. You can use TCustomControl. > The second source can also easily be fixed by double-buffering, but > before I do that, > I have two questions: > 1) TWinControl.WMPaint already contains double-buffering code, but it > is protected > by {$ifdef BUFFERED_WMPAINT}. What is the reason of this? Is there > some ongoing work to implement double-buffering globally? It was an idea to implement double buffering, but it does not work on all platforms. Gladfully most widgetsets have double buffering themselves. > 2) If double-buffering will be implemented in TAChart itself, it will > have some negative > performance impact. So, should I make it optional via DoubleBuffer > property? Please try first TCustomControl. Mattias _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
