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.h" | 5 #include "cc/trees/layer_tree_host.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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if (needs_full_tree_sync_) | 292 if (needs_full_tree_sync_) |
293 TreeSynchronizer::SynchronizeTrees(root_layer(), sync_tree); | 293 TreeSynchronizer::SynchronizeTrees(root_layer(), sync_tree); |
294 | 294 |
295 PushPropertiesTo(sync_tree); | 295 PushPropertiesTo(sync_tree); |
296 | 296 |
297 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises()); | 297 sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises()); |
298 | 298 |
299 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); | 299 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); |
300 host_impl->SetContentIsSuitableForGpuRasterization( | 300 host_impl->SetContentIsSuitableForGpuRasterization( |
301 content_is_suitable_for_gpu_rasterization_); | 301 content_is_suitable_for_gpu_rasterization_); |
302 RecordGpuRasterizationHistogram(); | 302 RecordGpuRasterizationHistogram(host_impl); |
303 | 303 |
304 host_impl->SetViewportSize(device_viewport_size_); | 304 host_impl->SetViewportSize(device_viewport_size_); |
305 sync_tree->SetDeviceScaleFactor(device_scale_factor_); | 305 sync_tree->SetDeviceScaleFactor(device_scale_factor_); |
306 host_impl->SetDebugState(debug_state_); | 306 host_impl->SetDebugState(debug_state_); |
307 | 307 |
308 sync_tree->set_ui_resource_request_queue( | 308 sync_tree->set_ui_resource_request_queue( |
309 ui_resource_manager_->TakeUIResourcesRequests()); | 309 ui_resource_manager_->TakeUIResourcesRequests()); |
310 | 310 |
311 { | 311 { |
312 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties"); | 312 TRACE_EVENT0("cc", "LayerTreeHostInProcess::PushProperties"); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 ->Add(timer.Elapsed().InMicroseconds()); | 571 ->Add(timer.Elapsed().InMicroseconds()); |
572 } | 572 } |
573 | 573 |
574 return result || next_commit_forces_redraw_; | 574 return result || next_commit_forces_redraw_; |
575 } | 575 } |
576 | 576 |
577 void LayerTreeHost::DidCompletePageScaleAnimation() { | 577 void LayerTreeHost::DidCompletePageScaleAnimation() { |
578 did_complete_scale_animation_ = true; | 578 did_complete_scale_animation_ = true; |
579 } | 579 } |
580 | 580 |
581 void LayerTreeHost::RecordGpuRasterizationHistogram() { | 581 void LayerTreeHost::RecordGpuRasterizationHistogram( |
| 582 const LayerTreeHostImpl* host_impl) { |
582 // Gpu rasterization is only supported for Renderer compositors. | 583 // Gpu rasterization is only supported for Renderer compositors. |
583 // Checking for IsSingleThreaded() to exclude Browser compositors. | 584 // Checking for IsSingleThreaded() to exclude Browser compositors. |
584 if (gpu_rasterization_histogram_recorded_ || IsSingleThreaded()) | 585 if (gpu_rasterization_histogram_recorded_ || IsSingleThreaded()) |
585 return; | 586 return; |
586 | 587 |
| 588 bool gpu_rasterization_enabled = false; |
| 589 if (host_impl->compositor_frame_sink()) { |
| 590 ContextProvider* compositor_context_provider = |
| 591 host_impl->compositor_frame_sink()->context_provider(); |
| 592 if (compositor_context_provider) { |
| 593 gpu_rasterization_enabled = |
| 594 compositor_context_provider->ContextCapabilities().gpu_rasterization; |
| 595 } |
| 596 } |
| 597 |
587 // Record how widely gpu rasterization is enabled. | 598 // Record how widely gpu rasterization is enabled. |
588 // This number takes device/gpu whitelisting/backlisting into account. | 599 // This number takes device/gpu whitelisting/backlisting into account. |
589 // Note that we do not consider the forced gpu rasterization mode, which is | 600 // Note that we do not consider the forced gpu rasterization mode, which is |
590 // mostly used for debugging purposes. | 601 // mostly used for debugging purposes. |
591 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationEnabled", | 602 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationEnabled", |
592 settings_.gpu_rasterization_enabled); | 603 gpu_rasterization_enabled); |
593 if (settings_.gpu_rasterization_enabled) { | 604 if (gpu_rasterization_enabled) { |
594 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationTriggered", | 605 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationTriggered", |
595 has_gpu_rasterization_trigger_); | 606 has_gpu_rasterization_trigger_); |
596 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationSuitableContent", | 607 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationSuitableContent", |
597 content_is_suitable_for_gpu_rasterization_); | 608 content_is_suitable_for_gpu_rasterization_); |
598 // Record how many pages actually get gpu rasterization when enabled. | 609 // Record how many pages actually get gpu rasterization when enabled. |
599 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed", | 610 UMA_HISTOGRAM_BOOLEAN("Renderer4.GpuRasterizationUsed", |
600 (has_gpu_rasterization_trigger_ && | 611 (has_gpu_rasterization_trigger_ && |
601 content_is_suitable_for_gpu_rasterization_)); | 612 content_is_suitable_for_gpu_rasterization_)); |
602 } | 613 } |
603 | 614 |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 LayerListReverseIterator<Layer> LayerTreeHost::rend() { | 1263 LayerListReverseIterator<Layer> LayerTreeHost::rend() { |
1253 return LayerListReverseIterator<Layer>(nullptr); | 1264 return LayerListReverseIterator<Layer>(nullptr); |
1254 } | 1265 } |
1255 | 1266 |
1256 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { | 1267 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { |
1257 for (auto* layer : *this) | 1268 for (auto* layer : *this) |
1258 layer->SetNeedsDisplay(); | 1269 layer->SetNeedsDisplay(); |
1259 } | 1270 } |
1260 | 1271 |
1261 } // namespace cc | 1272 } // namespace cc |
OLD | NEW |