Bug 82412 - compositing/webgl/webgl-nonpremultiplied-blend.html is flaky on Lion
Summary: compositing/webgl/webgl-nonpremultiplied-blend.html is flaky on Lion
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
: 55968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-27 18:43 PDT by Dirk Pranke
Modified: 2012-07-11 00:22 PDT (History)
12 users (show)

See Also:


Attachments
Patch (6.37 KB, patch)
2012-07-04 14:04 PDT, Kenneth Russell
no flags Details | Formatted Diff | Diff
Patch (6.09 KB, patch)
2012-07-10 18:41 PDT, Kenneth Russell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Dirk Pranke 2012-03-27 18:44:32 PDT
Note that there is a separate bug 55968 filed for this failing on mac and win in debug mode ...
Comment 2 Kenneth Russell 2012-03-28 14:11:55 PDT
From the flakiness dashboard results it looks to me like it's failing all the time rather than flaky. Needs investigation.
Comment 3 Dirk Pranke 2012-03-28 14:20:43 PDT
important note about the flakiness dashboard: if we retry the test and it passes, *that does not show up in the dashboard* :).

That's a whole separate, confusing issue that I'm working on w/ Ojan.
Comment 4 Yasuhiro Matsuda 2012-07-03 16:25:55 PDT
Another bug was filed for Snow Leopard (https://bugs.webkit.org/show_bug.cgi?id=89998).
This test started failing on Snow Leopard as well after http://trac.webkit.org/changeset/121267, so maybe this workaround (https://bugs.webkit.org/show_bug.cgi?id=79735) is causing this failure?
Comment 5 Kenneth Russell 2012-07-04 13:49:44 PDT
I think I see the problem. Because of how the premultiplied blend function of (ONE, ONE_MINUS_SRC_ALPHA) works, the premultipliedAlpha=false case for compositing of WebGL canvases is generally the first time the compositor will output anything except 1.0 for the alpha channel -- even when WebGL content is rendered with an alpha channel less than 1.0! A solution to this problem which seems correct to me is to disable writes to the alpha channel when drawing these canvases' output. This should cause the layout test results to be completely opaque on all platforms and fix any problems with weird content showing up blended behind them.
Comment 6 Kenneth Russell 2012-07-04 13:53:43 PDT
*** Bug 55968 has been marked as a duplicate of this bug. ***
Comment 7 Kenneth Russell 2012-07-04 14:04:50 PDT
Created attachment 150842 [details]
Patch
Comment 8 Adrienne Walker 2012-07-10 11:31:46 PDT
Comment on attachment 150842 [details]
Patch

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

> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:1024
> +        GLC(context(), context()->colorMask(true, true, true, false));

We used to do this for the opaque root layer, due to problems with native Windows controls having bad alpha values due to GDI.  However, this caused performance problems on ChromeOS and Android (see bug 72452) and so we switched to using a shader that always output an alpha value of 1.

I think glBlendFuncSeparate might be a better option here.
Comment 9 Kenneth Russell 2012-07-10 18:41:35 PDT
Created attachment 151572 [details]
Patch
Comment 10 Kenneth Russell 2012-07-10 18:42:52 PDT
Redid patch in terms of blendFuncSeparate and re-tested.

I have a feeling the CQ might reject this because the diff to LayoutTests/ChangeLog doesn't start at line 1, but I tried "git diff --precise" and it still didn't do the right thing.
Comment 11 Adrienne Walker 2012-07-10 20:05:57 PDT
Comment on attachment 151572 [details]
Patch

R=me.
Comment 12 WebKit Review Bot 2012-07-11 00:22:34 PDT
Comment on attachment 151572 [details]
Patch

Clearing flags on attachment: 151572

Committed r122306: <http://trac.webkit.org/changeset/122306>
Comment 13 WebKit Review Bot 2012-07-11 00:22:40 PDT
All reviewed patches have been landed.  Closing bug.