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

Side by Side Diff: cc/raster/one_copy_tile_task_worker_pool.h

Issue 1470113002: Move TaskGraph creation to TileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pinchfix
Patch Set: feedback Created 5 years 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
« no previous file with comments | « cc/raster/gpu_tile_task_worker_pool.cc ('k') | cc/raster/one_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <deque>
9 #include <set> 9 #include <set>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ResourceProvider* resource_provider, 49 ResourceProvider* resource_provider,
50 int max_copy_texture_chromium_size, 50 int max_copy_texture_chromium_size,
51 bool use_partial_raster, 51 bool use_partial_raster,
52 int max_staging_buffer_usage_in_bytes, 52 int max_staging_buffer_usage_in_bytes,
53 bool use_rgba_4444_texture_format); 53 bool use_rgba_4444_texture_format);
54 54
55 // Overridden from TileTaskWorkerPool: 55 // Overridden from TileTaskWorkerPool:
56 TileTaskRunner* AsTileTaskRunner() override; 56 TileTaskRunner* AsTileTaskRunner() override;
57 57
58 // Overridden from TileTaskRunner: 58 // Overridden from TileTaskRunner:
59 void SetClient(TileTaskRunnerClient* client) override;
60 void Shutdown() override; 59 void Shutdown() override;
61 void ScheduleTasks(TileTaskQueue* queue) override; 60 void ScheduleTasks(TaskGraph* graph) override;
62 void CheckForCompletedTasks() override; 61 void CheckForCompletedTasks() override;
63 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; 62 ResourceFormat GetResourceFormat(bool must_support_alpha) const override;
64 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; 63 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override;
65 64
66 // Overridden from TileTaskClient: 65 // Overridden from TileTaskClient:
67 scoped_ptr<RasterBuffer> AcquireBufferForRaster( 66 scoped_ptr<RasterBuffer> AcquireBufferForRaster(
68 const Resource* resource, 67 const Resource* resource,
69 uint64_t resource_content_id, 68 uint64_t resource_content_id,
70 uint64_t previous_content_id) override; 69 uint64_t previous_content_id) override;
71 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; 70 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void RemoveStagingBuffer(const StagingBuffer* staging_buffer); 119 void RemoveStagingBuffer(const StagingBuffer* staging_buffer);
121 void MarkStagingBufferAsFree(const StagingBuffer* staging_buffer); 120 void MarkStagingBufferAsFree(const StagingBuffer* staging_buffer);
122 void MarkStagingBufferAsBusy(const StagingBuffer* staging_buffer); 121 void MarkStagingBufferAsBusy(const StagingBuffer* staging_buffer);
123 scoped_ptr<StagingBuffer> AcquireStagingBuffer(const Resource* resource, 122 scoped_ptr<StagingBuffer> AcquireStagingBuffer(const Resource* resource,
124 uint64_t previous_content_id); 123 uint64_t previous_content_id);
125 base::TimeTicks GetUsageTimeForLRUBuffer(); 124 base::TimeTicks GetUsageTimeForLRUBuffer();
126 void ScheduleReduceMemoryUsage(); 125 void ScheduleReduceMemoryUsage();
127 void ReduceMemoryUsage(); 126 void ReduceMemoryUsage();
128 void ReleaseBuffersNotUsedSince(base::TimeTicks time); 127 void ReleaseBuffersNotUsedSince(base::TimeTicks time);
129 128
130 void OnTaskSetFinished(TaskSet task_set);
131 scoped_refptr<base::trace_event::ConvertableToTraceFormat> StateAsValue() 129 scoped_refptr<base::trace_event::ConvertableToTraceFormat> StateAsValue()
132 const; 130 const;
133 void StagingStateAsValueInto( 131 void StagingStateAsValueInto(
134 base::trace_event::TracedValue* staging_state) const; 132 base::trace_event::TracedValue* staging_state) const;
135 133
136 scoped_refptr<base::SequencedTaskRunner> task_runner_; 134 scoped_refptr<base::SequencedTaskRunner> task_runner_;
137 TaskGraphRunner* task_graph_runner_; 135 TaskGraphRunner* task_graph_runner_;
138 const NamespaceToken namespace_token_; 136 const NamespaceToken namespace_token_;
139 TileTaskRunnerClient* client_;
140 ResourceProvider* const resource_provider_; 137 ResourceProvider* const resource_provider_;
141 const int max_bytes_per_copy_operation_; 138 const int max_bytes_per_copy_operation_;
142 const bool use_partial_raster_; 139 const bool use_partial_raster_;
143 TaskSetCollection tasks_pending_;
144 scoped_refptr<TileTask> task_set_finished_tasks_[kNumberOfTaskSets];
145 140
146 // Task graph used when scheduling tasks and vector used to gather
147 // completed tasks.
148 TaskGraph graph_;
149 Task::Vector completed_tasks_; 141 Task::Vector completed_tasks_;
150 142
151 mutable base::Lock lock_; 143 mutable base::Lock lock_;
152 // |lock_| must be acquired when accessing the following members. 144 // |lock_| must be acquired when accessing the following members.
153 using StagingBufferSet = std::set<const StagingBuffer*>; 145 using StagingBufferSet = std::set<const StagingBuffer*>;
154 StagingBufferSet buffers_; 146 StagingBufferSet buffers_;
155 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>; 147 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>;
156 StagingBufferDeque free_buffers_; 148 StagingBufferDeque free_buffers_;
157 StagingBufferDeque busy_buffers_; 149 StagingBufferDeque busy_buffers_;
158 int bytes_scheduled_since_last_flush_; 150 int bytes_scheduled_since_last_flush_;
159 const int max_staging_buffer_usage_in_bytes_; 151 const int max_staging_buffer_usage_in_bytes_;
160 bool use_rgba_4444_texture_format_; 152 bool use_rgba_4444_texture_format_;
161 int staging_buffer_usage_in_bytes_; 153 int staging_buffer_usage_in_bytes_;
162 int free_staging_buffer_usage_in_bytes_; 154 int free_staging_buffer_usage_in_bytes_;
163 const base::TimeDelta staging_buffer_expiration_delay_; 155 const base::TimeDelta staging_buffer_expiration_delay_;
164 bool reduce_memory_usage_pending_; 156 bool reduce_memory_usage_pending_;
165 base::Closure reduce_memory_usage_callback_; 157 base::Closure reduce_memory_usage_callback_;
166 158
167 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; 159 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_;
168 // "raster finished" tasks need their own factory as they need to be
169 // canceled when ScheduleTasks() is called.
170 base::WeakPtrFactory<OneCopyTileTaskWorkerPool>
171 task_set_finished_weak_ptr_factory_;
172 160
173 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); 161 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool);
174 }; 162 };
175 163
176 } // namespace cc 164 } // namespace cc
177 165
178 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ 166 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_
OLDNEW
« no previous file with comments | « cc/raster/gpu_tile_task_worker_pool.cc ('k') | cc/raster/one_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698