Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: cc/layer_tree_host.cc

Issue 12728002: cc: Chromify the OverdrawMetrics class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698