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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1907053004: cc: Make CallFunctionForEveryLayer use LayerListIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FindLayers should skip layers instead of returning when switching from call-function to iteration l… Created 4 years, 8 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
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_unittest.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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 active_tree_->hud_layer(), 1621 active_tree_->hud_layer(),
1622 *frame->render_surface_layer_list, 1622 *frame->render_surface_layer_list,
1623 debug_state_); 1623 debug_state_);
1624 } 1624 }
1625 1625
1626 bool is_new_trace; 1626 bool is_new_trace;
1627 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace); 1627 TRACE_EVENT_IS_NEW_TRACE(&is_new_trace);
1628 if (is_new_trace) { 1628 if (is_new_trace) {
1629 if (pending_tree_) { 1629 if (pending_tree_) {
1630 LayerTreeHostCommon::CallFunctionForEveryLayer( 1630 LayerTreeHostCommon::CallFunctionForEveryLayer(
1631 pending_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }, 1631 pending_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); });
1632 CallFunctionLayerType::ALL_LAYERS);
1633 } 1632 }
1634 LayerTreeHostCommon::CallFunctionForEveryLayer( 1633 LayerTreeHostCommon::CallFunctionForEveryLayer(
1635 active_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); }, 1634 active_tree(), [](LayerImpl* layer) { layer->DidBeginTracing(); });
1636 CallFunctionLayerType::ALL_LAYERS);
1637 } 1635 }
1638 1636
1639 { 1637 {
1640 TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing"); 1638 TRACE_EVENT0("cc", "DrawLayers.FrameViewerTracing");
1641 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( 1639 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
1642 frame_viewer_instrumentation::kCategoryLayerTree, 1640 frame_viewer_instrumentation::kCategoryLayerTree,
1643 "cc::LayerTreeHostImpl", id_, AsValueWithFrame(frame)); 1641 "cc::LayerTreeHostImpl", id_, AsValueWithFrame(frame));
1644 } 1642 }
1645 1643
1646 const DrawMode draw_mode = GetDrawMode(); 1644 const DrawMode draw_mode = GetDrawMode();
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 return task_runner_provider_->HasImplThread(); 3942 return task_runner_provider_->HasImplThread();
3945 } 3943 }
3946 3944
3947 bool LayerTreeHostImpl::CommitToActiveTree() const { 3945 bool LayerTreeHostImpl::CommitToActiveTree() const {
3948 // In single threaded mode we skip the pending tree and commit directly to the 3946 // In single threaded mode we skip the pending tree and commit directly to the
3949 // active tree. 3947 // active tree.
3950 return !task_runner_provider_->HasImplThread(); 3948 return !task_runner_provider_->HasImplThread();
3951 } 3949 }
3952 3950
3953 } // namespace cc 3951 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698