[Panel-devel] svg rendering
Aaron J. Seigo
aseigo at kde.org
Wed Oct 31 04:13:33 CET 2007
On Tuesday 30 October 2007, Sean Harmer wrote:
i haven't tested it yet, sorry =) i'm busy breaking krunenr. however:
> * I've added a function to Plasma::Svg to paint only the dirty rects rather
> than the entire SVG but I've not modified any applets to take advantage of
> this yet and so it is completely untested.
that's great news for, e.g. desktop wallpapers. however this:
+void Svg::paint(QPainter* painter,
+ const QStyleOptionGraphicsItem *option,
+ const QString& elementID)
ties it pretty tightly to QGraphicsItem, which we don't want.
what we probably want is:
void Svg::paint(QPainter* painter,
const QRectF& dest,
const QRectF& src,
const QString& elementID)
{
// If we have a valid, rendered version of the SVG, then paint it. In this
case we
// can just blit the region covered by option->exposedRect.
QPixmap* pm = d->findInCache(elementID);
if (pm) {
painter->drawPixmap(dest, *pm, src);
}
}
and one would call it with:
void Svg::paint(painter, options->exposedRect(), options->exposedRect());
this would make it usable by non-QGraphicsItem objects.
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071030/8edf1467/attachment.pgp
More information about the Panel-devel
mailing list