On 7 April 2014 19:42, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Hi!
How can a form be quickly displayed in a surface? Is it correct to do?
athensCanvas pathTransform restoreAfter: [ athensCanvas setPaint: self form. athensCanvas draw ]
Apparently, the root is AthensCairoSurface>>#fromForm: is really slow. How to have a fast bitmap rendering in Athens?
yes, converting from form to paint is slow, because it copies contents (form's bits) into new cairo surface. to speed things up , cache the result:
athensCanvas pathTransform restoreAfter: [ paint := ( canvas cacheAt: self form ifAbsetPut: [ (self form asAthensPaintOn: canvas) ]). athensCanvas setPaint: paint. (and before saying draw, you have to set shape first, isn't?) athensCanvas setShape: .... athensCanvas draw ]
Cheers, Alexandre
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
-- Best regards, Igor Stasenko.