| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 | 664 |
| 665 void LayerTreeHost::prioritizeTextures(const LayerList& renderSurfaceLayerList,
OverdrawMetrics& metrics) | 665 void LayerTreeHost::prioritizeTextures(const LayerList& renderSurfaceLayerList,
OverdrawMetrics& metrics) |
| 666 { | 666 { |
| 667 m_contentsTextureManager->clearPriorities(); | 667 m_contentsTextureManager->clearPriorities(); |
| 668 | 668 |
| 669 size_t memoryForRenderSurfacesMetric = calculateMemoryForRenderSurfaces(rend
erSurfaceLayerList); | 669 size_t memoryForRenderSurfacesMetric = calculateMemoryForRenderSurfaces(rend
erSurfaceLayerList); |
| 670 | 670 |
| 671 setPrioritiesForLayers(renderSurfaceLayerList); | 671 setPrioritiesForLayers(renderSurfaceLayerList); |
| 672 setPrioritiesForSurfaces(memoryForRenderSurfacesMetric); | 672 setPrioritiesForSurfaces(memoryForRenderSurfacesMetric); |
| 673 | 673 |
| 674 metrics.didUseContentsTextureMemoryBytes(m_contentsTextureManager->memoryAbo
veCutoffBytes()); | 674 metrics.DidUseContentsTextureMemoryBytes(m_contentsTextureManager->memoryAbo
veCutoffBytes()); |
| 675 metrics.didUseRenderSurfaceTextureMemoryBytes(memoryForRenderSurfacesMetric)
; | 675 metrics.DidUseRenderSurfaceTextureMemoryBytes(memoryForRenderSurfacesMetric)
; |
| 676 | 676 |
| 677 m_contentsTextureManager->prioritizeTextures(); | 677 m_contentsTextureManager->prioritizeTextures(); |
| 678 } | 678 } |
| 679 | 679 |
| 680 size_t LayerTreeHost::calculateMemoryForRenderSurfaces(const LayerList& updateLi
st) | 680 size_t LayerTreeHost::calculateMemoryForRenderSurfaces(const LayerList& updateLi
st) |
| 681 { | 681 { |
| 682 size_t readbackBytes = 0; | 682 size_t readbackBytes = 0; |
| 683 size_t maxBackgroundTextureBytes = 0; | 683 size_t maxBackgroundTextureBytes = 0; |
| 684 size_t contentsTextureBytes = 0; | 684 size_t contentsTextureBytes = 0; |
| 685 | 685 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 needMoreUpdates |= paintMasksForRenderSurface(*it, queue); | 748 needMoreUpdates |= paintMasksForRenderSurface(*it, queue); |
| 749 } else if (it.representsItself()) { | 749 } else if (it.representsItself()) { |
| 750 DCHECK(!it->bounds().IsEmpty()); | 750 DCHECK(!it->bounds().IsEmpty()); |
| 751 it->update(queue, &occlusionTracker, stats); | 751 it->update(queue, &occlusionTracker, stats); |
| 752 needMoreUpdates |= it->needMoreUpdates(); | 752 needMoreUpdates |= it->needMoreUpdates(); |
| 753 } | 753 } |
| 754 | 754 |
| 755 occlusionTracker.LeaveLayer(it); | 755 occlusionTracker.LeaveLayer(it); |
| 756 } | 756 } |
| 757 | 757 |
| 758 occlusionTracker.OverdrawMetrics().recordMetrics(this); | 758 occlusionTracker.OverdrawMetrics().RecordMetrics(this); |
| 759 | 759 |
| 760 return needMoreUpdates; | 760 return needMoreUpdates; |
| 761 } | 761 } |
| 762 | 762 |
| 763 void LayerTreeHost::applyScrollAndScale(const ScrollAndScaleSet& info) | 763 void LayerTreeHost::applyScrollAndScale(const ScrollAndScaleSet& info) |
| 764 { | 764 { |
| 765 if (!m_rootLayer) | 765 if (!m_rootLayer) |
| 766 return; | 766 return; |
| 767 | 767 |
| 768 Layer* rootScrollLayer = findFirstScrollableLayer(m_rootLayer.get()); | 768 Layer* rootScrollLayer = findFirstScrollableLayer(m_rootLayer.get()); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 910 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
| 911 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 911 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
| 912 } | 912 } |
| 913 | 913 |
| 914 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() | 914 skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() |
| 915 { | 915 { |
| 916 return m_proxy->CapturePicture(); | 916 return m_proxy->CapturePicture(); |
| 917 } | 917 } |
| 918 | 918 |
| 919 } // namespace cc | 919 } // namespace cc |
| OLD | NEW |