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

List:       kde-panel-devel
Subject:    Re: [Panel-devel] svg rendering
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2007-10-31 3:13:33
Message-ID: 200710302113.36998.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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

[Attachment #5 (application/pgp-signature)]

_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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