[Okular-devel] playground/graphics/okular

Tobias Koenig tokoe at kde.org
Mon Nov 20 10:49:03 CET 2006


On Mon, Nov 20, 2006 at 07:53:35AM +0000, Tobias Koenig wrote:
Hi,

I commited my pending changes this morning, here some comments to the
single points:

> Add the following functionality:
> 
>  * Bring QPixmap* back to make Albert happy ;)
QPixmap pointers are used to store the page content again, maybe some of
the generators can be ported to use QPixmap directly and not
QImage->QPixmap...

>  * Store only one QPixmap per page/size and rotate it directly
The pixmap is rotated directly now, so we don't need an extra copy where
the rotated version is generated from.

>  * Rotate ObjectRects (boundary)
I added a method ObjectRect::transform( const QMatrix& ) which is called
in Page::rotateAt() and Page::setObjectRects() to rotate the boundary
rects of the ObjectRect objects.

>  * Rotate Annotations (point coordinates)
When AnnotationObjectRect::transform(...) is called, it forwards the
call to the new Annotation::transform(...) method that transforms the
annotation specific coordinates. I added additional member variables
(e.g. inkPaths vs. transformedInkPaths) where the transformed (rotated)
coordinates are stored. The PagePainter makes use of the transformed
coordinates to draw the annotations.

>  * Don't reload pixmaps, ObjectRects and annotations on rotation
Since pixmaps and ObjectRects are rotated by Okular::Page we don't have
to query the generator on rotation. That's a big performance improvement!
However the representation looks ugly, because page is relayouted but
filled with the old content before the rotated content is calculated and
shown.

I guess avoiding some updates at some points in code does the trick,
however I've no clue where these points are ;)

3 problems left:

1) Rotation of SearchText information and Pino's new InversSearch
   coordinates

2) @Pino: The poppler generator somehow returns a scaled pixmap when you
          rotate the page. I've no clue why, because I can't find the
          code where poppler is told that the orientation has changed.
          Poppler should _always_ return pixmap, rects and texts in
          default orientation!

3) I discovered a strange bug yesterday evening, when you load a
   document and scroll up and down with mouse fastely, okular crashes
   because of an assert in QList::operator[] in PagePainter::paintPageOnPainter,
   will investigate it later...

I hope my changes were ok, if you have comments, suggestions etc just
send me a mail ;)

Ciao,
Tobias
-- 
Separate politics from religion and economy!
The Council of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.kde.org/pipermail/okular-devel/attachments/20061120/12463bc0/attachment.pgp 


More information about the Okular-devel mailing list