[Pharo-dev] Fast render of a bitmap in Athens?

Alexandre Bergel alexandre.bergel at me.com
Tue Apr 8 18:42:51 EDT 2014


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 at gmail.com> wrote:

> 
> 
> 
> On 7 April 2014 19:42, Alexandre Bergel <alexandre.bergel at 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
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







More information about the Pharo-dev mailing list