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

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

Issue 2571263002: cc: Remove map lookup from RenderSurfaceImpl::EffectTreeIndex (Closed)
Patch Set: Fix post-rebase unit test failure Created 3 years, 11 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/draw_property_utils.cc ('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_in_process.h" 5 #include "cc/trees/layer_tree_host_in_process.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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (numLayers < 30) 593 if (numLayers < 30)
594 return 1; 594 return 1;
595 if (numLayers < 70) 595 if (numLayers < 70)
596 return 2; 596 return 2;
597 if (numLayers < 150) 597 if (numLayers < 150)
598 return 3; 598 return 3;
599 return 4; 599 return 4;
600 } 600 }
601 601
602 bool LayerTreeHostInProcess::UpdateLayers() { 602 bool LayerTreeHostInProcess::UpdateLayers() {
603 if (!layer_tree_->root_layer()) 603 if (!layer_tree_->root_layer()) {
604 layer_tree_->property_trees()->clear();
604 return false; 605 return false;
606 }
605 DCHECK(!layer_tree_->root_layer()->parent()); 607 DCHECK(!layer_tree_->root_layer()->parent());
606 base::ElapsedTimer timer; 608 base::ElapsedTimer timer;
607 609
608 bool result = DoUpdateLayers(layer_tree_->root_layer()); 610 bool result = DoUpdateLayers(layer_tree_->root_layer());
609 micro_benchmark_controller_.DidUpdateLayers(); 611 micro_benchmark_controller_.DidUpdateLayers();
610 612
611 if (const char* client_name = GetClientNameForMetrics()) { 613 if (const char* client_name = GetClientNameForMetrics()) {
612 std::string histogram_name = base::StringPrintf( 614 std::string histogram_name = base::StringPrintf(
613 "Compositing.%s.LayersUpdateTime.%d", client_name, 615 "Compositing.%s.LayersUpdateTime.%d", client_name,
614 GetLayersUpdateTimeHistogramBucket(layer_tree_->NumLayers())); 616 GetLayersUpdateTimeHistogramBucket(layer_tree_->NumLayers()));
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 return compositor_mode_ == CompositorMode::SINGLE_THREADED; 852 return compositor_mode_ == CompositorMode::SINGLE_THREADED;
851 } 853 }
852 854
853 bool LayerTreeHostInProcess::IsThreaded() const { 855 bool LayerTreeHostInProcess::IsThreaded() const {
854 DCHECK(compositor_mode_ != CompositorMode::THREADED || 856 DCHECK(compositor_mode_ != CompositorMode::THREADED ||
855 task_runner_provider_->HasImplThread()); 857 task_runner_provider_->HasImplThread());
856 return compositor_mode_ == CompositorMode::THREADED; 858 return compositor_mode_ == CompositorMode::THREADED;
857 } 859 }
858 860
859 } // namespace cc 861 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698