Bug 41111 - [WinCairo] Rendering of themed elements on a layer with opacity produces nothing
Summary: [WinCairo] Rendering of themed elements on a layer with opacity produces nothing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 41113
  Show dependency treegraph
 
Reported: 2010-06-23 16:35 PDT by Martin Robinson
Modified: 2010-06-28 09:01 PDT (History)
2 users (show)

See Also:


Attachments
Failing test case (247 bytes, text/html)
2010-06-23 16:35 PDT, Martin Robinson
no flags Details
Rendering of test case (15.00 KB, image/png)
2010-06-23 16:38 PDT, Martin Robinson
no flags Details
Patch (2.39 KB, patch)
2010-06-23 16:50 PDT, Martin Robinson
no flags Details | Formatted Diff | Diff
Patch including manual test and ChangeLog fix (3.42 KB, patch)
2010-06-25 17:17 PDT, Martin Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Robinson 2010-06-23 16:35:08 PDT
Created attachment 59576 [details]
Failing test case

Not only does the form element not render, even text which follows the form element fails to render. I've attached a test case that shows the issue I'm seeing.
Comment 1 Martin Robinson 2010-06-23 16:38:33 PDT
Created attachment 59577 [details]
Rendering of test case
Comment 2 Martin Robinson 2010-06-23 16:45:56 PDT
There appears to be two problems in GraphicsContext::releaseWindowsContext:

1. A cairo_save()/cairo_restore() pair is not used around the part of the method modifying the transformation matrix of the GraphicsContext's cairo surface.

2. The destination coordinates of the paint are affected by the scaling in the transformation matrix. I'm not sure if this is Cairo's expected behavior, but setting the destination coordinates during the call to cairo_set_source_surface() fixes the problem.
Comment 3 Martin Robinson 2010-06-23 16:50:29 PDT
Created attachment 59579 [details]
Patch
Comment 4 Brent Fulgham 2010-06-24 09:38:02 PDT
This patch looks good to me.
Comment 5 Adam Roben (:aroben) 2010-06-25 09:36:26 PDT
Comment on attachment 59579 [details]
Patch

> +        Functionality unchanged, no new tests.

How can this be true? You're fixing a painting bug; that sounds like changed functionality to me.

> +        * platform/graphics/win/GraphicsContextCairoWin.cpp:
> +        (WebCore::GraphicsContext::releaseWindowsContext):
> +        Preform a cairo_save() and a cairo_restore() before modifying the transformation
> +        matrix of the Cairo surface.

I think you mean "around", not "before".

It's great to have detailed ChangeLog comments like these!

The code change looks fine, but I'm still confused about the "Functionality unchanged" part.
Comment 6 Martin Robinson 2010-06-25 17:17:32 PDT
Created attachment 59815 [details]
Patch including manual test and ChangeLog fix
Comment 7 Martin Robinson 2010-06-25 17:31:44 PDT
Comment on attachment 59815 [details]
Patch including manual test and ChangeLog fix

> +<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=41113">Bugzilla bug 41113</a> [WinCairo] Text box backgrounds do not render in partially opaque layers</p>

This line is incorrect. If this version of the patch is otherwise satisfactory to the reviewer, I will change it to:

> +<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=41111">Bugzilla bug 41113</a> [WinCairo] Rendering of themed elements on a layer with opacity produces nothing</p>
Comment 8 Adam Roben (:aroben) 2010-06-28 06:47:13 PDT
Comment on attachment 59815 [details]
Patch including manual test and ChangeLog fix

r=me
Comment 9 Martin Robinson 2010-06-28 09:01:03 PDT
Comment on attachment 59815 [details]
Patch including manual test and ChangeLog fix

Clearing flags on attachment: 59815

Committed r62011: <http://trac.webkit.org/changeset/62011>
Comment 10 Martin Robinson 2010-06-28 09:01:08 PDT
All reviewed patches have been landed.  Closing bug.