[Interest] Performance tips for 'ticker' animation?

Cornelius Hald hald at icandy.de
Thu Aug 8 13:46:47 CEST 2013


I've now tried replacing the Text element with an Image element.
Performance is better but still not totally smooth. I'll guess I should
try different (more powerful) hardware now and hope for improvements in
future Qt versions.

Thanks for all the input!
Conny

On Wed, 2013-08-07 at 16:58 +0200, Cornelius Hald wrote:
> That sounds like an option and I'll give it a try using a manually
> created bitmap. If this works I'll consider creating this pixmap
> dynamically during runtime.
> 
> In the mean time I've tried optimizing the animation by putting the text
> on a rectangle with solid background and animating that rectangle
> instead of the text element. Also tried setting "layer.enabled: true" on
> that rectangle, but it didn't help anything.
> 
> If anyone has other ideas, please let me know.
> 
> Thanks,
> Conny
> 
> 
> On Wed, 2013-08-07 at 14:23 +0000, bill.king at here.com wrote:
> > I'm shooting in the dark here, but possibly the issue could be continued re-rendering of the text. I found this way of animating a ticker to be high in cost of cpu cycles. If you can render to a pixmap, then scroll/blit the pixmap through a view area, this ends up being a very low cost way of achieving animation (and for me, also resulted in much better fluidity)
> > 
> > --
> > 
> > Bill King
> > Senior QA Engineer
> > TRG Group
> >  
> > 52° 31' 52" N. 13° 23' 5" E
> > HERE, a Nokia business
> > 
> > Place of Business: Nokia gate5 GmbH, Invalidestrasse 117, 10115 Berlin, Germany - Commercial Register: Amtsgericht Charlottenburg, HRB 106443B - USt-IdNr.: DE 812 845 193 - Managing Directors: Dr. Michael Halbherr, Karim Tähtivuori
> > 
> > CONFIDENTIALITY NOTICE 
> > This e-mail and any attachments hereto may contain information that is privileged or confidential, and is intended for use only by the individual or entity to which it is addressed. Any disclosure, copying or distribution of the information by anyone else is strictly prohibited. If you have received this document in error, please notify us promptly by responding to this e-mail. Thank you.
> > 
> > 
> > > -----Original Message-----
> > > From: interest-bounces+bill.king=nokia.com at qt-project.org
> > > [mailto:interest-bounces+bill.king=nokia.com at qt-project.org] On Behalf Of
> > > ext Cornelius Hald
> > > Sent: Monday, 5 August 2013 11:49 AM
> > > To: Interest at qt-project.org
> > > Subject: [Interest] Performance tips for 'ticker' animation?
> > > 
> > > Hi guys,
> > > 
> > > I'm having a kiosk application displaying video and web content in FullHD
> > > using QtQuick 2.1 on Linux Qt 5.1.
> > > 
> > > Now I've added a text ticker that sits at the bottom of the screen and scrolls
> > > text from right to left.
> > > 
> > > If I only display the ticker, the animation is smooth. But as soon as I play a
> > > video or display (static) web content in the background, the ticker animation
> > > starts to stutter quite badly. Still the CPU load is only around 30%.
> > > 
> > > Does anyone have some tips on how to improve the visual smoothness of
> > > the ticker animation?
> > > 
> > > Below is the code I'm currently using to animate the ticker.
> > > 
> > > Thanks,
> > > Conny
> > > 
> > > 
> > > import QtQuick 2.1
> > > Rectangle {
> > >   id: root
> > >   property alias text: text.text
> > >   height: 100
> > >   color: "red"
> > > 
> > >   Text {
> > >     id: text
> > >     text: "This is some ticker text that gets displayed whenever you're seeing
> > > this ticker here, bla bla bla..."
> > >     color: "white"
> > >     font.pixelSize: 80
> > >     anchors.verticalCenter: parent.verticalCenter
> > > 
> > >     NumberAnimation on x {
> > >       from: root.width
> > >       to: -text.width
> > >       duration: text.width * 10
> > >       loops: Animation.Infinite
> > >       onFromChanged: restart()
> > >     }
> > >   }
> > > }
> > > 
> > > 
> > > _______________________________________________
> > > Interest mailing list
> > > Interest at qt-project.org
> > > http://lists.qt-project.org/mailman/listinfo/interest
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest





More information about the Interest mailing list