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

Side by Side Diff: cc/raster/gpu_tile_task_worker_pool.cc

Issue 1197423003: Remaining code for basic tile compression functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable tile compression for one copy Created 5 years, 6 months 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
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 #include "cc/raster/gpu_tile_task_worker_pool.h" 5 #include "cc/raster/gpu_tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/playback/raster_source.h" 10 #include "cc/playback/raster_source.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 void GpuTileTaskWorkerPool::CheckForCompletedTasks() { 201 void GpuTileTaskWorkerPool::CheckForCompletedTasks() {
202 TRACE_EVENT0("cc", "GpuTileTaskWorkerPool::CheckForCompletedTasks"); 202 TRACE_EVENT0("cc", "GpuTileTaskWorkerPool::CheckForCompletedTasks");
203 203
204 task_graph_runner_->CollectCompletedTasks(namespace_token_, 204 task_graph_runner_->CollectCompletedTasks(namespace_token_,
205 &completed_tasks_); 205 &completed_tasks_);
206 CompleteTasks(completed_tasks_); 206 CompleteTasks(completed_tasks_);
207 completed_tasks_.clear(); 207 completed_tasks_.clear();
208 } 208 }
209 209
210 ResourceFormat GpuTileTaskWorkerPool::GetResourceFormat() const { 210 ResourceFormat GpuTileTaskWorkerPool::GetResourceFormat(
211 bool must_be_noncompressed,
212 bool must_support_alpha) const {
211 return rasterizer_->resource_provider()->best_render_buffer_format(); 213 return rasterizer_->resource_provider()->best_render_buffer_format();
212 } 214 }
213 215
214 bool GpuTileTaskWorkerPool::GetResourceRequiresSwizzle() const { 216 bool GpuTileTaskWorkerPool::GetResourceRequiresSwizzle(
217 bool must_be_noncompressed,
218 bool must_support_alpha) const {
215 // This doesn't require a swizzle because we rasterize to the correct format. 219 // This doesn't require a swizzle because we rasterize to the correct format.
216 return false; 220 return false;
217 } 221 }
218 222
219 void GpuTileTaskWorkerPool::CompleteTasks(const Task::Vector& tasks) { 223 void GpuTileTaskWorkerPool::CompleteTasks(const Task::Vector& tasks) {
220 for (auto& task : tasks) { 224 for (auto& task : tasks) {
221 RasterTask* raster_task = static_cast<RasterTask*>(task.get()); 225 RasterTask* raster_task = static_cast<RasterTask*>(task.get());
222 226
223 raster_task->WillComplete(); 227 raster_task->WillComplete();
224 raster_task->CompleteOnOriginThread(this); 228 raster_task->CompleteOnOriginThread(this);
(...skipping 20 matching lines...) Expand all
245 void GpuTileTaskWorkerPool::OnTaskSetFinished(TaskSet task_set) { 249 void GpuTileTaskWorkerPool::OnTaskSetFinished(TaskSet task_set) {
246 TRACE_EVENT1("cc", "GpuTileTaskWorkerPool::OnTaskSetFinished", "task_set", 250 TRACE_EVENT1("cc", "GpuTileTaskWorkerPool::OnTaskSetFinished", "task_set",
247 task_set); 251 task_set);
248 252
249 DCHECK(tasks_pending_[task_set]); 253 DCHECK(tasks_pending_[task_set]);
250 tasks_pending_[task_set] = false; 254 tasks_pending_[task_set] = false;
251 client_->DidFinishRunningTileTasks(task_set); 255 client_->DidFinishRunningTileTasks(task_set);
252 } 256 }
253 257
254 } // namespace cc 258 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698