| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/image_raster_worker_pool.h" | 5 #include "cc/resources/image_raster_worker_pool.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/debug/traced_value.h" | 9 #include "cc/debug/traced_value.h" |
| 10 #include "cc/resources/resource.h" | 10 #include "cc/resources/resource.h" |
| 11 #include "third_party/skia/include/core/SkBitmapDevice.h" | 11 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 namespace { | |
| 15 | |
| 16 class RasterTaskGraphRunner : public internal::TaskGraphRunner { | |
| 17 public: | |
| 18 RasterTaskGraphRunner() | |
| 19 : internal::TaskGraphRunner(RasterWorkerPool::GetNumRasterThreads(), | |
| 20 "CompositorRaster") {} | |
| 21 }; | |
| 22 base::LazyInstance<RasterTaskGraphRunner>::Leaky g_task_graph_runner = | |
| 23 LAZY_INSTANCE_INITIALIZER; | |
| 24 | |
| 25 } // namespace | |
| 26 | 14 |
| 27 // static | 15 // static |
| 28 scoped_ptr<RasterWorkerPool> ImageRasterWorkerPool::Create( | 16 scoped_ptr<RasterWorkerPool> ImageRasterWorkerPool::Create( |
| 29 ResourceProvider* resource_provider, | 17 ResourceProvider* resource_provider, |
| 30 ContextProvider* context_provider, | 18 ContextProvider* context_provider, |
| 31 unsigned texture_target) { | 19 unsigned texture_target) { |
| 32 return make_scoped_ptr<RasterWorkerPool>( | 20 return make_scoped_ptr<RasterWorkerPool>( |
| 33 new ImageRasterWorkerPool(g_task_graph_runner.Pointer(), | 21 new ImageRasterWorkerPool(GetTaskGraphRunner(), |
| 34 resource_provider, | 22 resource_provider, |
| 35 context_provider, | 23 context_provider, |
| 36 texture_target)); | 24 texture_target)); |
| 37 } | 25 } |
| 38 | 26 |
| 39 ImageRasterWorkerPool::ImageRasterWorkerPool( | 27 ImageRasterWorkerPool::ImageRasterWorkerPool( |
| 40 internal::TaskGraphRunner* task_graph_runner, | 28 internal::TaskGraphRunner* task_graph_runner, |
| 41 ResourceProvider* resource_provider, | 29 ResourceProvider* resource_provider, |
| 42 ContextProvider* context_provider, | 30 ContextProvider* context_provider, |
| 43 unsigned texture_target) | 31 unsigned texture_target) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 181 |
| 194 scoped_ptr<base::Value> ImageRasterWorkerPool::StateAsValue() const { | 182 scoped_ptr<base::Value> ImageRasterWorkerPool::StateAsValue() const { |
| 195 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); | 183 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue); |
| 196 | 184 |
| 197 state->SetBoolean("tasks_required_for_activation_pending", | 185 state->SetBoolean("tasks_required_for_activation_pending", |
| 198 raster_tasks_required_for_activation_pending_); | 186 raster_tasks_required_for_activation_pending_); |
| 199 return state.PassAs<base::Value>(); | 187 return state.PassAs<base::Value>(); |
| 200 } | 188 } |
| 201 | 189 |
| 202 } // namespace cc | 190 } // namespace cc |
| OLD | NEW |