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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |