Bug 50807 - [Qt] Possibility to reduce extra SmoothPixMapTransform during image drawing
Summary: [Qt] Possibility to reduce extra SmoothPixMapTransform during image drawing
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-12-10 04:18 PST by chunrong
Modified: 2011-01-28 18:42 PST (History)
2 users (show)

See Also:


Attachments
A simple test page (1.46 KB, text/html)
2010-12-10 04:20 PST, chunrong
no flags Details
The tested image for the test page (10.90 KB, image/pjpeg)
2010-12-10 04:22 PST, chunrong
no flags Details
The proposed simple patch (668 bytes, patch)
2010-12-10 04:23 PST, chunrong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chunrong 2010-12-10 04:18:11 PST
I see that current Webkit performs quite a few of SmoothPixmapTransform during image drawing. Some of them might be optimizable.
  Attach patch wants to disable the transform in drawing images which are scaled to smaller size without rotation.
I also attached a simple test webpage which can shows 6X~8X performance difference in my testing.

--- qt.old/ImageQt.cpp	2010-12-08 15:26:15.237726493 +0800
+++ qt/ImageQt.cpp	2010-12-09 18:22:20.817755997 +0800
@@ -189,6 +189,13 @@
 
     // Test using example site at
     // http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html
+    float tsw = src.width();
+    float tsh = src.height();
+    float tw = dst.width();
+    float th = dst.height();
+    if( tw <= tsw && th <= tsh && ctxt->platformContext()->combinedTransform().type() <= QTransform::TxScale){
+        painter->setRenderHint(QPainter::SmoothPixmapTransform, false);
+    }
     painter->drawPixmap(dst, *image, src);
 
     ctxt->restore();
Comment 1 chunrong 2010-12-10 04:20:33 PST
Created attachment 76181 [details]
A simple test page
Comment 2 chunrong 2010-12-10 04:22:30 PST
Created attachment 76182 [details]
The tested image for the test page
Comment 3 chunrong 2010-12-10 04:23:42 PST
Created attachment 76183 [details]
The proposed simple patch
Comment 4 Benjamin Poulain 2011-01-28 18:42:55 PST
Please follow http://trac.webkit.org/wiki/QtWebKitBugs when reporing bug here.

Closing as invalid, this ha already been discussed on the mailing list. Note that when you include a patch, you should set the review flag (r?) and include a changelog. See https://trac.webkit.org/wiki/QtWebKitContrib.