Bug 73817 - [TexMap][QT] TexMap does not draw the border of media and webgl elements.
Summary: [TexMap][QT] TexMap does not draw the border of media and webgl elements.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 03:41 PST by Dongseong Hwang
Modified: 2011-12-06 02:47 PST (History)
3 users (show)

See Also:


Attachments
patch (5.57 KB, patch)
2011-12-05 03:45 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
Details | Formatted Diff | Diff
patch (8.48 KB, patch)
2011-12-05 16:52 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
Details | Formatted Diff | Diff
patch (9.03 KB, patch)
2011-12-05 17:02 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
Details | Formatted Diff | Diff
patch (6.53 KB, patch)
2011-12-05 17:45 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
Details | Formatted Diff | Diff
patch (6.47 KB, patch)
2011-12-05 18:20 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
patch (6.55 KB, patch)
2011-12-05 19:33 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2011-12-05 03:41:35 PST
TexMap does not draw the border of media and webgl elements.
Comment 1 Dongseong Hwang 2011-12-05 03:45:19 PST
Created attachment 117865 [details]
patch
Comment 2 Noam Rosenthal 2011-12-05 08:22:54 PST
Comment on attachment 117865 [details]
patch

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

> Source/WebCore/ChangeLog:9
> +        GraphicsContext3D only draws the content, not CSS box border and TexMap only
> +        composited the platformLayer of media and webgl elements.
> +        It causes that TexMap did not render the border of following layout test.
> +        LayoutTests/compositing/webgl/webgl-reflection.html

Let's rewrite this...
"GraphicsContext3D only draws the content of the WebGL canvas, not the additional CSS such as the borders. TextureMapper should render the content of a media/webgl layer before drawing the actual canvas."
This makes LayoutTests/compositing/webgl/webgl-reflection.html work.

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:318
> +        if (m_currentContent.contentType == MediaContentType && !needsReset)
> +            continue;

Doesn't seem correct. This means that we ignore partial-updates for WebGL/media layers.
Comment 3 Noam Rosenthal 2011-12-05 08:38:28 PST
> > Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:318
> > +        if (m_currentContent.contentType == MediaContentType && !needsReset)
> > +            continue;
> 

I think the real problem this tries to solve is that we treat setNeedsDisplay and setContentsNeedsDisplay differently. We should change that.
Comment 4 Dongseong Hwang 2011-12-05 16:52:48 PST
Created attachment 117955 [details]
patch
Comment 5 Dongseong Hwang 2011-12-05 16:54:33 PST
I was afraid about ignoring partial-updates for WebGL/media layers, but I did not know how to solve.
Your feedback is what I need.
Comment 6 Dongseong Hwang 2011-12-05 17:02:03 PST
Created attachment 117958 [details]
patch
Comment 7 Noam Rosenthal 2011-12-05 17:20:20 PST
Comment on attachment 117955 [details]
patch

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

> Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:72
> +    m_pendingContent.needsDisplayContents = true;

contentsNeedDisplay instead of needsDisplayContents

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:303
> +    }

This is incorrect.
If content type is not media, we shouldn't use contentsNeedsDisplay at all!

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.h:123
> +        bool needsDisplayContents;

contentsNeedDisplay
Comment 8 Noam Rosenthal 2011-12-05 17:22:24 PST
Comment on attachment 117958 [details]
patch

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

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:307
> +    if (m_currentContent.contentType == MediaContentType && !m_currentContent.needsDisplay) {
> +        m_currentContent.needsDisplayContents = false;
>          return;
> +    }
> +    if (m_currentContent.contentType != MediaContentType) {
> +        m_currentContent.needsDisplay = m_currentContent.needsDisplayContents;
> +        m_currentContent.needsDisplayContents = false;
> +    }

This is very hard to read. I think you want a temporary variable here instead of modifying m_currentContent.needsDisplay.

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.h:123
> +        bool needsDisplayContents;

contentsNeedsDisplay
Comment 9 Dongseong Hwang 2011-12-05 17:45:10 PST
Created attachment 117964 [details]
patch
Comment 10 Dongseong Hwang 2011-12-05 17:49:38 PST
Thanks for this declaration.
"If content type is not media, we shouldn't use contentsNeedsDisplay at all!"
Comment 11 Noam Rosenthal 2011-12-05 17:58:12 PST
Comment on attachment 117964 [details]
patch

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

You can probably get the same result without redundant updates by getting rid of some code :)

> Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:73
> +        m_pendingContent.needsDisplay = true;

You can probably remove these two lines; otherwise you're causing unnecessary updates.

> Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:301
> -    if (m_currentContent.contentType == MediaContentType)
> +    if (m_currentContent.contentType == MediaContentType && !m_currentContent.needsDisplay)
>          return;

The code would probably work just the same if you remove these lines from the code altogether.
Comment 12 Dongseong Hwang 2011-12-05 18:20:42 PST
Created attachment 117974 [details]
patch
Comment 13 Noam Rosenthal 2011-12-05 18:24:54 PST
(In reply to comment #11)
> (From update of attachment 117964 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=117964&action=review
> 
> You can probably get the same result without redundant updates by getting rid of some code :)
> 
> > Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:73
> > +        m_pendingContent.needsDisplay = true;
> 
> You can probably remove these two lines; otherwise you're causing unnecessary updates.
> 
> > Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:301
> > -    if (m_currentContent.contentType == MediaContentType)
> > +    if (m_currentContent.contentType == MediaContentType && !m_currentContent.needsDisplay)
> >          return;
> 
> The code would probably work just the same if you remove these lines from the code altogether.

Correction: You do need the first one, because setContentsNeedsDisplay is also called for images. So, a blend between the two last patches should work (include the stuff around line 73, remove the stuff around 301).
Comment 14 Dongseong Hwang 2011-12-05 19:33:38 PST
Created attachment 117980 [details]
patch
Comment 15 Dongseong Hwang 2011-12-05 19:38:06 PST
I thought image and 2d canvas would have problem, so I tested 2d canvas.
However, 2d canvas was rendered properly, so I thought there is something that you know but I don't know. and patched it.

After this patch, I tested 2d canvas again, and there is setContentsToCanvas call every frame, and it cause 2d canvas is rendered every frame.
Comment 16 WebKit Review Bot 2011-12-06 02:47:29 PST
Comment on attachment 117980 [details]
patch

Clearing flags on attachment: 117980

Committed r102113: <http://trac.webkit.org/changeset/102113>
Comment 17 WebKit Review Bot 2011-12-06 02:47:34 PST
All reviewed patches have been landed.  Closing bug.