OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 5 #ifndef CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ |
6 #define CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 6 #define CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ |
7 | 7 |
| 8 #include <deque> |
8 #include <set> | 9 #include <set> |
9 | 10 |
10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
11 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "base/trace_event/memory_dump_provider.h" | 14 #include "base/trace_event/memory_dump_provider.h" |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 #include "cc/base/scoped_ptr_deque.h" | |
16 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
17 #include "cc/raster/tile_task_runner.h" | 17 #include "cc/raster/tile_task_runner.h" |
18 #include "cc/raster/tile_task_worker_pool.h" | 18 #include "cc/raster/tile_task_worker_pool.h" |
19 #include "cc/resources/resource_provider.h" | 19 #include "cc/resources/resource_provider.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 namespace trace_event { | 22 namespace trace_event { |
23 class ConvertableToTraceFormat; | 23 class ConvertableToTraceFormat; |
24 class TracedValue; | 24 class TracedValue; |
25 } | 25 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 // Task graph used when scheduling tasks and vector used to gather | 146 // Task graph used when scheduling tasks and vector used to gather |
147 // completed tasks. | 147 // completed tasks. |
148 TaskGraph graph_; | 148 TaskGraph graph_; |
149 Task::Vector completed_tasks_; | 149 Task::Vector completed_tasks_; |
150 | 150 |
151 mutable base::Lock lock_; | 151 mutable base::Lock lock_; |
152 // |lock_| must be acquired when accessing the following members. | 152 // |lock_| must be acquired when accessing the following members. |
153 using StagingBufferSet = std::set<const StagingBuffer*>; | 153 using StagingBufferSet = std::set<const StagingBuffer*>; |
154 StagingBufferSet buffers_; | 154 StagingBufferSet buffers_; |
155 using StagingBufferDeque = ScopedPtrDeque<StagingBuffer>; | 155 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>; |
156 StagingBufferDeque free_buffers_; | 156 StagingBufferDeque free_buffers_; |
157 StagingBufferDeque busy_buffers_; | 157 StagingBufferDeque busy_buffers_; |
158 int bytes_scheduled_since_last_flush_; | 158 int bytes_scheduled_since_last_flush_; |
159 const int max_staging_buffer_usage_in_bytes_; | 159 const int max_staging_buffer_usage_in_bytes_; |
160 bool use_rgba_4444_texture_format_; | 160 bool use_rgba_4444_texture_format_; |
161 int staging_buffer_usage_in_bytes_; | 161 int staging_buffer_usage_in_bytes_; |
162 int free_staging_buffer_usage_in_bytes_; | 162 int free_staging_buffer_usage_in_bytes_; |
163 const base::TimeDelta staging_buffer_expiration_delay_; | 163 const base::TimeDelta staging_buffer_expiration_delay_; |
164 bool reduce_memory_usage_pending_; | 164 bool reduce_memory_usage_pending_; |
165 base::Closure reduce_memory_usage_callback_; | 165 base::Closure reduce_memory_usage_callback_; |
166 | 166 |
167 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; | 167 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; |
168 // "raster finished" tasks need their own factory as they need to be | 168 // "raster finished" tasks need their own factory as they need to be |
169 // canceled when ScheduleTasks() is called. | 169 // canceled when ScheduleTasks() is called. |
170 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> | 170 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> |
171 task_set_finished_weak_ptr_factory_; | 171 task_set_finished_weak_ptr_factory_; |
172 | 172 |
173 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); | 173 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); |
174 }; | 174 }; |
175 | 175 |
176 } // namespace cc | 176 } // namespace cc |
177 | 177 |
178 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 178 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ |
OLD | NEW |