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/raster/zero_copy_tile_task_worker_pool.h" | 5 #include "cc/raster/zero_copy_tile_task_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 it != completed_tasks_.end(); ++it) { | 172 it != completed_tasks_.end(); ++it) { |
173 TileTask* task = static_cast<TileTask*>(it->get()); | 173 TileTask* task = static_cast<TileTask*>(it->get()); |
174 | 174 |
175 task->WillComplete(); | 175 task->WillComplete(); |
176 task->CompleteOnOriginThread(this); | 176 task->CompleteOnOriginThread(this); |
177 task->DidComplete(); | 177 task->DidComplete(); |
178 } | 178 } |
179 completed_tasks_.clear(); | 179 completed_tasks_.clear(); |
180 } | 180 } |
181 | 181 |
182 ResourceFormat ZeroCopyTileTaskWorkerPool::GetResourceFormat() const { | 182 ResourceFormat ZeroCopyTileTaskWorkerPool::GetResourceFormat( |
183 return resource_provider_->memory_efficient_texture_format(); | 183 bool must_support_alpha) const { |
| 184 return resource_provider_->memory_efficient_texture_format( |
| 185 must_support_alpha); |
184 } | 186 } |
185 | 187 |
186 bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle() const { | 188 bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle( |
187 return !PlatformColor::SameComponentOrder(GetResourceFormat()); | 189 bool must_support_alpha) const { |
| 190 return !PlatformColor::SameComponentOrder( |
| 191 GetResourceFormat(must_support_alpha)); |
188 } | 192 } |
189 | 193 |
190 scoped_ptr<RasterBuffer> ZeroCopyTileTaskWorkerPool::AcquireBufferForRaster( | 194 scoped_ptr<RasterBuffer> ZeroCopyTileTaskWorkerPool::AcquireBufferForRaster( |
191 const Resource* resource, | 195 const Resource* resource, |
192 uint64_t resource_content_id, | 196 uint64_t resource_content_id, |
193 uint64_t previous_content_id) { | 197 uint64_t previous_content_id) { |
194 return make_scoped_ptr<RasterBuffer>( | 198 return make_scoped_ptr<RasterBuffer>( |
195 new RasterBufferImpl(resource_provider_, resource)); | 199 new RasterBufferImpl(resource_provider_, resource)); |
196 } | 200 } |
197 | 201 |
(...skipping 23 matching lines...) Expand all Loading... |
221 new base::trace_event::TracedValue(); | 225 new base::trace_event::TracedValue(); |
222 | 226 |
223 state->BeginArray("tasks_pending"); | 227 state->BeginArray("tasks_pending"); |
224 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 228 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
225 state->AppendBoolean(tasks_pending_[task_set]); | 229 state->AppendBoolean(tasks_pending_[task_set]); |
226 state->EndArray(); | 230 state->EndArray(); |
227 return state; | 231 return state; |
228 } | 232 } |
229 | 233 |
230 } // namespace cc | 234 } // namespace cc |
OLD | NEW |