Bug 41111

Summary: [WinCairo] Rendering of themed elements on a layer with opacity produces nothing
Product: WebKit Reporter: Martin Robinson <mrobinson>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, bfulgham
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Bug Depends on:    
Bug Blocks: 41113    
Attachments:
Description Flags
Failing test case
none
Rendering of test case
none
Patch
none
Patch including manual test and ChangeLog fix none

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.