Chromium Code Reviews| 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_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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { | 1049 DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { |
| 1050 TRACE_EVENT1("cc", | 1050 TRACE_EVENT1("cc", |
| 1051 "LayerTreeHostImpl::PrepareToDraw", | 1051 "LayerTreeHostImpl::PrepareToDraw", |
| 1052 "SourceFrameNumber", | 1052 "SourceFrameNumber", |
| 1053 active_tree_->source_frame_number()); | 1053 active_tree_->source_frame_number()); |
| 1054 if (input_handler_client_) | 1054 if (input_handler_client_) |
| 1055 input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); | 1055 input_handler_client_->ReconcileElasticOverscrollAndRootScroll(); |
| 1056 | 1056 |
| 1057 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
| 1058 "Compositing.NumActiveLayers", | |
| 1059 base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20); | |
| 1060 | |
| 1061 if (const char* client_name = GetClientNameForMetrics()) { | 1057 if (const char* client_name = GetClientNameForMetrics()) { |
| 1062 size_t total_picture_memory = 0; | 1058 size_t total_picture_memory = 0; |
| 1063 for (const PictureLayerImpl* layer : active_tree()->picture_layers()) | 1059 for (const PictureLayerImpl* layer : active_tree()->picture_layers()) |
| 1064 total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); | 1060 total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); |
| 1065 if (total_picture_memory != 0) { | 1061 if (total_picture_memory != 0) { |
| 1066 // GetClientNameForMetrics only returns one non-null value over the | 1062 // GetClientNameForMetrics only returns one non-null value over the |
| 1067 // lifetime of the process, so this histogram name is runtime constant. | 1063 // lifetime of the process, so this histogram name is runtime constant. |
| 1068 UMA_HISTOGRAM_COUNTS( | 1064 UMA_HISTOGRAM_COUNTS( |
| 1069 base::StringPrintf("Compositing.%s.PictureMemoryUsageKb", | 1065 base::StringPrintf("Compositing.%s.PictureMemoryUsageKb", |
| 1070 client_name), | 1066 client_name), |
| 1071 base::saturated_cast<int>(total_picture_memory / 1024)); | 1067 base::saturated_cast<int>(total_picture_memory / 1024)); |
| 1072 } | 1068 } |
| 1069 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
|
Alexei Svitkine (slow)
2016/04/20 15:40:30
Please add the same comment above this block as th
ajuma
2016/04/20 15:52:10
Done.
| |
| 1070 base::StringPrintf("Compositing.%s.NumActiveLayers", client_name), | |
| 1071 base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20); | |
| 1073 } | 1072 } |
| 1074 | 1073 |
| 1075 bool update_lcd_text = false; | 1074 bool update_lcd_text = false; |
| 1076 bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); | 1075 bool ok = active_tree_->UpdateDrawProperties(update_lcd_text); |
| 1077 DCHECK(ok) << "UpdateDrawProperties failed during draw"; | 1076 DCHECK(ok) << "UpdateDrawProperties failed during draw"; |
| 1078 | 1077 |
| 1079 // This will cause NotifyTileStateChanged() to be called for any tiles that | 1078 // This will cause NotifyTileStateChanged() to be called for any tiles that |
| 1080 // completed, which will add damage for visible tiles to the frame for them so | 1079 // completed, which will add damage for visible tiles to the frame for them so |
| 1081 // they appear as part of the current frame being drawn. | 1080 // they appear as part of the current frame being drawn. |
| 1082 tile_manager_->Flush(); | 1081 tile_manager_->Flush(); |
| (...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3943 return task_runner_provider_->HasImplThread(); | 3942 return task_runner_provider_->HasImplThread(); |
| 3944 } | 3943 } |
| 3945 | 3944 |
| 3946 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3945 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 3947 // 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 |
| 3948 // active tree. | 3947 // active tree. |
| 3949 return !task_runner_provider_->HasImplThread(); | 3948 return !task_runner_provider_->HasImplThread(); |
| 3950 } | 3949 } |
| 3951 | 3950 |
| 3952 } // namespace cc | 3951 } // namespace cc |
| OLD | NEW |