From kfm-devel Fri May 19 10:10:15 2006 From: Allan Sandfeld Jensen Date: Fri, 19 May 2006 10:10:15 +0000 To: kfm-devel Subject: Re: Konqueror slow with bigger images Message-Id: <200605191210.15836.kde () carewolf ! com> X-MARC-Message: https://marc.info/?l=kfm-devel&m=114803348811808 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_HmZbELqC0O4YOP4" --Boundary-00=_HmZbELqC0O4YOP4 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --Boundary-00=_HmZbELqC0O4YOP4 Content-Type: text/x-diff; charset="iso-8859-15"; name="image-repaint.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="image-repaint.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(); } } --Boundary-00=_HmZbELqC0O4YOP4--