Plasma::Svg question

Marco Martin notmart at gmail.com
Wed Oct 8 18:06:38 CEST 2008


On Wednesday 08 October 2008, Toussis Manolis wrote:
> it's an applet that gets painted every 10 o more seconds.
> So I think setOpacity isn't so expensive. (and ofcourse much easier)
> Any problem with that? (I mean the refresh is very sparse)
problem is that the applet won't get repainted only when it asks explicitly 
but also when is dragged, overlapped with another, handle appearing and 
similar events.
if the part you want composed really won't change in a 10 seconds time you can 
paint with the method you want a pixmap, caching it and then in paintinterface 
just paint the pixmap if has data still valid

Cheers,
Marco Martin

> On Tuesday 07 October 2008 00:21:27 Zack Rusin wrote:
> > On Monday 06 October 2008 16:47:06 Rafael Fernández López wrote:
> > > Hi,
> > >
> > > > you can also call setOpacity on the QPainter directly, but that can
> > > > *very* slow and that above method is usually faster, and at worst the
> > > > same speed.
> > >
> > > Aaron explained it pretty well, and please, don't use setOpacity (as
> > > also Aaron did suggest). I want to put emphasis here... since
> > > setOpacity disables all the hardware acceleration (as Fredrik said:
> > > "the kiss of death").
> >
> > I take your emphasis, headbutt it and fart in its face while its down.
> >
> > It's just so happens that Plasma's main platform is broken right now, but
> > due to its brokenness you're emphasizing that you need to make all other
> > systems that Plasma will be running on slower.
> > It's certainly ok to optimize for the main platform but have knowledge of
> > why you're doing so.
> >
> > setOpacity is bad only if you're working on an X11 system and are drawing
> > to a QPixmap or a QWidget.
> > If you're drawing to a qimage or any of the surfaces that use
> > QGLPaintEngine then not using setOpacity is insane and using the extra
> > composition is actually the slow path. Not to mention that drawing svg's
> > on +90% of X11 systems will be faster if done on a qimage and then
> > blitted, rather than drawn on a QWidget/QPixmap directly.
> >
> > z
> >
> > _______________________________________________
> > Plasma-devel mailing list
> > Plasma-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/plasma-devel




More information about the Plasma-devel mailing list