Plasma::Svg question

Zack Rusin zack at kde.org
Mon Oct 6 23:21:27 CEST 2008


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



More information about the Plasma-devel mailing list