I want to optimize the speed for painting many objects to a canvas using Delphi FMX framework.
How much time is used for the beginscene endscene
command execution, and what does this command actually with my canvas. Call once and paint many objects, or call after each object which make my code more simple.
Here is my reference code:
MyCanvas.BeginScene;
MyCanvas.Stroke.Color := clablue;
MyCanvas.Stroke.Kind := TBrushKind.Solid;
MyCanvas.DrawRect(MyRect, 0, 0, AllCorners, 1);
MyCanvas.endscene;
This or a similar code block is called several thousand times for painting my image. Thinking on multithreaded painting to my canvas - is the beginscene endscene
the code block, to enable multithread painting inside one canvas?