[SailfishDevel] Upcoming behavioural change with how graphics resources are handled.

Gunnar Sletta gunnar at sletta.org
Mon Sep 29 18:36:52 UTC 2014


On 29 Sep 2014, at 16:43, Mohammed Hassan <mohammed.hassan at jolla.com> wrote:

> On Sat, 27 Sep 2014 16:28:42 +0000
> Kimmo Lindholm <Kimmo.Lindholm at eke.fi> wrote:
> 
>> Hi,
>> 
>> Just wanted to give a follow-up on this topic;
>> 
>> You are affected if you are drawing on Canvas (and don't want to
>> repaint it completely when returning to application) Symptom is that
>> canvas gets cleared when going away from application (minimizing it
>> to cover)
>> 
>> The simplest way to not allow releasing, add two middle lines in your
>> main() as suggested in original email;
>> 
>> view->setSource(SailfishApp::pathTo("qml/ankkuri.qml"));
>> view->setPersistentOpenGLContext(true); 
>> view->setPersistentSceneGraph(true);
>> view->show();
> 
> I'd personally not recommend doing that just because you don't want to
> repaint. Releasing the resources decreases the memory footprint of the
> application when minimized and allows the system to stay more
> responsive.
> 
> If a lot of apps start to not release the GL context and scene graph GL
> bits then that will negatively impact the whole system.
> 
> Just my 0.02

I completely agree :) 

Though setting the persistent GL/SG flags is very helpful "to get it running" after the change over, I would suggest that applications try to avoid it when possible.

For the case of Canvas, the problem arises if the application uses Canvas.FramebufferObject AND relies on the contents of the canvas not being cleared between calls to Canvas.onPaint. It should be a pretty rare scenario. However, for this specific scenario, there is no good alternative, so it is the tool of choice.

cheers,
Gunnar

www.sletta.org

> 
> Cheers,
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org




More information about the Devel mailing list