How to redraw only a part of a morph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to redraw only a part of a morph

Tristan Bourgois-2
Hi!

I try to optimize the graphic framework I'm porting.
I have good performance but I have some problem to reDraw the morph of my view.

When I reDraw my morph I use 'invalidRect:' with the bound of the part
I want to reDraw but every step my morph is entirely reDraw.

Does I have to use another method? Or someone can explain me how pharo
manage the repaint of morph?

Thanks :)

I will ask today if I can make a video of my work because is very
impressive of what we can do on Pharo with the framework!

And if the reDraw is functional we certainly have the same performance
with Pharo!

So good news :)

Tristan

Reply | Threaded
Open this post in threaded view
|

Re: How to redraw only a part of a morph

Igor Stasenko
On 28 March 2013 12:05, Tristan Bourgois <[hidden email]> wrote:

> Hi!
>
> I try to optimize the graphic framework I'm porting.
> I have good performance but I have some problem to reDraw the morph of my view.
>
> When I reDraw my morph I use 'invalidRect:' with the bound of the part
> I want to reDraw but every step my morph is entirely reDraw.
>
> Does I have to use another method? Or someone can explain me how pharo
> manage the repaint of morph?
>
The thing you looking for called clipping.
Usually (and if possible) morph should try and detect what parts of his drawing
needs to be updated and update only minimum part covered by clipping region.
But that implies some internal knowledge about morph's geometry etc..
and that's why a default implementation simply (re)draws everything.

> Thanks :)
>
> I will ask today if I can make a video of my work because is very
> impressive of what we can do on Pharo with the framework!
>
Please do.

> And if the reDraw is functional we certainly have the same performance
> with Pharo!
>
Come to see me and we will look how we can optimize it :)

> So good news :)
>
> Tristan
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: How to redraw only a part of a morph

philippeback
Is this the thing about invalidRect?

2013/3/28 Igor Stasenko <[hidden email]>:

> On 28 March 2013 12:05, Tristan Bourgois <[hidden email]> wrote:
>> Hi!
>>
>> I try to optimize the graphic framework I'm porting.
>> I have good performance but I have some problem to reDraw the morph of my view.
>>
>> When I reDraw my morph I use 'invalidRect:' with the bound of the part
>> I want to reDraw but every step my morph is entirely reDraw.
>>
>> Does I have to use another method? Or someone can explain me how pharo
>> manage the repaint of morph?
>>
> The thing you looking for called clipping.
> Usually (and if possible) morph should try and detect what parts of his drawing
> needs to be updated and update only minimum part covered by clipping region.
> But that implies some internal knowledge about morph's geometry etc..
> and that's why a default implementation simply (re)draws everything.
>
>> Thanks :)
>>
>> I will ask today if I can make a video of my work because is very
>> impressive of what we can do on Pharo with the framework!
>>
> Please do.
>
>> And if the reDraw is functional we certainly have the same performance
>> with Pharo!
>>
> Come to see me and we will look how we can optimize it :)
>
>> So good news :)
>>
>> Tristan
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>

Reply | Threaded
Open this post in threaded view
|

Re: How to redraw only a part of a morph

Tristan Bourgois-2
In reply to this post by Igor Stasenko
2013/3/28 Igor Stasenko <[hidden email]>:

> On 28 March 2013 12:05, Tristan Bourgois <[hidden email]> wrote:
>> Hi!
>>
>> I try to optimize the graphic framework I'm porting.
>> I have good performance but I have some problem to reDraw the morph of my view.
>>
>> When I reDraw my morph I use 'invalidRect:' with the bound of the part
>> I want to reDraw but every step my morph is entirely reDraw.
>>
>> Does I have to use another method? Or someone can explain me how pharo
>> manage the repaint of morph?
>>
> The thing you looking for called clipping.
> Usually (and if possible) morph should try and detect what parts of his drawing
> needs to be updated and update only minimum part covered by clipping region.
> But that implies some internal knowledge about morph's geometry etc..
> and that's why a default implementation simply (re)draws everything.
>
Ok I simulate the clip in updating my canvas with 'copyClipRect: myClip'
This is functional and improve a LOT the performance :)

I juste have to make some refactoring with some event and animation
which have some bad behavior for the redrawing
and I have to see if copyClipRect: is not a bad method to use.

>> Thanks :)
>>
>> I will ask today if I can make a video of my work because is very
>> impressive of what we can do on Pharo with the framework!
>>
> Please do.
>
>> And if the reDraw is functional we certainly have the same performance
>> with Pharo!
>>
> Come to see me and we will look how we can optimize it :)

For the moment it's a bit difficult to ask help for the framework
because it's a Thalès license...
I work with my tutor to make a part of the framework as open-source
and add it to Pharo but I need to show that Pharo it's so cool and
performant and actually it's work ;)

I'm optimist :)

>> So good news :)
>>
>> Tristan
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>

Reply | Threaded
Open this post in threaded view
|

Re: How to redraw only a part of a morph

Igor Stasenko
On 28 March 2013 14:28, Tristan Bourgois <[hidden email]> wrote:

> 2013/3/28 Igor Stasenko <[hidden email]>:
>> On 28 March 2013 12:05, Tristan Bourgois <[hidden email]> wrote:
>>> Hi!
>>>
>>> I try to optimize the graphic framework I'm porting.
>>> I have good performance but I have some problem to reDraw the morph of my view.
>>>
>>> When I reDraw my morph I use 'invalidRect:' with the bound of the part
>>> I want to reDraw but every step my morph is entirely reDraw.
>>>
>>> Does I have to use another method? Or someone can explain me how pharo
>>> manage the repaint of morph?
>>>
>> The thing you looking for called clipping.
>> Usually (and if possible) morph should try and detect what parts of his drawing
>> needs to be updated and update only minimum part covered by clipping region.
>> But that implies some internal knowledge about morph's geometry etc..
>> and that's why a default implementation simply (re)draws everything.
>>
> Ok I simulate the clip in updating my canvas with 'copyClipRect: myClip'
> This is functional and improve a LOT the performance :)
>
> I juste have to make some refactoring with some event and animation
> which have some bad behavior for the redrawing
> and I have to see if copyClipRect: is not a bad method to use.
>
>>> Thanks :)
>>>
>>> I will ask today if I can make a video of my work because is very
>>> impressive of what we can do on Pharo with the framework!
>>>
>> Please do.
>>
>>> And if the reDraw is functional we certainly have the same performance
>>> with Pharo!
>>>
>> Come to see me and we will look how we can optimize it :)
>
> For the moment it's a bit difficult to ask help for the framework
> because it's a Thalès license...

i just offering my help. you (or your boss) are free to reject it , of
course.. for whatever reason :)

> I work with my tutor to make a part of the framework as open-source
> and add it to Pharo but I need to show that Pharo it's so cool and
> performant and actually it's work ;)
>
> I'm optimist :)
>
>



--
Best regards,
Igor Stasenko.