Bug 74600 - [Qt] Graphics are pixelated after scaling/rotating
Summary: [Qt] Graphics are pixelated after scaling/rotating
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P3 Major
Assignee: Nobody
URL:
Keywords:
Depends on: 113405
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-15 04:29 PST by Magnesus
Modified: 2013-04-11 09:21 PDT (History)
3 users (show)

See Also:


Attachments
workaround (patch) (2.02 KB, patch)
2012-06-14 04:23 PDT, Ivan Shvedunov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Magnesus 2011-12-15 04:29:57 PST
Transforming images in QtWebKit from Qt 4.8.0 (QtWebKit 2.2.1) gives a pixelated image that after a second switches to smooth version. It looks very bad.
It's on Windows XP using Qt 4.8.0. Steps to reproduce: scale a PNG image in img tag. Watch how it behaves after scaling.
Comment 1 Magnesus 2011-12-15 04:31:17 PST
The same graphics are always smoothly transformer with the same settings on Qt 4.7.0.
Comment 2 Magnesus 2011-12-17 01:02:04 PST
*smoothly transformed
Comment 3 Magnesus 2012-01-16 00:09:17 PST
Will this be resolved soon? I have to decide if to stick with Qt or change to sth different because of this issue.

More info: When transforming - rotating, scaling or even moving PNG images in QtWebKit they are pixelated for a long while and then suddently they are smooth.
Comment 4 Magnesus 2012-02-06 00:38:32 PST
Still present in latest Qt4.8.0 (QtWebKit.dll has 4.9.0 version).
Comment 5 Magnesus 2012-02-06 00:52:22 PST
Here is a before, after image: http://wieza.iq.pl/beforeafter.png (left: when the image is moving, right: half a second after it stops).
Comment 6 Magnesus 2012-02-06 01:05:12 PST
I also found this bug reports:
https://bugs.webkit.org/show_bug.cgi?id=41036
http://codereview.chromium.org/2881020/show

Maybe they are related?
Comment 8 Magnesus 2012-02-16 00:15:44 PST
Does anyone even read these?
Comment 9 Ivan Shvedunov 2012-06-14 04:23:10 PDT
Created attachment 147551 [details]
workaround (patch)

I was affected by that problem too. When using sprite-based
animation (rapidly changing backgrounds) the animated image
becomes pixelated during frame changes. I've changed
GraphicsContextQt.cpp so it always uses
QPainter::SmoothPixmapTransform. After that change the problem
with non-smooth scaling disappeared and I didn't notice
any performance hit. Your mileage may vary though.
Comment 10 Ivan Shvedunov 2012-06-14 04:25:48 PDT
Note that my patch isn't meant for inclusion in QtWebKit, it's
just a temporary fix for the problem (thus it comments
out some lines).
Comment 11 Allan Sandfeld Jensen 2013-03-27 04:44:43 PDT
This sounds like intentional behavior. Using low interpolation during animations, and high when it is finished. That is done for performance reasons.

To avoid this, you need accelerated compositing which is enabled by default in Qt 5 and QtWebKit 2.3.
Comment 12 Allan Sandfeld Jensen 2013-03-27 07:06:48 PDT
(In reply to comment #11)
> This sounds like intentional behavior. Using low interpolation during animations, and high when it is finished. That is done for performance reasons.
> 
> To avoid this, you need accelerated compositing which is enabled by default in Qt 5 and QtWebKit 2.3.

Forget that. I am going to make it configurable, see bug 113405.
Comment 13 Allan Sandfeld Jensen 2013-04-11 09:21:47 PDT
With the fix for bug #113405 landed. I will consider the issue fixed. 

The current default behavior is working as designed, and can now be disabled with image-rendering: optimizeQuality (or image-rendering: smooth as it will be called in CSS4 Images when that gets activated).