Bug 63555 - [Qt] GraphicsContext::clipToImageBuffer does not support scale transformation
Summary: [Qt] GraphicsContext::clipToImageBuffer does not support scale transformation
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Igor Trindade Oliveira
Keywords: Qt, QtTriaged
Depends on:
Reported: 2011-06-28 13:10 PDT by Igor Trindade Oliveira
Modified: 2011-06-29 08:57 PDT (History)
2 users (show)

See Also:

Patch (2.05 KB, patch)
2011-06-28 13:17 PDT, Igor Trindade Oliveira
kling: review-
Details | Formatted Diff | Diff
Patch (2.90 KB, patch)
2011-06-29 06:52 PDT, Igor Trindade Oliveira
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Trindade Oliveira 2011-06-28 13:10:43 PDT
Qt implementation of GraphicsContext::clipToImageBuffer calls internally ImageBuffer::clip.
ImageBuffer::clip creates a alphaMask and push it in TransparencyLayer. However if GraphicsContext does a scale
transformation the alphaMask is not scaled.
Comment 1 Igor Trindade Oliveira 2011-06-28 13:17:09 PDT
Created attachment 98963 [details]

Proposed patch.
Comment 2 Andreas Kling 2011-06-28 14:32:38 PDT
Comment on attachment 98963 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=98963&action=review

> Source/WebCore/ChangeLog:10
> +        No new tests. (OOPS!)

Oops indeed! The commit-queue will choke on this line, replace it with one of these three:
1) Tests: list of tests that exercise this change...
2) No new tests because...
3) Awkward silence.

> Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp:167
> +    QRectF deviceClip = context->platformContext()->transform().mapRect(floatRect);
> +    if (alphaMask.width() != deviceClip.width() || alphaMask.height() != deviceClip.height())
> +        alphaMask = alphaMask.scaled(deviceClip.width(), deviceClip.height());

We should do this in GraphicsContext::pushTransparencyLayerInternal() instead, then we avoid doing mapRect() twice, and ImageBuffer doesn't need to know about any painter transforms.
Comment 3 Igor Trindade Oliveira 2011-06-29 06:52:48 PDT
Created attachment 99082 [details]

Proposed patch. Update ChangeLog and move scale complexity to GraphicsContext::pushTransparencyLayerInternal.
Comment 4 WebKit Review Bot 2011-06-29 08:55:38 PDT
The commit-queue encountered the following flaky tests while processing attachment 99082 [details]:

http/tests/media/video-cancel-load.html bug 56797 (authors: annacc@chromium.org, eric.carlson@apple.com, jamesr@chromium.org, and vrk@chromium.org)
The commit-queue is continuing to process your patch.
Comment 5 WebKit Review Bot 2011-06-29 08:57:05 PDT
Comment on attachment 99082 [details]

Clearing flags on attachment: 99082

Committed r90020: <http://trac.webkit.org/changeset/90020>
Comment 6 WebKit Review Bot 2011-06-29 08:57:09 PDT
All reviewed patches have been landed.  Closing bug.