Title: [101104] trunk/Source/WebCore
Revision
101104
Author
commit-qu...@webkit.org
Date
2011-11-23 14:48:42 -0800 (Wed, 23 Nov 2011)

Log Message

[chromium] Drop root layer tiles on platforms that cache the front buffer
https://bugs.webkit.org/show_bug.cgi?id=72956

Patch by Jonathan Backer <bac...@chromium.org> on 2011-11-23
Reviewed by Kenneth Russell.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::initialize):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::initialize):
(WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCSettings::CCSettings):
(WebCore::LayerRendererCapabilities::LayerRendererCapabilities):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101103 => 101104)


--- trunk/Source/WebCore/ChangeLog	2011-11-23 22:03:54 UTC (rev 101103)
+++ trunk/Source/WebCore/ChangeLog	2011-11-23 22:48:42 UTC (rev 101104)
@@ -1,3 +1,19 @@
+2011-11-23  Jonathan Backer  <bac...@chromium.org>
+
+        [chromium] Drop root layer tiles on platforms that cache the front buffer
+        https://bugs.webkit.org/show_bug.cgi?id=72956
+
+        Reviewed by Kenneth Russell.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::initialize):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::initialize):
+        (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::CCSettings::CCSettings):
+        (WebCore::LayerRendererCapabilities::LayerRendererCapabilities):
+
 2011-11-23  Erik Arvidsson  <a...@chromium.org>
 
         Binding CodeGenerators don't support Conditional= on constants

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (101103 => 101104)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-11-23 22:03:54 UTC (rev 101103)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-11-23 22:48:42 UTC (rev 101104)
@@ -187,6 +187,10 @@
         m_capabilities.usingAcceleratedPainting = true;
 
     WebCore::Extensions3D* extensions = m_context->getExtensions();
+    m_capabilities.usingFrontBufferCached = extensions->supports("GL_CHROMIUM_front_buffer_cached");
+    if (m_capabilities.usingFrontBufferCached)
+        extensions->ensureEnabled("GL_CHROMIUM_front_buffer_cached");
+
     m_capabilities.usingPostSubBuffer = extensions->supports("GL_CHROMIUM_post_sub_buffer");
     if (m_capabilities.usingPostSubBuffer)
         extensions->ensureEnabled("GL_CHROMIUM_post_sub_buffer");

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (101103 => 101104)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-11-23 22:03:54 UTC (rev 101103)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-11-23 22:48:42 UTC (rev 101104)
@@ -82,6 +82,7 @@
 
     // Update m_settings based on capabilities that we got back from the renderer.
     m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting;
+    m_settings.discardAllTextures = m_proxy->layerRendererCapabilities().usingFrontBufferCached;
 
     m_contentsTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_proxy->layerRendererCapabilities().maxTextureSize);
     return true;
@@ -265,8 +266,12 @@
 void CCLayerTreeHost::didBecomeInvisibleOnImplThread(CCLayerTreeHostImpl* hostImpl)
 {
     ASSERT(CCProxy::isImplThread());
-    contentsTextureManager()->reduceMemoryToLimit(TextureManager::reclaimLimitBytes());
-    contentsTextureManager()->deleteEvictedTextures(hostImpl->contentsTextureAllocator());
+    if (m_settings.discardAllTextures)
+        contentsTextureManager()->evictAndDeleteAllTextures(hostImpl->contentsTextureAllocator());
+    else {
+        contentsTextureManager()->reduceMemoryToLimit(TextureManager::reclaimLimitBytes());
+        contentsTextureManager()->deleteEvictedTextures(hostImpl->contentsTextureAllocator());
+    }
 }
 
 void CCLayerTreeHost::setHaveWheelEventHandlers(bool haveWheelEventHandlers)

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (101103 => 101104)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-11-23 22:03:54 UTC (rev 101103)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-11-23 22:48:42 UTC (rev 101104)
@@ -71,6 +71,7 @@
     CCSettings()
             : acceleratePainting(false)
             , compositeOffscreen(false)
+            , discardAllTextures(false)
             , enableCompositorThread(false)
             , showFPSCounter(false)
             , showPlatformLayerTree(false)
@@ -78,6 +79,7 @@
 
     bool acceleratePainting;
     bool compositeOffscreen;
+    bool discardAllTextures;
     bool enableCompositorThread;
     bool showFPSCounter;
     bool showPlatformLayerTree;
@@ -88,6 +90,7 @@
 struct LayerRendererCapabilities {
     LayerRendererCapabilities()
         : bestTextureFormat(0)
+        , usingFrontBufferCached(false)
         , usingPostSubBuffer(false)
         , usingMapSub(false)
         , usingAcceleratedPainting(false)
@@ -96,6 +99,7 @@
         , maxTextureSize(0) { }
 
     GC3Denum bestTextureFormat;
+    bool usingFrontBufferCached;
     bool usingPostSubBuffer;
     bool usingMapSub;
     bool usingAcceleratedPainting;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to