Revision 550263

Go back to digest for 11th June 2006

Other in Graphics

Clarence Dang committed changes in /trunk/KDE/kdegraphics/kolourpaint:

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 .

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 [])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
to kpImage.

File Changes

Added 4 files
  • /trunk/KDE/kdegraphics/kolourpaint/pixmapfx
  •   /kpimage.cpp
  •   /kpimage.h
  •   /kppainter.cpp
  •   /kppainter.h
Modified 12 files
  • /trunk/KDE/kdegraphics/kolourpaint
  •   /CMakeLists.txt
  •   /kpdocument.cpp
  •   /kpdocument.h
  •   /NEWS
  •   /pixmapfx/kppixmapfx.cpp
  •   /pixmapfx/kppixmapfx.h
  •   /tools/kptoolpolygon.cpp
  •   /tools/kptoolpolygon.h
  •   /tools/kptoolrectangle.cpp
  •   /tools/kptoolrectangle.h
  •   /widgets/kptoolwidgetfillstyle.cpp
  •   /widgets/kptoolwidgetfillstyle.h
16 files changed in total