[Webkit-unassigned] [Bug 52311] [chromium] Add command-line flag to enable composite to offscreen texture.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 14 12:13:28 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=52311





--- Comment #25 from W. James MacLean <wjmaclean at chromium.org>  2011-01-14 12:13:28 PST ---
(In reply to comment #24)
> 
> Oh, I see. Good point.  Here's something we could do: Modify LayerRendererChromium::setRootLayer() to call setLayerRenderer.  This seems like a more natural place to make the call, and hopefully it will be made only as needed.  If that works then LayerRendererChromium::setCompositeOffscreen() could be simplified as:
> 
> void LayerRendererChromium::setCompositeOffscreen(bool compositeOffscreen)
> {
>     if (m_compositeOffscreen == compositeOffscreen)
>        return;
> 
>     m_compositeOffscreen = compositeOffscreen;
> 
>     if (!m_compositeOffscreen)
>         m_rootLayer->m_renderSurface.clear();
> }

Sounds good, although I've run into one slight hitch: when I make the modification (see diff below), one test starts failing --- compositing/iframes/composited-iframe-alignment.html renders upside down! It renders right-side up without this change. Off the top of my head, I don't know why this is.


diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index ce7b868..7c163ad 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -340,6 +340,8 @@ void LayerRendererChromium::present()
 void LayerRendererChromium::setRootLayer(PassRefPtr<LayerChromium> layer)
 {
     m_rootLayer = layer;
+    if (m_rootLayer)
+        m_rootLayer->setLayerRenderer(this);
     m_rootLayerTiler->invalidateEntireLayer();
     if (m_horizontalScrollbarTiler)
         m_horizontalScrollbarTiler->invalidateEntireLayer();
@@ -621,18 +623,12 @@ void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const Tr

 void LayerRendererChromium::setCompositeOffscreen(bool compositeOffscreen)
 {
-    m_compositeOffscreen = compositeOffscreen;
+    if (m_compositeOffscreen == compositeOffscreen)
+       return;

-    if (!m_rootLayer) {
-        m_compositeOffscreen = false;
-        return;
-    }
+    m_compositeOffscreen = compositeOffscreen;

-    if (m_compositeOffscreen) {
-        // Need to explicitly set a LayerRendererChromium for the layer with the offscreen texture,
-        // or else the call to prepareContentsTexture() in useRenderSurface() will fail.
-        m_rootLayer->setLayerRenderer(this);
-    } else
+    if (!m_compositeOffscreen && m_rootLayer)
         m_rootLayer->m_renderSurface.clear();
 }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list