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

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

Issue 2537683002: cc: Add image decode queue functionality to image manager. (Closed)
Patch Set: update Created 3 years, 12 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_in_process.h" 5 #include "cc/trees/layer_tree_host_in_process.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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()), 112 rendering_stats_instrumentation_(RenderingStatsInstrumentation::Create()),
113 settings_(*params->settings), 113 settings_(*params->settings),
114 debug_state_(settings_.initial_debug_state), 114 debug_state_(settings_.initial_debug_state),
115 visible_(false), 115 visible_(false),
116 has_gpu_rasterization_trigger_(false), 116 has_gpu_rasterization_trigger_(false),
117 content_is_suitable_for_gpu_rasterization_(true), 117 content_is_suitable_for_gpu_rasterization_(true),
118 gpu_rasterization_histogram_recorded_(false), 118 gpu_rasterization_histogram_recorded_(false),
119 did_complete_scale_animation_(false), 119 did_complete_scale_animation_(false),
120 id_(s_layer_tree_host_sequence_number.GetNext() + 1), 120 id_(s_layer_tree_host_sequence_number.GetNext() + 1),
121 task_graph_runner_(params->task_graph_runner), 121 task_graph_runner_(params->task_graph_runner),
122 image_serialization_processor_(params->image_serialization_processor) { 122 image_serialization_processor_(params->image_serialization_processor),
123 image_worker_task_runner_(params->image_worker_task_runner) {
123 DCHECK(task_graph_runner_); 124 DCHECK(task_graph_runner_);
124 DCHECK(layer_tree_); 125 DCHECK(layer_tree_);
125 DCHECK_NE(compositor_mode_, CompositorMode::REMOTE); 126 DCHECK_NE(compositor_mode_, CompositorMode::REMOTE);
126 127
127 rendering_stats_instrumentation_->set_record_rendering_stats( 128 rendering_stats_instrumentation_->set_record_rendering_stats(
128 debug_state_.RecordRenderingStats()); 129 debug_state_.RecordRenderingStats());
129 } 130 }
130 131
131 void LayerTreeHostInProcess::InitializeThreaded( 132 void LayerTreeHostInProcess::InitializeThreaded(
132 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 133 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 LayerTreeHostImplClient* client) { 436 LayerTreeHostImplClient* client) {
436 DCHECK(task_runner_provider_->IsImplThread()); 437 DCHECK(task_runner_provider_->IsImplThread());
437 438
438 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread(); 439 const bool supports_impl_scrolling = task_runner_provider_->HasImplThread();
439 std::unique_ptr<MutatorHost> mutator_host_impl = 440 std::unique_ptr<MutatorHost> mutator_host_impl =
440 layer_tree_->mutator_host()->CreateImplInstance(supports_impl_scrolling); 441 layer_tree_->mutator_host()->CreateImplInstance(supports_impl_scrolling);
441 442
442 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create( 443 std::unique_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create(
443 settings_, client, task_runner_provider_.get(), 444 settings_, client, task_runner_provider_.get(),
444 rendering_stats_instrumentation_.get(), task_graph_runner_, 445 rendering_stats_instrumentation_.get(), task_graph_runner_,
445 std::move(mutator_host_impl), id_); 446 std::move(mutator_host_impl), id_, std::move(image_worker_task_runner_));
446 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 447 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
447 host_impl->SetContentIsSuitableForGpuRasterization( 448 host_impl->SetContentIsSuitableForGpuRasterization(
448 content_is_suitable_for_gpu_rasterization_); 449 content_is_suitable_for_gpu_rasterization_);
449 task_graph_runner_ = NULL; 450 task_graph_runner_ = NULL;
450 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); 451 input_handler_weak_ptr_ = host_impl->AsWeakPtr();
451 return host_impl; 452 return host_impl;
452 } 453 }
453 454
454 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() { 455 void LayerTreeHostInProcess::DidLoseCompositorFrameSink() {
455 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink"); 456 TRACE_EVENT0("cc", "LayerTreeHostInProcess::DidLoseCompositorFrameSink");
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 return compositor_mode_ == CompositorMode::SINGLE_THREADED; 822 return compositor_mode_ == CompositorMode::SINGLE_THREADED;
822 } 823 }
823 824
824 bool LayerTreeHostInProcess::IsThreaded() const { 825 bool LayerTreeHostInProcess::IsThreaded() const {
825 DCHECK(compositor_mode_ != CompositorMode::THREADED || 826 DCHECK(compositor_mode_ != CompositorMode::THREADED ||
826 task_runner_provider_->HasImplThread()); 827 task_runner_provider_->HasImplThread());
827 return compositor_mode_ == CompositorMode::THREADED; 828 return compositor_mode_ == CompositorMode::THREADED;
828 } 829 }
829 830
830 } // namespace cc 831 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698