Title: [102113] trunk/Source/WebCore
Revision
102113
Author
[email protected]
Date
2011-12-06 02:47:13 -0800 (Tue, 06 Dec 2011)

Log Message

[TexMap][QT] Draw the borders of media and webgl elements in TexMap.
https://bugs.webkit.org/show_bug.cgi?id=73817

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.

Patch by Huang Dongsung <[email protected]> on 2011-12-06
Reviewed by Noam Rosenthal.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setContentsNeedsDisplay):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperNode.cpp:
(WebCore::TextureMapperNode::renderContent):
(WebCore::TextureMapperNode::paintSelf):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102112 => 102113)


--- trunk/Source/WebCore/ChangeLog	2011-12-06 10:37:45 UTC (rev 102112)
+++ trunk/Source/WebCore/ChangeLog	2011-12-06 10:47:13 UTC (rev 102113)
@@ -1,3 +1,22 @@
+2011-12-06  Huang Dongsung  <[email protected]>
+
+        [TexMap][QT] Draw the borders of media and webgl elements in TexMap.
+        https://bugs.webkit.org/show_bug.cgi?id=73817
+
+        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.
+
+        Reviewed by Noam Rosenthal.
+
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+        (WebCore::GraphicsLayerTextureMapper::setContentsNeedsDisplay):
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
+        * platform/graphics/texmap/TextureMapperNode.cpp:
+        (WebCore::TextureMapperNode::renderContent):
+        (WebCore::TextureMapperNode::paintSelf):
+
 2011-12-06  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r102043.

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (102112 => 102113)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2011-12-06 10:37:45 UTC (rev 102112)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp	2011-12-06 10:47:13 UTC (rev 102113)
@@ -67,6 +67,15 @@
 
 /* \reimp (GraphicsLayer.h)
 */
+void GraphicsLayerTextureMapper::setContentsNeedsDisplay()
+{
+    if (!node()->media())
+        m_pendingContent.needsDisplay = true;
+    notifyChange(TextureMapperNode::DisplayChange);
+}
+
+/* \reimp (GraphicsLayer.h)
+*/
 void GraphicsLayerTextureMapper::setNeedsDisplayInRect(const FloatRect& rect)
 {
     if (m_pendingContent.needsDisplay)

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (102112 => 102113)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2011-12-06 10:37:45 UTC (rev 102112)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h	2011-12-06 10:47:13 UTC (rev 102113)
@@ -45,7 +45,7 @@
 
     // reimps from GraphicsLayer.h
     virtual void setNeedsDisplay();
-    virtual void setContentsNeedsDisplay() { setNeedsDisplay(); };
+    virtual void setContentsNeedsDisplay();
     virtual void setNeedsDisplayInRect(const FloatRect&);
     virtual void setParent(GraphicsLayer* layer);
     virtual bool setChildren(const Vector<GraphicsLayer*>&);

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp (102112 => 102113)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp	2011-12-06 10:37:45 UTC (rev 102112)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp	2011-12-06 10:47:13 UTC (rev 102113)
@@ -297,9 +297,6 @@
     if (!textureMapper)
         return;
 
-    if (m_currentContent.contentType == MediaContentType)
-        return;
-
     // FIXME: Add directly composited images.
     FloatRect dirtyRect = m_currentContent.needsDisplay ? entireRect() : m_currentContent.needsDisplayRect;
 
@@ -384,16 +381,6 @@
     float opacity = options.isSurface ? 1 : options.opacity;
     FloatRect targetRect = this->targetRect();
 
-    if (m_currentContent.contentType == MediaContentType && m_currentContent.media) {
-        if (m_state.replicaLayer && !options.isSurface)
-            m_currentContent.media->paintToTextureMapper(options.textureMapper, targetRect,
-                                                         TransformationMatrix(m_transforms.target).multiply(m_state.replicaLayer->m_transforms.local),
-                                                         opacity * m_state.replicaLayer->m_opacity,
-                                                         replicaMaskTexture ? replicaMaskTexture.get() : maskTexture.get());
-        m_currentContent.media->paintToTextureMapper(options.textureMapper, targetRect, m_transforms.target, opacity, options.isSurface ? 0 : maskTexture.get());
-        return;
-    }
-
 #if USE(TILED_BACKING_STORE)
     Vector<ExternallyManagedTile> tilesToPaint;
 
@@ -447,6 +434,15 @@
         const FloatRect rect = targetRectForTileRect(targetRect, m_ownedTiles[i].rect);
         options.textureMapper->drawTexture(*texture, rect, m_transforms.target, opacity, options.isSurface ? 0 : maskTexture.get());
     }
+
+    if (m_currentContent.contentType == MediaContentType && m_currentContent.media) {
+        if (m_state.replicaLayer && !options.isSurface)
+            m_currentContent.media->paintToTextureMapper(options.textureMapper, targetRect,
+                                                         TransformationMatrix(m_transforms.target).multiply(m_state.replicaLayer->m_transforms.local),
+                                                         opacity * m_state.replicaLayer->m_opacity,
+                                                         replicaMaskTexture ? replicaMaskTexture.get() : maskTexture.get());
+        m_currentContent.media->paintToTextureMapper(options.textureMapper, targetRect, m_transforms.target, opacity, options.isSurface ? 0 : maskTexture.get());
+    }
 }
 
 int TextureMapperNode::compareGraphicsLayersZValue(const void* a, const void* b)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to