| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace | 174 } // namespace |
| 175 | 175 |
| 176 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, | 176 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, |
| 177 "Scheduling.%s.PendingTreeDuration"); | 177 "Scheduling.%s.PendingTreeDuration"); |
| 178 | 178 |
| 179 LayerTreeHostImpl::FrameData::FrameData() | 179 LayerTreeHostImpl::FrameData::FrameData() |
| 180 : render_surface_layer_list(nullptr), | 180 : render_surface_layer_list(nullptr), |
| 181 has_no_damage(false), | 181 has_no_damage(false), |
| 182 may_contain_video(false) {} | 182 may_contain_video(false), |
| 183 begin_frame_source_id(0), |
| 184 begin_frame_number(0), |
| 185 oldest_incorporated_frame(0) {} |
| 183 | 186 |
| 184 LayerTreeHostImpl::FrameData::~FrameData() {} | 187 LayerTreeHostImpl::FrameData::~FrameData() {} |
| 185 | 188 |
| 186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( | 189 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( |
| 187 const LayerTreeSettings& settings, | 190 const LayerTreeSettings& settings, |
| 188 LayerTreeHostImplClient* client, | 191 LayerTreeHostImplClient* client, |
| 189 TaskRunnerProvider* task_runner_provider, | 192 TaskRunnerProvider* task_runner_provider, |
| 190 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 193 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 191 TaskGraphRunner* task_graph_runner, | 194 TaskGraphRunner* task_graph_runner, |
| 192 std::unique_ptr<MutatorHost> mutator_host, | 195 std::unique_ptr<MutatorHost> mutator_host, |
| (...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 | 1656 |
| 1654 // Collect all resource ids in the render passes into a single array. | 1657 // Collect all resource ids in the render passes into a single array. |
| 1655 ResourceProvider::ResourceIdArray resources; | 1658 ResourceProvider::ResourceIdArray resources; |
| 1656 for (const auto& render_pass : frame->render_passes) { | 1659 for (const auto& render_pass : frame->render_passes) { |
| 1657 for (auto* quad : render_pass->quad_list) { | 1660 for (auto* quad : render_pass->quad_list) { |
| 1658 for (ResourceId resource_id : quad->resources) | 1661 for (ResourceId resource_id : quad->resources) |
| 1659 resources.push_back(resource_id); | 1662 resources.push_back(resource_id); |
| 1660 } | 1663 } |
| 1661 } | 1664 } |
| 1662 | 1665 |
| 1666 metadata.begin_frame_source_id = frame->begin_frame_source_id; |
| 1667 metadata.begin_frame_number = frame->begin_frame_number; |
| 1668 metadata.oldest_incorporated_frame = frame->oldest_incorporated_frame; |
| 1663 | 1669 |
| 1664 CompositorFrame compositor_frame; | 1670 CompositorFrame compositor_frame; |
| 1665 compositor_frame.metadata = std::move(metadata); | 1671 compositor_frame.metadata = std::move(metadata); |
| 1666 resource_provider_->PrepareSendToParent(resources, | 1672 resource_provider_->PrepareSendToParent(resources, |
| 1667 &compositor_frame.resource_list); | 1673 &compositor_frame.resource_list); |
| 1668 compositor_frame.render_pass_list = std::move(frame->render_passes); | 1674 compositor_frame.render_pass_list = std::move(frame->render_passes); |
| 1669 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); | 1675 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); |
| 1670 | 1676 |
| 1671 // The next frame should start by assuming nothing has changed, and changes | 1677 // The next frame should start by assuming nothing has changed, and changes |
| 1672 // are noted as they occur. | 1678 // are noted as they occur. |
| (...skipping 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4085 worker_context_visibility_ = | 4091 worker_context_visibility_ = |
| 4086 worker_context->CacheController()->ClientBecameVisible(); | 4092 worker_context->CacheController()->ClientBecameVisible(); |
| 4087 } else { | 4093 } else { |
| 4088 worker_context->CacheController()->ClientBecameNotVisible( | 4094 worker_context->CacheController()->ClientBecameNotVisible( |
| 4089 std::move(worker_context_visibility_)); | 4095 std::move(worker_context_visibility_)); |
| 4090 } | 4096 } |
| 4091 } | 4097 } |
| 4092 } | 4098 } |
| 4093 | 4099 |
| 4094 } // namespace cc | 4100 } // namespace cc |
| OLD | NEW |