[Qt-interest] QGraphicsOpacityEffect performance worse than QGraphicsItem::setOpacity()
Fred Duarte
fred.duarte at openbossa.org
Wed Oct 14 20:58:29 CEST 2009
The QGraphicsBlurEffect in combination with a QPropertyAnimation (Kinetic
framework)
is also signifcantly slow.
I can't tell whether is the Animation object or the GraphicsEffect object
that is causing the code to run slow.
On Wed, Oct 14, 2009 at 12:54 PM, Josiah Bryan <
jbryan at productiveconcepts.com> wrote:
> I'm incredibly excited about the new QGraphicsEffect "module" in Qt 4.6.
> Since the release of the beta last night (today?), I've integrated two
> of the effects (opacity and drop shadow) into the project I've been
> working on for the past two months (http://code.google.com/p/dviz/).
>
> What I found, especially with regards to the opacity effect, was quite
> surprising to me. Specifically, the performance of using
> QGraphicsOpacityEffect to cross fade between QGraphicsItem's is
> *considerably* worse than just using QGraphicsItem::setOpacity()
> directly. A 30 frame, 250ms-long cross fade takes > 5 - 10 seconds due
> to painting using QGraphicsOpacityEffect. Whereas using straight
> QGraphicsItem::setOpacity(), we hit around 275ms - 500ms from start to
> completion of the crossfade. (The 250ms is the target time, the time
> between steps in the crossfade is calculated as 250 / 30 (QTimer is used
> to trigger the frames). The actual painting of the items often causes
> the actual time to take a bit longer than 1ms to complete each frame,
> pushing it out past the 250ms length. When using QGraphicsOpacityEffect,
> we're hitting north of 150ms - 250ms *per repaint*. Under straight
> setOpacity(), its around 1 - 4ms per repaint. And this is a *simple*
> scene - two rectangular QGraphicsItems - and thats it!
>
> An additional blow to my excitement was the performance of
> QGraphicsDropShadowEffect on a simple rectangular custom QGraphicsItem.
> Changing the blur radius, for example, from 1px to 5px takes around
> 1/2second to re-render the scene. (Whereas, when rendering a "cheap"
> drop shadow as just using drawRect() with a different color and offset
> is imperceptibly fast.)
>
> Those are the two major "problems" I've seen in this Qt 4.6 beta - and
> that is on both Windows XP Pro and Linux (FC 8), with both very high end
> graphics cards, dual / quad processor, 4 GB RAM. So the system isn't the
> lag - it seems the library code is (at least on this end.) Anyone else
> seeing similar problems?
>
> Thanks for your time!
>
> Cheers!
> -josiah
>
> --
>
> -=-=-=-=-=-=-=-=-=-=-=-=-
> Josiah Bryan
> Productive Concepts, Inc.
> jbryan at pciint.com
> (765) 964-6009, ext. 224
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Frederico Simas Duarte
MLS - Mobile Linux Software
INDT - Nokia Institute
http://fredyduarte.net/blog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091014/04c4d562/attachment.html
More information about the Qt-interest-old
mailing list