Bug 32405

Summary: [Qt] canvas clipping is buggy
Product: WebKit Reporter: Noam Rosenthal <noam>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: ariya.hidayat, benjamin, commit-queue, cshu, hausmann, laszlo.gombos, noam
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Fix GraphicsContext::roundToDevicePixels in Qt none

Description Noam Rosenthal 2009-12-10 20:11:02 PST
test case: http://glimr.rubyforge.org/cake/canvas.html, choose ImageTest in the combo box

The image rotates and moves very slowly and with a lot of artifacts and flickers, compared to Safari/Chrome.
Comment 1 Benjamin Poulain 2009-12-11 05:21:49 PST
Confirmed.

Here is the direct link to the test : http://glimr.rubyforge.org/cake/canvas.html#KeyboardTest

The image should not be clipped when transformed.
Comment 2 Noam Rosenthal 2010-02-13 19:11:12 PST
Created attachment 48713 [details]
Fix GraphicsContext::roundToDevicePixels in Qt

I found the source of the problem - our GraphicsContext::roundToDevicePixels function is wrong, as it doesn't make the right calculation in the case of rotating images.
The attached fix makes that function completely equivalent to the CG implementation, and rotating canvas images now look fine!
Comment 3 Simon Hausmann 2010-02-15 07:14:23 PST
Nice! I've seen this bug a few times in the past.

Any chance that this is also covered by an existing but currently skipped canvas layout test?

Adding Ariya to CC, he's more qualified than me to review this piece :)
Comment 4 Ariya Hidayat 2010-02-16 00:30:31 PST
Comment on attachment 48713 [details]
Fix GraphicsContext::roundToDevicePixels in Qt

Looks good.
Comment 5 WebKit Commit Bot 2010-02-16 01:17:50 PST
Comment on attachment 48713 [details]
Fix GraphicsContext::roundToDevicePixels in Qt

Clearing flags on attachment: 48713

Committed r54811: <http://trac.webkit.org/changeset/54811>
Comment 6 WebKit Commit Bot 2010-02-16 01:18:03 PST
All reviewed patches have been landed.  Closing bug.