Index: cc/CCLayerTreeHost.cpp |
diff --git a/cc/CCLayerTreeHost.cpp b/cc/CCLayerTreeHost.cpp |
index 18786f52b4d8d263bdd91820ce425a5cf7dc8cb4..5d3127d423c6509be89c5b81f4b3ccd6884a4814 100644 |
--- a/cc/CCLayerTreeHost.cpp |
+++ b/cc/CCLayerTreeHost.cpp |
@@ -68,6 +68,7 @@ CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTre |
, m_triggerIdleUpdates(true) |
, m_backgroundColor(SK_ColorWHITE) |
, m_hasTransparentBackground(false) |
+ , m_maxPartialTextureUpdates(0) |
, m_partialTextureUpdateRequests(0) |
{ |
ASSERT(CCProxy::isMainThread()); |
@@ -119,9 +120,6 @@ void CCLayerTreeHost::initializeRenderer() |
// Update m_settings based on capabilities that we got back from the renderer. |
m_settings.acceleratePainting = m_proxy->rendererCapabilities().usingAcceleratedPainting; |
- // Update m_settings based on partial update capability. |
- m_settings.maxPartialTextureUpdates = min(m_settings.maxPartialTextureUpdates, m_proxy->maxPartialTextureUpdates()); |
- |
m_contentsTextureManager = CCPrioritizedTextureManager::create(0, m_proxy->rendererCapabilities().maxTextureSize, CCRenderer::ContentPool); |
m_surfaceMemoryPlaceholder = m_contentsTextureManager->createTexture(IntSize(), GraphicsContext3D::RGBA); |
@@ -451,7 +449,7 @@ bool CCLayerTreeHost::initializeRendererIfNeeded() |
return true; |
} |
-void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAllocationLimitBytes) |
+void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAllocationLimitBytes, size_t maxPartialTextureUpdates) |
{ |
ASSERT(m_rendererInitialized); |
ASSERT(memoryAllocationLimitBytes); |
@@ -464,7 +462,7 @@ void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAll |
m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes); |
- updateLayers(rootLayer(), queue); |
+ updateLayers(rootLayer(), queue, maxPartialTextureUpdates); |
} |
static void setScale(LayerChromium* layer, float deviceScaleFactor, float pageScaleFactor) |
@@ -492,7 +490,7 @@ static void updateLayerScale(LayerChromium* layer, float deviceScaleFactor, floa |
updateLayerScale(children[i].get(), deviceScaleFactor, pageScaleFactor); |
} |
-void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueue& queue) |
+void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueue& queue, size_t maxPartialTextureUpdates) |
{ |
TRACE_EVENT0("cc", "CCLayerTreeHost::updateLayers"); |
@@ -508,6 +506,7 @@ void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueu |
// Reset partial texture update requests. |
m_partialTextureUpdateRequests = 0; |
+ m_maxPartialTextureUpdates = std::min(m_settings.maxPartialTextureUpdates, maxPartialTextureUpdates); |
bool needMoreUpdates = paintLayerContents(updateList, queue); |
if (m_triggerIdleUpdates && needMoreUpdates) |
@@ -716,7 +715,7 @@ bool CCLayerTreeHost::bufferedUpdates() |
bool CCLayerTreeHost::requestPartialTextureUpdate() |
{ |
- if (m_partialTextureUpdateRequests >= m_settings.maxPartialTextureUpdates) |
+ if (m_partialTextureUpdateRequests >= m_maxPartialTextureUpdates) |
return false; |
m_partialTextureUpdateRequests++; |