RESOLVED FIXED 73817
[TexMap][QT] TexMap does not draw the border of media and webgl elements.
https://bugs.webkit.org/show_bug.cgi?id=73817
Summary [TexMap][QT] TexMap does not draw the border of media and webgl elements.
Dongseong Hwang
Reported 2011-12-05 03:41:35 PST
TexMap does not draw the border of media and webgl elements.
Attachments
patch (5.57 KB, patch)
2011-12-05 03:45 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
patch (8.48 KB, patch)
2011-12-05 16:52 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
patch (9.03 KB, patch)
2011-12-05 17:02 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
patch (6.53 KB, patch)
2011-12-05 17:45 PST, Dongseong Hwang
noam: review-
noam: commit-queue-
patch (6.47 KB, patch)
2011-12-05 18:20 PST, Dongseong Hwang
no flags
patch (6.55 KB, patch)
2011-12-05 19:33 PST, Dongseong Hwang
no flags
Dongseong Hwang
Comment 1 2011-12-05 03:45:19 PST
Noam Rosenthal
Comment 2 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.
Noam Rosenthal
Comment 3 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.
Dongseong Hwang
Comment 4 2011-12-05 16:52:48 PST
Dongseong Hwang
Comment 5 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.
Dongseong Hwang
Comment 6 2011-12-05 17:02:03 PST
Noam Rosenthal
Comment 7 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
Noam Rosenthal
Comment 8 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
Dongseong Hwang
Comment 9 2011-12-05 17:45:10 PST
Dongseong Hwang
Comment 10 2011-12-05 17:49:38 PST
Thanks for this declaration. "If content type is not media, we shouldn't use contentsNeedsDisplay at all!"
Noam Rosenthal
Comment 11 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.
Dongseong Hwang
Comment 12 2011-12-05 18:20:42 PST
Noam Rosenthal
Comment 13 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).
Dongseong Hwang
Comment 14 2011-12-05 19:33:38 PST
Dongseong Hwang
Comment 15 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.
WebKit Review Bot
Comment 16 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>
WebKit Review Bot
Comment 17 2011-12-06 02:47:34 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.