[haiku-appserver] Re: resize operation

  • From: Adi Oanca <adioanca@xxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Wed, 08 Jun 2005 15:35:16 +0300

> DarkWyrm wrote:
>>>We can do better, the problem is how?
>>> - in the first case I can copy child2 to the right using HW acc.
>>> - in the 2nd case I can copy child1 to the bottom using HW acc.
>>> - in the 3rd case I can copy _only one_ of them using HW acc,
>>>the other being completely redrawn. The problem is: which one
>>>should I copy? The obvious answer would be: copy in the direction
>>>that has the biggest area of right or bottom aligned views. BUT,
>>>should I spend CPU cycles and memory to calculate which area is
>>>the biggest? Is it feasible? (BTW, same could be done for bottom-
>>>right
>>>aligned ones)
>>>     The approach I took was to always copy right aligned views,
>>>but that is not of much use when resizing on the vertical.
>>>
>>>What should I do?
> 
>>In any event, you might want to test the calculate-and-accelerate 
>>method. Most likely, you either get a speedup or at least be no better 
>>off than before. It's worth looking into, anyway.
> 

        Because all these flags:

B_FOLLOW_RIGHT
B_FOLLOW_H_CENTER
B_FOLLOW_BOTTOM
B_FOLLOW_V_CENTER
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM

        I must define 5 BRegions in which to add little by little and
above that calculate the one with the maximum area. This consumes _a lot_
of memory and CPU time. Therefor, I don't think we can go this way.

        I propose 2 strategies:
1) we all use our knowledge and define only one of these five directions
to HW accelerate based on our experience with GUI applications.
(B_FOLLOW_RIGHT?)

or

2) The first time we resize and pass through the whole tree(from that view, 
down)
we calculate the greatest area from which we'll determine the direction in which
we'll use HW acc.
Note that if views are inserted or deleted afterwards, the direction in which
we use HW acc to blit the surface of the respective (sub)view, may not be 
optimal.
Unless we repeat this step from about 40 to 40 resize operations?



Thoughts?


Thanks,
Adi.

Other related posts: