| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 LayerTreeHostImpl::FrameData::~FrameData() {} | 184 LayerTreeHostImpl::FrameData::~FrameData() {} |
| 185 | 185 |
| 186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( | 186 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( |
| 187 const LayerTreeSettings& settings, | 187 const LayerTreeSettings& settings, |
| 188 LayerTreeHostImplClient* client, | 188 LayerTreeHostImplClient* client, |
| 189 TaskRunnerProvider* task_runner_provider, | 189 TaskRunnerProvider* task_runner_provider, |
| 190 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 190 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 191 TaskGraphRunner* task_graph_runner, | 191 TaskGraphRunner* task_graph_runner, |
| 192 std::unique_ptr<MutatorHost> mutator_host, | 192 std::unique_ptr<MutatorHost> mutator_host, |
| 193 int id) { | 193 int id, |
| 194 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner) { |
| 194 return base::WrapUnique(new LayerTreeHostImpl( | 195 return base::WrapUnique(new LayerTreeHostImpl( |
| 195 settings, client, task_runner_provider, rendering_stats_instrumentation, | 196 settings, client, task_runner_provider, rendering_stats_instrumentation, |
| 196 task_graph_runner, std::move(mutator_host), id)); | 197 task_graph_runner, std::move(mutator_host), id, |
| 198 std::move(image_worker_task_runner))); |
| 197 } | 199 } |
| 198 | 200 |
| 199 LayerTreeHostImpl::LayerTreeHostImpl( | 201 LayerTreeHostImpl::LayerTreeHostImpl( |
| 200 const LayerTreeSettings& settings, | 202 const LayerTreeSettings& settings, |
| 201 LayerTreeHostImplClient* client, | 203 LayerTreeHostImplClient* client, |
| 202 TaskRunnerProvider* task_runner_provider, | 204 TaskRunnerProvider* task_runner_provider, |
| 203 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 205 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 204 TaskGraphRunner* task_graph_runner, | 206 TaskGraphRunner* task_graph_runner, |
| 205 std::unique_ptr<MutatorHost> mutator_host, | 207 std::unique_ptr<MutatorHost> mutator_host, |
| 206 int id) | 208 int id, |
| 209 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner) |
| 207 : client_(client), | 210 : client_(client), |
| 208 task_runner_provider_(task_runner_provider), | 211 task_runner_provider_(task_runner_provider), |
| 209 current_begin_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), | 212 current_begin_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), |
| 210 compositor_frame_sink_(nullptr), | 213 compositor_frame_sink_(nullptr), |
| 211 need_update_gpu_rasterization_status_(false), | 214 need_update_gpu_rasterization_status_(false), |
| 212 content_is_suitable_for_gpu_rasterization_(true), | 215 content_is_suitable_for_gpu_rasterization_(true), |
| 213 has_gpu_rasterization_trigger_(false), | 216 has_gpu_rasterization_trigger_(false), |
| 214 use_gpu_rasterization_(false), | 217 use_gpu_rasterization_(false), |
| 215 use_msaa_(false), | 218 use_msaa_(false), |
| 216 gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), | 219 gpu_rasterization_status_(GpuRasterizationStatus::OFF_DEVICE), |
| 217 input_handler_client_(NULL), | 220 input_handler_client_(NULL), |
| 218 did_lock_scrolling_layer_(false), | 221 did_lock_scrolling_layer_(false), |
| 219 wheel_scrolling_(false), | 222 wheel_scrolling_(false), |
| 220 scroll_affects_scroll_handler_(false), | 223 scroll_affects_scroll_handler_(false), |
| 221 scroll_layer_id_mouse_currently_over_(Layer::INVALID_ID), | 224 scroll_layer_id_mouse_currently_over_(Layer::INVALID_ID), |
| 222 tile_priorities_dirty_(false), | 225 tile_priorities_dirty_(false), |
| 223 settings_(settings), | 226 settings_(settings), |
| 224 visible_(false), | 227 visible_(false), |
| 225 cached_managed_memory_policy_(settings.gpu_memory_policy), | 228 cached_managed_memory_policy_(settings.gpu_memory_policy), |
| 226 is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() && | 229 is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() && |
| 227 !settings.single_thread_proxy_scheduler), | 230 !settings.single_thread_proxy_scheduler), |
| 228 // Must be initialized after is_synchronous_single_threaded_ and | 231 // Must be initialized after is_synchronous_single_threaded_ and |
| 229 // task_runner_provider_. | 232 // task_runner_provider_. |
| 230 tile_manager_(this, | 233 tile_manager_(this, |
| 231 GetTaskRunner(), | 234 GetTaskRunner(), |
| 235 std::move(image_worker_task_runner), |
| 232 is_synchronous_single_threaded_ | 236 is_synchronous_single_threaded_ |
| 233 ? std::numeric_limits<size_t>::max() | 237 ? std::numeric_limits<size_t>::max() |
| 234 : settings.scheduled_raster_task_limit, | 238 : settings.scheduled_raster_task_limit, |
| 235 settings.use_partial_raster), | 239 settings.use_partial_raster), |
| 236 pinch_gesture_active_(false), | 240 pinch_gesture_active_(false), |
| 237 pinch_gesture_end_should_clear_scrolling_layer_(false), | 241 pinch_gesture_end_should_clear_scrolling_layer_(false), |
| 238 fps_counter_( | 242 fps_counter_( |
| 239 FrameRateCounter::Create(task_runner_provider_->HasImplThread())), | 243 FrameRateCounter::Create(task_runner_provider_->HasImplThread())), |
| 240 memory_history_(MemoryHistory::Create()), | 244 memory_history_(MemoryHistory::Create()), |
| 241 debug_rect_history_(DebugRectHistory::Create()), | 245 debug_rect_history_(DebugRectHistory::Create()), |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 input_handler_client_->DeliverInputForBeginFrame(); | 1843 input_handler_client_->DeliverInputForBeginFrame(); |
| 1840 | 1844 |
| 1841 Animate(); | 1845 Animate(); |
| 1842 | 1846 |
| 1843 for (auto* it : video_frame_controllers_) | 1847 for (auto* it : video_frame_controllers_) |
| 1844 it->OnBeginFrame(args); | 1848 it->OnBeginFrame(args); |
| 1845 } | 1849 } |
| 1846 | 1850 |
| 1847 void LayerTreeHostImpl::DidFinishImplFrame() { | 1851 void LayerTreeHostImpl::DidFinishImplFrame() { |
| 1848 current_begin_frame_tracker_.Finish(); | 1852 current_begin_frame_tracker_.Finish(); |
| 1853 tile_manager_.NotifyFrameFinished(); |
| 1849 } | 1854 } |
| 1850 | 1855 |
| 1851 void LayerTreeHostImpl::UpdateViewportContainerSizes() { | 1856 void LayerTreeHostImpl::UpdateViewportContainerSizes() { |
| 1852 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); | 1857 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); |
| 1853 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); | 1858 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); |
| 1854 | 1859 |
| 1855 if (!inner_container) | 1860 if (!inner_container) |
| 1856 return; | 1861 return; |
| 1857 | 1862 |
| 1858 ViewportAnchor anchor(InnerViewportScrollLayer(), OuterViewportScrollLayer()); | 1863 ViewportAnchor anchor(InnerViewportScrollLayer(), OuterViewportScrollLayer()); |
| (...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 worker_context_visibility_ = | 4093 worker_context_visibility_ = |
| 4089 worker_context->CacheController()->ClientBecameVisible(); | 4094 worker_context->CacheController()->ClientBecameVisible(); |
| 4090 } else { | 4095 } else { |
| 4091 worker_context->CacheController()->ClientBecameNotVisible( | 4096 worker_context->CacheController()->ClientBecameNotVisible( |
| 4092 std::move(worker_context_visibility_)); | 4097 std::move(worker_context_visibility_)); |
| 4093 } | 4098 } |
| 4094 } | 4099 } |
| 4095 } | 4100 } |
| 4096 | 4101 |
| 4097 } // namespace cc | 4102 } // namespace cc |
| OLD | NEW |