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

List:       kfm-devel
Subject:    Re: Konqueror slow with bigger images
From:       Allan Sandfeld Jensen <kde () carewolf ! com>
Date:       2006-05-19 10:10:15
Message-ID: 200605191210.15836.kde () carewolf ! com
[Download RAW message or body]

Here's a patch for clipping painting of images.

Unfortunately I get absolutely 0 performance improvement with the patch, but 
then again I had no problem with large image before either.

`Allan

["image-repaint.diff" (text/x-diff)]

Index: rendering/render_image.cpp
===================================================================
--- rendering/render_image.cpp	(revision 541858)
+++ rendering/render_image.cpp	(working copy)
@@ -322,12 +322,10 @@
                     s.setWidth(cWidth);
                 if(resizeCache.size() != s)
                     resizeCache.resize(s);
-
-                paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + \
                topBorder + topPad),
-                               resizeCache, scaledrect );
             }
-            else
-                paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + \
topBorder + topPad), resizeCache ); +            int sx = paintInfo.r.x() - _tx;
+            int sy = paintInfo.r.y() - _ty;
+            paintInfo.p->drawPixmap( QPoint( _tx + leftBorder + leftPad, _ty + \
topBorder + topPad), resizeCache, QRect(sx, sy, paintInfo.r.width(), \
paintInfo.r.height()) );  }
         else
         {
@@ -343,11 +341,11 @@
 //             qDebug("normal paint: offs.y(): %d, y: %d, diff: %d", offs.y(), y, y \
- offs.y());  //             qDebug("");
 
-//           p->setClipRect(QRect(x,y,w,h));
+             paintInfo.p->save();
+             paintInfo.p->setClipRect(paintInfo.r, QPainter::CoordPainter);
 
-
-//             p->drawPixmap( offs.x(), y, pix, rect.x(), rect.y(), rect.width(), \
rect.height() );  paintInfo.p->drawPixmap(offs, pix, rect);
+             paintInfo.p->restore();
 
         }
     }



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

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