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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 bool use_partial_raster, | 54 bool use_partial_raster, |
55 int max_staging_buffer_usage_in_bytes, | 55 int max_staging_buffer_usage_in_bytes, |
56 ResourceFormat preferred_tile_format); | 56 ResourceFormat preferred_tile_format); |
57 | 57 |
58 // Overridden from TileTaskWorkerPool: | 58 // Overridden from TileTaskWorkerPool: |
59 TileTaskRunner* AsTileTaskRunner() override; | 59 TileTaskRunner* AsTileTaskRunner() override; |
60 | 60 |
61 // Overridden from TileTaskRunner: | 61 // Overridden from TileTaskRunner: |
62 void Shutdown() override; | 62 void Shutdown() override; |
63 void ScheduleTasks(TaskGraph* graph) override; | 63 void ScheduleTasks(TaskGraph* graph) override; |
64 void CheckForCompletedTasks() override; | 64 void CollectCompletedTasks(Task::Vector* completed_tasks) override; |
65 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 65 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; |
66 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 66 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; |
| 67 TileTaskClient* AsTileTaskClient() override; |
67 | 68 |
68 // Overridden from TileTaskClient: | 69 // Overridden from TileTaskClient: |
69 scoped_ptr<RasterBuffer> AcquireBufferForRaster( | 70 scoped_ptr<RasterBuffer> AcquireBufferForRaster( |
70 const Resource* resource, | 71 const Resource* resource, |
71 uint64_t resource_content_id, | 72 uint64_t resource_content_id, |
72 uint64_t previous_content_id) override; | 73 uint64_t previous_content_id) override; |
73 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; | 74 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; |
74 | 75 |
75 // Overridden from base::trace_event::MemoryDumpProvider: | 76 // Overridden from base::trace_event::MemoryDumpProvider: |
76 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 77 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void StagingStateAsValueInto( | 134 void StagingStateAsValueInto( |
134 base::trace_event::TracedValue* staging_state) const; | 135 base::trace_event::TracedValue* staging_state) const; |
135 | 136 |
136 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 137 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
137 TaskGraphRunner* task_graph_runner_; | 138 TaskGraphRunner* task_graph_runner_; |
138 const NamespaceToken namespace_token_; | 139 const NamespaceToken namespace_token_; |
139 ResourceProvider* const resource_provider_; | 140 ResourceProvider* const resource_provider_; |
140 const int max_bytes_per_copy_operation_; | 141 const int max_bytes_per_copy_operation_; |
141 const bool use_partial_raster_; | 142 const bool use_partial_raster_; |
142 | 143 |
143 Task::Vector completed_tasks_; | |
144 | |
145 mutable base::Lock lock_; | 144 mutable base::Lock lock_; |
146 // |lock_| must be acquired when accessing the following members. | 145 // |lock_| must be acquired when accessing the following members. |
147 using StagingBufferSet = std::set<const StagingBuffer*>; | 146 using StagingBufferSet = std::set<const StagingBuffer*>; |
148 StagingBufferSet buffers_; | 147 StagingBufferSet buffers_; |
149 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>; | 148 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>; |
150 StagingBufferDeque free_buffers_; | 149 StagingBufferDeque free_buffers_; |
151 StagingBufferDeque busy_buffers_; | 150 StagingBufferDeque busy_buffers_; |
152 int bytes_scheduled_since_last_flush_; | 151 int bytes_scheduled_since_last_flush_; |
153 const int max_staging_buffer_usage_in_bytes_; | 152 const int max_staging_buffer_usage_in_bytes_; |
154 ResourceFormat preferred_tile_format_; | 153 ResourceFormat preferred_tile_format_; |
155 int staging_buffer_usage_in_bytes_; | 154 int staging_buffer_usage_in_bytes_; |
156 int free_staging_buffer_usage_in_bytes_; | 155 int free_staging_buffer_usage_in_bytes_; |
157 const base::TimeDelta staging_buffer_expiration_delay_; | 156 const base::TimeDelta staging_buffer_expiration_delay_; |
158 bool reduce_memory_usage_pending_; | 157 bool reduce_memory_usage_pending_; |
159 base::Closure reduce_memory_usage_callback_; | 158 base::Closure reduce_memory_usage_callback_; |
160 | 159 |
161 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; | 160 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; |
162 | 161 |
163 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); | 162 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); |
164 }; | 163 }; |
165 | 164 |
166 } // namespace cc | 165 } // namespace cc |
167 | 166 |
168 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 167 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ |
OLD | NEW |