[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Re: KisPainter::paintPolygon used in paintops
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2009-03-13 10:56:47
Message-ID: Pine.LNX.4.64.0903131151230.30788 () calcifer ! valdyas ! org
[Download RAW message or body]
On Fri, 13 Mar 2009, LukasT.dev@gmail.com wrote:
> Hi,
>
> I'm using paintPolygon in dynabrush and in spray.
> For paintops it has one disadvantage. It is really slow.
> I made callgrind log [1] where I use it in modified spray [2].
>
> To speed it up about of 4%, line 728 in kis_painter:
> KisPaintDeviceSP polygon = new KisPaintDevice(d->device->colorSpace(),
> "polygon");
> Why is string used? When I call paintPolygon in paintop, it is called e.g. 600
Ouch! That's bad -- the string is only used to give the paint device a name, which
is handy for debugging. Remove it! I'll check the rest of krita for places where
this really shouldn't be done.
> times in a stroke. Creating QString is quit slow. Is that string really
> needed? What is its purpose? Could we use e.g. int for id, if it is id?
>
> That method create a lot of objects like KisSelection,QImage, QPainter, QColor
>
> What would be the solution for paintops?
> Made own class for paintPolygon? Or optimalize paintPolygon somehow in
> KisPainter (I don't have idea how to cache created objects in KisPainter :( )?
It is possible -- as long as you keep using the same kispainter object, and use
that object in only one thread. Otherwise, you're sunk.
> I use paintPolygon for painting shapes like filled aliased circle,
I'd use paintEllipse for that -- but that calles paintPolygon in the end, too.
> polygon,etc..
I'm sure there are plenty of opportunities to tune this. I'll try to find some
time next week to look at the callgrind trace -- this weekend is going to be
horribly busy.
Boudewijn
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic