About the experimental paintop optimization

Dmitry Kazakov dimula73 at gmail.com
Sun Dec 26 16:10:13 CET 2010


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.

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20101226/c6b7189a/attachment.htm 


More information about the kimageshop mailing list