About the experimental paintop optimization
LukasT.dev@gmail.com
lukast.dev at gmail.com
Sun Dec 26 22:29:44 CET 2010
Hello,
On Sunday 26 December 2010 16:10:13 Dmitry Kazakov wrote:
> Hi, all!
>
> I guess this paintop can be greatly optimized. When you move your mouse,
> the only region changed is contained inside the borders of the rectangle
> formed by the points:
>
> (base_point, prev_point, current_point),
>
> where base_point - is the point, where the stroke has been started,
> current_point - the point passed from mouseMoveEvent,
> prev_point - the point passed from the previous mouseMoveEvent.
>
>
> So we needn't to repaint the whole stroke. We need to update this triangle
> only. Lukas said, that the generation of the polygon is done using
> QPainter, but i think this is hardly a problem. We can generate the whole
> mask with a QPainter, then split the triangle into a couple of rectangles.
> Then we have to copy these only these few rectangles into
> KisFixedPaintDevice, paint them onto the destination device, and call
> setDirty for them. I think this will be much faster and efficient.
Go for it! I'm not sure if I get it.
I wrote that paintop and I tend to avoid this kind of optimizations from the
start as I like the code to be simple as much as possible.
More information about the kimageshop
mailing list