Title: [104720] trunk/Source/WebKit2
Revision
104720
Author
noam.rosent...@nokia.com
Date
2012-01-11 10:06:57 -0800 (Wed, 11 Jan 2012)

Log Message

[Qt][WK2] Directly-composited images sometimes appear with a wrong geometry
https://bugs.webkit.org/show_bug.cgi?id=75882

Reviewed by Simon Hausmann.

When assigning a directly composited image to a TextureMapperNode in WebKit2, we take
contentsRect() onto account. However, contentsRect() might be changed after the image
is already assigned.
We have to reassign the image when contentsRect() changes. This is a pretty cheap
operation, since the image is already converted to a texture and we simply change the
geometric values.

* UIProcess/qt/LayerTreeHostProxyQt.cpp:
(WebKit::LayerTreeHostProxy::syncLayerParameters):
* WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
(WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (104719 => 104720)


--- trunk/Source/WebKit2/ChangeLog	2012-01-11 17:54:43 UTC (rev 104719)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-11 18:06:57 UTC (rev 104720)
@@ -1,3 +1,22 @@
+2012-01-11  No'am Rosenthal  <noam.rosent...@nokia.com>
+
+        [Qt][WK2] Directly-composited images sometimes appear with a wrong geometry
+        https://bugs.webkit.org/show_bug.cgi?id=75882
+
+        Reviewed by Simon Hausmann.
+
+        When assigning a directly composited image to a TextureMapperNode in WebKit2, we take
+        contentsRect() onto account. However, contentsRect() might be changed after the image
+        is already assigned.
+        We have to reassign the image when contentsRect() changes. This is a pretty cheap
+        operation, since the image is already converted to a texture and we simply change the
+        geometric values.
+
+        * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+        (WebKit::LayerTreeHostProxy::syncLayerParameters):
+        * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+        (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
+
 2012-01-11  Kenneth Rohde Christiansen  <kenn...@webkit.org>
 
         [Qt] Add the editor rect to the EditorState

Modified: trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp (104719 => 104720)


--- trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp	2012-01-11 17:54:43 UTC (rev 104719)
+++ trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp	2012-01-11 18:06:57 UTC (rev 104720)
@@ -245,6 +245,7 @@
     ensureLayer(id);
     LayerMap::iterator it = m_layers.find(id);
     GraphicsLayer* layer = it->second;
+    bool needsToUpdateImageTiles = layerInfo.imageIsUpdated || layerInfo.contentsRect != layer->contentsRect();
 
     layer->setName(layerInfo.name);
 
@@ -261,7 +262,7 @@
     layer->setContentsRect(layerInfo.contentsRect);
     layer->setDrawsContent(layerInfo.drawsContent);
 
-    if (layerInfo.imageIsUpdated)
+    if (needsToUpdateImageTiles)
         assignImageToLayer(layer, layerInfo.imageBackingStoreID);
 
     // Never make the root layer clip.

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp (104719 => 104720)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp	2012-01-11 17:54:43 UTC (rev 104719)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp	2012-01-11 18:06:57 UTC (rev 104720)
@@ -415,10 +415,7 @@
     m_layerInfo.childrenTransform = childrenTransform();
     m_layerInfo.contentsOpaque = contentsOpaque();
     m_layerInfo.contentsRect = contentsRect();
-
-    // In the shadow layer tree we create in the UI process, layers with directly composited images are always considered to draw content.
-    // Otherwise, we'd have to check whether an layer with drawsContent==false has a directly composited image multiple times.
-    m_layerInfo.drawsContent = drawsContent() || m_image;
+    m_layerInfo.drawsContent = drawsContent();
     m_layerInfo.mask = toWebLayerID(maskLayer());
     m_layerInfo.masksToBounds = masksToBounds();
     m_layerInfo.opacity = opacity();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to