Fast render of a bitmap in Athens?
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? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
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.
Thanks Igor, it works perfectly! Athens is processing pictures we got from telescopes. We will soon send (truly) great pictures Alexandre On Apr 7, 2014, at 9:40 PM, Igor Stasenko <siguctua@gmail.com> wrote:
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.
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On 09 Apr 2014, at 00:42, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Thanks Igor, it works perfectly!
Athens is processing pictures we got from telescopes. We will soon send (truly) great pictures
How come you seem to be doing all this interesting stuff, it is not fair ;-) Looking forward to them !
Alexandre
On Apr 7, 2014, at 9:40 PM, Igor Stasenko <siguctua@gmail.com> wrote:
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.
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On 9 April 2014 00:53, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 09 Apr 2014, at 00:42, Alexandre Bergel <alexandre.bergel@me.com> wrote:
Thanks Igor, it works perfectly!
Athens is processing pictures we got from telescopes. We will soon send (truly) great pictures
How come you seem to be doing all this interesting stuff, it is not fair ;-)
Looking forward to them !
Hehe, computer graphics is absolutely much more interesting than boring, years old web communication protocols :) But sure thing, for Pharo success, we definitely need both.
Alexandre
-- Best regards, Igor Stasenko.
participants (3)
-
Alexandre Bergel -
Igor Stasenko -
Sven Van Caekenberghe