[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    painting suggestions
From:       Riccardo Iaconelli <riccardo () kde ! org>
Date:       2008-09-20 20:04:56
Message-ID: 200809202204.57003.riccardo () kde ! org
[Download RAW message or body]

hello,
so, I have the following code:

        QPixmap temp = *d->p;
        QPainter p(&temp);
        p.setCompositionMode(QPainter::CompositionMode_Source);
        p.drawPixmap(0, 0, *d->p);
        p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
        p.fillRect(temp.rect(), QColor(0, 0, 0, qreal(d->frame)*5.0/100.0));
        p.end();
        painter->drawPixmap(d->optV4.rect, temp);

where d->p is a cached pixmap of an expensive operation obtained through 
manipuladig a QImage, and shouldn't be changed for this reason.
I was wondering if that's the best approach (which requires a pixmap copy) or 
it's faster to call painter->setOpacity and then drawPixmap.

As my knowledge of the inner Qt painting system is not so wide, I'm asking 
here. =)

if you have questions, or need more code, please ask.

Bye,
-Riccardo
p.s. aye, that's raptor code, if someone wants more context (not sure if it's 
needed)
-- 
GPG key:
3D0F6376
When encrypting, please encrypt also for this subkey:
9EBD7FE1
-----
Pace Peace Paix Paz Frieden Pax Pokój Friður Fred Béke 和平
Hasiti Lapé Hetep Malu Mир Wolakota Santiphap Irini Peoch שלום
Shanti Vrede Baris Rój Mír Taika Rongo Sulh Mir Py'guapy 평화

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic