flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From after24 <vinc...@after24.net>
Subject Scroller optimization
Date Fri, 24 Oct 2014 11:24:35 GMT
Hello,

I have worked on a way to optimize the scroller component on mobile..
It's very promising, especially for very complex views, but there is a major
drawback though.

Here is how it works :

The scroller component has a new boolean property called cacheViewport :

When this property is set to true, a bitmap version of the viewport is
captured in a ViewportCache component which inherits from
SpriteVisualElement and implements IViewport.
Instead of using the scrollRect property of the viewport, the ViewportCache
performs the scrolling of the bitmap version of the viewport using the
blitting technique which is way much faster.

When the user start to scroll, the actual viewport is removed (using
removeElement) and replaced by the ViewportCache component.
When the scroll is complete, the ViewportCache is removed (using
removeElement) and replaced by the actual viewport.
When the user interacts with the viewport content, the ViewportCache has a
system that redraws the regions that are likely to have changed during those
interactions. 
 
The weakness of this method is that the viewport must be added to the
display list after each scrolling operation : this process can be very long
(500-1000 ms) for very complex views.

The idea to solve this problem would be to add the actual viewport back only
when the user interacts with its content.

I found out a way to detect this type of interaction for example the user
clic the bitmap version of a ToggleButton on the ViewportCache, but I can
not reflect this interaction on the actual viewport i.e. the actual
ToggleButton should be toggled, when it’s added back to the display list.

Do you think it's feasible ? anyone has an idea ?



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Scroller-optimization-tp41774.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Mime
View raw message