Chromium Code Reviews| Index: cc/layer_tree_host_impl.cc |
| diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc |
| index 034ef0815e638802263b18c34f47d88f54ad2219..5ac78d21684dec1761ed021890d574ec7d20de06 100644 |
| --- a/cc/layer_tree_host_impl.cc |
| +++ b/cc/layer_tree_host_impl.cc |
| @@ -380,13 +380,6 @@ void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons |
| } |
| } |
| -void LayerTreeHostImpl::updateRootScrollLayerImplTransform() |
| -{ |
| - if (rootScrollLayer()) { |
| - rootScrollLayer()->setImplTransform(implTransform()); |
| - } |
| -} |
| - |
| void LayerTreeHostImpl::updateDrawProperties() |
| { |
| if (!needsUpdateDrawProperties()) |
| @@ -398,20 +391,16 @@ void LayerTreeHostImpl::updateDrawProperties() |
| if (!rootLayer()) |
| return; |
| - calculateRenderSurfaceLayerList(m_renderSurfaceLayerList); |
| -} |
| + if (!m_renderer) // For maxTextureSize. |
| + return; |
| -void LayerTreeHostImpl::calculateRenderSurfaceLayerList(LayerList& renderSurfaceLayerList) |
| -{ |
| - DCHECK(renderSurfaceLayerList.empty()); |
| - DCHECK(rootLayer()); |
| - DCHECK(m_renderer); // For maxTextureSize. |
| - { |
| - updateRootScrollLayerImplTransform(); |
| + if (rootScrollLayer()) |
| + rootScrollLayer()->setImplTransform(implTransform()); |
| - TRACE_EVENT0("cc", "LayerTreeHostImpl::calcDrawEtc"); |
| - float pageScaleFactor = m_pinchZoomViewport.pageScaleFactor(); |
| - LayerTreeHostCommon::calculateDrawProperties(rootLayer(), deviceViewportSize(), m_deviceScaleFactor, pageScaleFactor, rendererCapabilities().maxTextureSize, renderSurfaceLayerList); |
| + { |
| + TRACE_EVENT0("cc", "LayerTreeHostImpl::calcDrawEtc"); |
| + float pageScaleFactor = m_pinchZoomViewport.pageScaleFactor(); |
| + LayerTreeHostCommon::calculateDrawProperties(rootLayer(), deviceViewportSize(), m_deviceScaleFactor, pageScaleFactor, rendererCapabilities().maxTextureSize, m_renderSurfaceLayerList); |
| } |
| } |
| @@ -512,6 +501,9 @@ bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame) |
| DCHECK(frame.renderPasses.empty()); |
| updateDrawProperties(); |
| + if (!canDraw()) |
| + return false; |
| + |
| trackDamageForAllSurfaces(rootLayer(), *frame.renderSurfaceLayerList); |
| TRACE_EVENT1("cc", "LayerTreeHostImpl::calculateRenderPasses", "renderSurfaceLayerList.size()", static_cast<long long unsigned>(frame.renderSurfaceLayerList->size())); |
| @@ -766,7 +758,6 @@ void LayerTreeHostImpl::removeRenderPasses(RenderPassCuller culler, FrameData& f |
| bool LayerTreeHostImpl::prepareToDraw(FrameData& frame) |
| { |
| TRACE_EVENT0("cc", "LayerTreeHostImpl::prepareToDraw"); |
| - DCHECK(canDraw()); |
| if (m_tileManager) |
| m_tileManager->CheckForCompletedSetPixels(); |
| @@ -903,7 +894,8 @@ void LayerTreeHostImpl::didDrawAllLayers(const FrameData& frame) |
| // Once all layers have been drawn, pending texture uploads should no |
| // longer block future uploads. |
| - m_resourceProvider->markPendingUploadsAsNonBlocking(); |
| + if (m_resourceProvider) |
| + m_resourceProvider->markPendingUploadsAsNonBlocking(); |
| } |
| void LayerTreeHostImpl::finishAllRendering() |
| @@ -1193,10 +1185,8 @@ bool LayerTreeHostImpl::ensureRenderSurfaceLayerList() |
| // TODO(enne): See http://crbug.com/164949. This function should really |
| // just call updateDrawProperties(), but that breaks a number of |
| // impl transform tests that don't expect the tree to be updated. |
| - if (!rootLayer()) |
| - return false; |
| - if (!m_renderer) |
| - return false; |
| + |
| + // TODO(nduca): Try to delete this before landing. |
|
enne (OOO)
2012/12/12 18:44:24
I just checked. This function can just call updat
|
| // We need both a non-empty render surface layer list and a root render |
| // surface to be able to iterate over the visible layers. |