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 #include "cc/raster/bitmap_tile_task_worker_pool.h" | 5 #include "cc/raster/bitmap_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 BitmapTileTaskWorkerPool::GetResourceFormat() const { | 182 ResourceFormat BitmapTileTaskWorkerPool::GetResourceFormat( |
| 183 bool must_support_alpha) const { |
183 return resource_provider_->best_texture_format(); | 184 return resource_provider_->best_texture_format(); |
184 } | 185 } |
185 | 186 |
186 bool BitmapTileTaskWorkerPool::GetResourceRequiresSwizzle() const { | 187 bool BitmapTileTaskWorkerPool::GetResourceRequiresSwizzle( |
187 return !PlatformColor::SameComponentOrder(GetResourceFormat()); | 188 bool must_support_alpha) const { |
| 189 return !PlatformColor::SameComponentOrder( |
| 190 GetResourceFormat(must_support_alpha)); |
188 } | 191 } |
189 | 192 |
190 scoped_ptr<RasterBuffer> BitmapTileTaskWorkerPool::AcquireBufferForRaster( | 193 scoped_ptr<RasterBuffer> BitmapTileTaskWorkerPool::AcquireBufferForRaster( |
191 const Resource* resource, | 194 const Resource* resource, |
192 uint64_t resource_content_id, | 195 uint64_t resource_content_id, |
193 uint64_t previous_content_id) { | 196 uint64_t previous_content_id) { |
194 return scoped_ptr<RasterBuffer>(new RasterBufferImpl( | 197 return scoped_ptr<RasterBuffer>(new RasterBufferImpl( |
195 resource_provider_, resource, resource_content_id, previous_content_id)); | 198 resource_provider_, resource, resource_content_id, previous_content_id)); |
196 } | 199 } |
197 | 200 |
(...skipping 23 matching lines...) Expand all Loading... |
221 new base::trace_event::TracedValue(); | 224 new base::trace_event::TracedValue(); |
222 | 225 |
223 state->BeginArray("tasks_pending"); | 226 state->BeginArray("tasks_pending"); |
224 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) | 227 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) |
225 state->AppendBoolean(tasks_pending_[task_set]); | 228 state->AppendBoolean(tasks_pending_[task_set]); |
226 state->EndArray(); | 229 state->EndArray(); |
227 return state; | 230 return state; |
228 } | 231 } |
229 | 232 |
230 } // namespace cc | 233 } // namespace cc |
OLD | NEW |