Bug 105325 - [WebGL][EFL][Qt] Transparent canvas composited non-transparent.
Summary: [WebGL][EFL][Qt] Transparent canvas composited non-transparent.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Viatcheslav Ostapenko
URL:
Keywords:
Depends on:
Blocks: 104664
  Show dependency treegraph
 
Reported: 2012-12-18 10:41 PST by Viatcheslav Ostapenko
Modified: 2012-12-21 16:10 PST (History)
5 users (show)

See Also:


Attachments
Picture of non-transparent composited canvas (102.34 KB, image/jpeg)
2012-12-18 10:41 PST, Viatcheslav Ostapenko
no flags Details
Patch (4.08 KB, patch)
2012-12-20 18:48 PST, Viatcheslav Ostapenko
no flags Details | Formatted Diff | Diff
WIP : clear a drawing buffer after compositing. (5.03 KB, patch)
2012-12-20 18:53 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (4.46 KB, patch)
2012-12-20 19:35 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (4.03 KB, patch)
2012-12-21 08:41 PST, Viatcheslav Ostapenko
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Viatcheslav Ostapenko 2012-12-18 10:41:15 PST
Created attachment 179977 [details]
Picture of non-transparent composited canvas

Picture attached.
Comment 1 Dongseong Hwang 2012-12-20 17:32:57 PST
It can be reproduced in WK1 Qt but I think efl and qt are fine.

I think http://aleksandarrodic.com/p/jellyfish/ is wrong.
The demo call glClear(GL_DEPTH_BUFFER_BIT) every frame instead of glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT), so result image is accumulated.

I think chromium has a bug to clear color bit every frame regardless of web author's purpose.
Comment 2 Dongseong Hwang 2012-12-20 17:36:31 PST
I am wrong.
http://www.khronos.org/registry/webgl/specs/latest/#2.2

WebGL require clearing a drawing buffer after compositing. It's interesting.
Comment 3 Viatcheslav Ostapenko 2012-12-20 18:48:24 PST
Created attachment 180457 [details]
Patch
Comment 4 Dongseong Hwang 2012-12-20 18:51:56 PST
no, it is not good approach. I also made fix almost. please wait a moment
Comment 5 Dongseong Hwang 2012-12-20 18:53:48 PST
Created attachment 180458 [details]
WIP : clear a drawing buffer after compositing.
Comment 6 Dongseong Hwang 2012-12-20 18:55:48 PST
Comment on attachment 180458 [details]
WIP : clear a drawing buffer after compositing.

I think our both patch are needed for separate reason.
I don't understand your patch fully yet. I'll read :)
Comment 7 Dongseong Hwang 2012-12-20 18:58:35 PST
I'll file preserveDrawingBuffer bug in another bug.
I posted not matching patch here.

http://aleksandarrodic.com/p/jellyfish/ has two bugs.
1. transparent bug
2. preserve drawing buffer bug.

You fixed #1, and I fixed #2. great.
Comment 8 Dongseong Hwang 2012-12-20 18:59:56 PST
You already filed Bug 105326. Sorry for bothering sound.
Comment 9 Dongseong Hwang 2012-12-20 19:35:18 PST
Created attachment 180460 [details]
Patch
Comment 10 Dongseong Hwang 2012-12-20 19:37:01 PST
(In reply to comment #9)
> Created an attachment (id=180460) [details]
> Patch

Oops, I'm sorry for mistake.. I should post Bug 105326.
Comment 11 Kenneth Rohde Christiansen 2012-12-21 06:47:45 PST
Comment on attachment 180457 [details]
Patch

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

LGTM, but some minor issues

> Source/WebCore/ChangeLog:3
> +        [WebGL][EFL][Qt] Transparent canvas composited non-transparent.

No dot in bugzilla titles

> Source/WebCore/ChangeLog:10
> +        even if window itself has alpha channel because 1st GLXFBConfig in a list 
> +        is without transparency. 

I dont understand these two lines

> Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:249
> +        // If origin window has alpha then try to find config with alpha.
> +        GLXFBConfig& config = m_hasAlpha ? findFBConfigWithAlpha(configs, numberOfConfigs) : configs[0];

So what is the result if it fails? are we just out of luck?

> Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:367
> +        // Return 1st config as a fallback.
> +        return fbConfigs[0];

You should write here what that means, like "no alpha support"
Comment 12 Viatcheslav Ostapenko 2012-12-21 08:41:32 PST
Created attachment 180526 [details]
Patch
Comment 13 Kalyan 2012-12-21 09:15:18 PST
(In reply to comment #11)
> (From update of attachment 180457 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=180457&action=review
> 
 
> > +        GLXFBConfig& config = m_hasAlpha ? findFBConfigWithAlpha(configs, numberOfConfigs) : configs[0];
> 
> So what is the result if it fails? are we just out of luck?
> 
If this was related to finding alpha config:

we should be fine if both the pixmap/window (shared handle) and one created here are created with a visual corresponding to the same config(alpha or no-alpha).

Any config mis-match would highlight issues in the config selection logic of either the shared pixmap or at this end. This would generate a BadMisMatch error.
Comment 14 Kalyan 2012-12-21 10:16:42 PST
(In reply to comment #11)
> (From update of attachment 180457 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=180457&action=review
> 

> 
> > Source/WebCore/ChangeLog:10
> > +        even if window itself has alpha channel because 1st GLXFBConfig in a list 
> > +        is without transparency. 
> 
> I dont understand these two lines
> 

This highlights the fact that we are using mismatching configs. Currently the shared window/pixmap always uses a visual with Alpha. We should be able to configure this depending on the GraphicsContext3D attributes in future. Probably this should be highlighted here.
Comment 15 WebKit Review Bot 2012-12-21 11:14:09 PST
Comment on attachment 180526 [details]
Patch

Clearing flags on attachment: 180526

Committed r138390: <http://trac.webkit.org/changeset/138390>
Comment 16 WebKit Review Bot 2012-12-21 11:14:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 17 Viatcheslav Ostapenko 2012-12-21 16:10:49 PST
(In reply to comment #14)
> (In reply to comment #11)
> > (From update of attachment 180457 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=180457&action=review
> > 
> 
> > 
> > > Source/WebCore/ChangeLog:10
> > > +        even if window itself has alpha channel because 1st GLXFBConfig in a list 
> > > +        is without transparency. 
> > 
> > I dont understand these two lines
> > 
> 
> This highlights the fact that we are using mismatching configs. Currently the shared window/pixmap always uses a visual with Alpha. We should be able to configure this depending on the GraphicsContext3D attributes in future. Probably this should be highlighted here.

Why here? Create a bug about it.