[Qt-interest] QGraphicsOpacityEffect performance worse than QGraphicsItem::setOpacity()
Josiah Bryan
jbryan at productiveconcepts.com
Thu Oct 15 16:39:04 CEST 2009
Josiah Bryan wrote:
> This is such a disappointment that I'm looking at ripping the code for
> the drop shadow out of the library and just using it straight in my own
> app and do my own caching if the library can't provide acceptable
> performance.
Well, I'm over my disappointment and I've moved on, now that I've got
the desired effects without having to use the library itself. I've
copied the static blurred() implementation from qpixmapfilters.cpp into
my own code base (ImageFilters.cpp in r193 at
http://code.google.com/p/dviz/source/detail?r=193), and after reading
the dropshadow algorithm in the same file, implemented it in my text
rendering item. For the implementation, see line 307 in TextBoxContent.cpp:
http://code.google.com/p/dviz/source/browse/trunk/src/items/TextBoxContent.cpp?spec=svn193&r=193#307
In addition to integrating the blur code directly, I'm using very
aggressive app-wide pixmap caching using QPixmapCache. All graphics
items in my app use underlying QObject-based models (AbstractVisualItem)
that fire signals when an attribute is changed and keep an internal
quint32 revision counter. I only dirty the rendered shadow cache when
the revision counter on the underlying model changes. So I could create
and destroy a "visual delegate" for the model item multiple times
without having to re-render the cached pixmap. Anyway, as I said, very
aggressive caching. May not be appros for others, but works for my app.
Hope that helps any who may follow in similar frustrations.
Cheers!
-josiah
--
-=-=-=-=-=-=-=-=-=-=-=-=-
Josiah Bryan
Productive Concepts, Inc.
jbryan at pciint.com
(765) 964-6009, ext. 224
More information about the Qt-interest-old
mailing list