[webkit-qt] performance opportunities in graphics processing
chunrong lai
chunronglai at gmail.com
Fri Dec 10 04:39:59 PST 2010
As filed in https://bugs.webkit.org/show_bug.cgi?id=50807,
attached updated patch tries to disable the SmoothPixmapTransforms in
drawing images which are scaled to smaller size but without rotation. Does
it make sense? I can see it improves the performance of the attached test
page by 6X~7X. :-)
diff -BburN qt.old/ImageQt.cpp qt/ImageQt.cpp
--- 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);
On 10/26/2010 06:11 PM, Benjamin Poulain wrote:
> Hi
> I am not sure why you think that.
>* *This will give aliasing when you rotate + scale.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20101210/e79cac9e/attachment-0001.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20101210/e79cac9e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Interpolation.4.7.0.patch
Type: application/octet-stream
Size: 667 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20101210/e79cac9e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.jpg
Type: image/jpeg
Size: 11159 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20101210/e79cac9e/attachment-0001.jpg>
More information about the webkit-qt
mailing list