Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: image-decode: update Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 settings.check_tile_priority_inversion), 240 settings.check_tile_priority_inversion),
237 pinch_gesture_active_(false), 241 pinch_gesture_active_(false),
238 pinch_gesture_end_should_clear_scrolling_layer_(false), 242 pinch_gesture_end_should_clear_scrolling_layer_(false),
239 fps_counter_( 243 fps_counter_(
240 FrameRateCounter::Create(task_runner_provider_->HasImplThread())), 244 FrameRateCounter::Create(task_runner_provider_->HasImplThread())),
241 memory_history_(MemoryHistory::Create()), 245 memory_history_(MemoryHistory::Create()),
(...skipping 24 matching lines...) Expand all
266 active_tree_->property_trees()->is_active = true; 270 active_tree_->property_trees()->is_active = true;
267 271
268 viewport_ = Viewport::Create(this); 272 viewport_ = Viewport::Create(this);
269 273
270 TRACE_EVENT_OBJECT_CREATED_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"), 274 TRACE_EVENT_OBJECT_CREATED_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
271 "cc::LayerTreeHostImpl", id_); 275 "cc::LayerTreeHostImpl", id_);
272 276
273 browser_controls_offset_manager_ = BrowserControlsOffsetManager::Create( 277 browser_controls_offset_manager_ = BrowserControlsOffsetManager::Create(
274 this, settings.top_controls_show_threshold, 278 this, settings.top_controls_show_threshold,
275 settings.top_controls_hide_threshold); 279 settings.top_controls_hide_threshold);
280
281 tile_manager_.SetDecodedImageTracker(&decoded_image_tracker_);
276 } 282 }
277 283
278 LayerTreeHostImpl::~LayerTreeHostImpl() { 284 LayerTreeHostImpl::~LayerTreeHostImpl() {
279 DCHECK(task_runner_provider_->IsImplThread()); 285 DCHECK(task_runner_provider_->IsImplThread());
280 TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()"); 286 TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()");
281 TRACE_EVENT_OBJECT_DELETED_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"), 287 TRACE_EVENT_OBJECT_DELETED_WITH_ID(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
282 "cc::LayerTreeHostImpl", id_); 288 "cc::LayerTreeHostImpl", id_);
283 289
284 // It is released before shutdown. 290 // It is released before shutdown.
285 DCHECK(!compositor_frame_sink_); 291 DCHECK(!compositor_frame_sink_);
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 input_handler_client_->DeliverInputForBeginFrame(); 1846 input_handler_client_->DeliverInputForBeginFrame();
1841 1847
1842 Animate(); 1848 Animate();
1843 1849
1844 for (auto* it : video_frame_controllers_) 1850 for (auto* it : video_frame_controllers_)
1845 it->OnBeginFrame(args); 1851 it->OnBeginFrame(args);
1846 } 1852 }
1847 1853
1848 void LayerTreeHostImpl::DidFinishImplFrame() { 1854 void LayerTreeHostImpl::DidFinishImplFrame() {
1849 current_begin_frame_tracker_.Finish(); 1855 current_begin_frame_tracker_.Finish();
1856 decoded_image_tracker_.NotifyFrameFinished();
1850 } 1857 }
1851 1858
1852 void LayerTreeHostImpl::UpdateViewportContainerSizes() { 1859 void LayerTreeHostImpl::UpdateViewportContainerSizes() {
1853 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); 1860 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer();
1854 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); 1861 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer();
1855 1862
1856 if (!inner_container) 1863 if (!inner_container)
1857 return; 1864 return;
1858 1865
1859 ViewportAnchor anchor(InnerViewportScrollLayer(), OuterViewportScrollLayer()); 1866 ViewportAnchor anchor(InnerViewportScrollLayer(), OuterViewportScrollLayer());
(...skipping 2232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 worker_context_visibility_ = 4099 worker_context_visibility_ =
4093 worker_context->CacheController()->ClientBecameVisible(); 4100 worker_context->CacheController()->ClientBecameVisible();
4094 } else { 4101 } else {
4095 worker_context->CacheController()->ClientBecameNotVisible( 4102 worker_context->CacheController()->ClientBecameNotVisible(
4096 std::move(worker_context_visibility_)); 4103 std::move(worker_context_visibility_));
4097 } 4104 }
4098 } 4105 }
4099 } 4106 }
4100 4107
4101 } // namespace cc 4108 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698