[Interest] qml performance with Qt5.2
Gunnar Sletta
gunnar.sletta at jolla.com
Thu Jun 26 07:59:28 CEST 2014
On 26 Jun 2014, at 06:03, Nancy Zou <Nancy.Zou at csr.com> wrote:
> Dear Gunnar & other friends:
>
> I have read the blog http://qt-project.org/doc/qt-5/qtquick-visualcanvas-scenegraph-renderer.html
> I have a few questions about section performance:
> 1 Make sure the texture atlas is used. The Image and BorderImage items will use it unless the image is too large.
>
> if the qml use Image item to load a jpg or png file, how could I check whether it use texture atlas. How large is the image to make it can't use texture atlas.
Hi Nancy,
The document you refer to also describes how to debug this. You put QSG_ATLAS_OVERLAY=1 into the environment and all atlas images will be tinted so you can spot them.
>
> 2 Clipping breaks batching . Never use on a per-item basis, inside tables cells, item delegates or similar. Instead of clipping text, use eliding. Instead of clipping an image, create a QQuickImageProvider that returns a cropped image.
>
> If my display resolution is 800*480, the background image is 1280*600, qml use image item to load the background image will be clipped. Is it right?
Clipping refers to Item.clip which is not what is happening in your usecase. Please note that the docs also state that using clipping to separate sections of the UI from each other is ok. Clipping becomes a problem when it is used on many individual elements and delegates as it prevents batching.
> If I want to avoid clip, should I write a cpp file use QQuickImageProvider to return a cropped image? Does qml item can't do it?
Since you are not clipping in the first place, the answer is no. Even if you had set a clip on the background image, that would probably not affect performance much since you are then clipping a single item and the answer is still no.
> One image item is usually a single batch, why the clipping can break it.
clipping is render state and each render state needs its own draw call, hence no batching.
> Why different image items can't batch together?
Images can batch together assuming they are all in the same atlas, different textures can not.
cheers,
Gunnar
>
> I am sorry to bother you for so much questions.
>
> Best Regards
> Nancy
>
>
>
>
> Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
> More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
> New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.
More information about the Interest
mailing list