Other in Graphics
Begin porting the KolourPaint paint engine to kpPainter, which abstracts all
_document_ drawing operations KolourPaint needs to do. And code simplifications.
Functionally nothing has changed except:
* Rectangles / rounded rectangles and ellipses are no longer 1 pixel higher and
wider than they should be and are now bounded by the dragged out rectangle
(rather than having the centres of their corners on the corners of the
dragged out rectangle)* Resizing documents now works again
* The fill style widget is rendered correctly again
This will eventually allow us to drop Arthur/Qt4 and use a proper paint engine. About kpPainter:
1. It draws separately on the RGB layer and mask layers (needed because without
XRENDER, drawing on the RGB layer does not touch the mask layer - this
is similar to Qt3 with or without XRENDER). This drawing pattern is
now centralised in ::Draw() instead of being spread all over the code.
To understand the pointer to member function syntax, read http://clarencedang.blogspot.com/2006/06/c-class-member-function-pointers.html .
2. Hides the mask layer before drawing on the RGB layer (with XRENDER, if it
sees a mask, while it will draw on it, it will also attempt to convert the mask to an alpha channel but
experiments show that it corrupts it; in any case, we don't want to
exploit XRENDER's alpha channel capabilities since a) you need XRENDER
b) accessing the mask when you have an alpha channel is a _very_ expensive
operation [http://clarencedang.blogspot.com/2006/04/so-whats-up-with-kolourpaint-in-kde4.html])3. As not all of KolourPaint has yet been ported to this new scheme
without XRENDER composition modes / alpha channels, transparency
still performs badly and is extremely buggy (see 2. above).
4. kpColor is supposed to abstract colour models for the document
5. kpImage is supposed to abstract image data for the document
(lossless, not tied to screen) but is currently a typedef for QPixmap
so nothing has changed yet - however, it is trivially easy to port from QPixmap