New commits:
http://git.directfb.org/?p=libs/ilixi.git;a=commit;h=c60a58765ca45400ebecef690ec4986a80cbbae1
commit c60a58765ca45400ebecef690ec4986a80cbbae1
Author: Peter Tworek <[email protected]>
Date: Tue Oct 8 23:54:14 2013 +0200
SurfaceView: Set _renderedSource to false only if surface update was
scheduled.
The problematic scenario is:
1. New SurfaceView is created SurfaceView::_renderedSource is set to true.
2. An update event is received and queued in
SurfaceEventListener::_queue.
3. ilixi:Engine starts executing registered callback functions,
SurfaceEventListener::funck is called which in turn calls
SurfaceView::onSourceUpdate.
4. In case visible() returns false we don't actually call update(), but we
set SurfaceView::_renderedSource to false.
5. SurfaceView::onSourceUpdate returs true which means the event is
removed from SurfaceEventListener::_queue.
6. Because we never really update()'d the SurfaceView,
SurfaceView::paint() will not be called until surface visibility
changes. In short SurfaceView::renderedSouce will remain false for
as long as surface is invisible().
At this point if the SurfaceView remains invisible but we do reveive
and update event for it the compositor will enter a tight loop. The
SurfaceEventListener::_queue will contain the event so
SurfaceEventListener::funck() will keep calling
SurfaceView::onSourceUpdate. Because SurfaceView::_renderedSource is
false the function will exit almost immediately returning false. This
means the event wont be removed from SurfaceEventListener::_queue. The
end result is the compositor will keep using 100% CPU doing nothing.
The solution is to set the value of SurfaceView::_renderedSource to
false only in case we expect SurfaceView::paint() will be called
(visible() returns true).
Signed-off-by: Peter Tworek <[email protected]>
ilixi/ui/SurfaceView.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
http://git.directfb.org/?p=libs/ilixi.git;a=commit;h=b8ef01157e778cc2d782236c34c766af8d510082
commit b8ef01157e778cc2d782236c34c766af8d510082
Author: Peter Tworek <[email protected]>
Date: Tue Oct 8 23:54:13 2013 +0200
SurfaceEventListener: Cancel callback if there are no pending events.
The return value from the function determines if ilixi::Engine will keep
the callback function alive. If there are no events to process in the
queue we can safely tell the Engine to unregister the callback. It can
be re-added when new events are added to the queue.
Signed-off-by: Peter Tworek <[email protected]>
ilixi/core/SurfaceEventListener.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
_______________________________________________
directfb-cvs mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-cvs