[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    [PATCH] - Major performance, minor painting bug in kpresenter
From:       "Maksim Orlovich" <maksim () cs ! cornell ! edu>
Date:       2004-12-21 16:04:18
Message-ID: 0EBBFE97A53E7A47BACB7A550B7439172509D2 () EXCHVS2 ! cs ! cornell ! edu
[Download RAW message or body]

--===============0694089434==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C4E776.B9B44F28"

This is a multi-part message in MIME format.


Hi... Currently, there is a bug in how KPPixmapObject caches/draws which
causes it to resize the pixmap every time it draws -- causing pixmap -> =
image
-> pixmap conversion every time, which causes KPresenter to be slowwww =
with
embedded images, and which also produces an unpainted line at border.

The reason for this is that when the cached pixmap is generated, it is =
drawn
to a rectangle that excludes the border. However, the pixmap generator =
makes
it full-sizes, including the border. Hence, at each painting it has to =
resize
it ~2 pixels down, and has double-border..

Patch attached.
Thanks,
Maksim

--- kppixmapobject.cc   27 Aug 2003 14:45:39 -0000      1.88
+++ kppixmapobject.cc   21 Dec 2004 16:02:36 -0000
@@ -381,9 +381,7 @@ void KPPixmapObject::draw( QPainter *_pa

     if ( !drawContour )
     {
-        QRect rect( (int)( penw ), (int)( penw ),
-                    (int)( _zoomHandler->zoomItX( ow ) - 2 * penw ),
-                    (int)( _zoomHandler->zoomItY( oh ) - 2 * penw ) );
+        QRect rect( 0, 0, (int)( _zoomHandler->zoomItX( ow ) ), (int)(
_zoomHandler->zoomItY( oh ) ) );
         // ### HACK QT seems not to be able to correctly compare =
QVariant
         bool variants1;
         if (m_ie_par1.isNull())

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>[PATCH] - Major performance, minor painting bug in kpresenter</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Hi... Currently, there is a bug in how KPPixmapObject caches/draws \
which causes it to resize the pixmap every time it draws -- causing pixmap -&gt; \
image -&gt; pixmap conversion every time, which causes KPresenter to be slowwww with \
embedded images, and which also produces an unpainted line at border.<BR> <BR>
The reason for this is that when the cached pixmap is generated, it is drawn to a \
rectangle that excludes the border. However, the pixmap generator makes it \
full-sizes, including the border. Hence, at each painting it has to resize it ~2 \
pixels down, and has double-border..<BR> <BR>
Patch attached.<BR>
Thanks,<BR>
Maksim<BR>
<BR>
--- kppixmapobject.cc&nbsp;&nbsp; 27 Aug 2003 14:45:39 \
                -0000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.88<BR>
+++ kppixmapobject.cc&nbsp;&nbsp; 21 Dec 2004 16:02:36 -0000<BR>
@@ -381,9 +381,7 @@ void KPPixmapObject::draw( QPainter *_pa<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp; if ( !drawContour )<BR>
&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QRect rect( (int)( penw ), (int)( penw \
                ),<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
                (int)( _zoomHandler-&gt;zoomItX( ow ) - 2 * penw ),<BR>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
(int)( _zoomHandler-&gt;zoomItY( oh ) - 2 * penw ) );<BR> \
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QRect rect( 0, 0, (int)( \
_zoomHandler-&gt;zoomItX( ow ) ), (int)( _zoomHandler-&gt;zoomItY( oh ) ) );<BR> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // ### HACK QT seems not to be able \
to correctly compare QVariant<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
bool variants1;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if \
(m_ie_par1.isNull())<BR> </FONT>
</P>

</BODY>
</HTML>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

--===============0694089434==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic