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

Side by Side Diff: cc/raster/zero_copy_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 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 task->WillComplete(); 171 task->WillComplete();
172 task->CompleteOnOriginThread(this); 172 task->CompleteOnOriginThread(this);
173 task->DidComplete(); 173 task->DidComplete();
174 174
175 task->RunReplyOnOriginThread(); 175 task->RunReplyOnOriginThread();
176 } 176 }
177 completed_tasks_.clear(); 177 completed_tasks_.clear();
178 } 178 }
179 179
180 ResourceFormat ZeroCopyTileTaskWorkerPool::GetResourceFormat() const { 180 ResourceFormat ZeroCopyTileTaskWorkerPool::GetResourceFormat(
181 bool must_be_noncompressed,
182 bool must_support_alpha) const {
181 return resource_provider_->best_texture_format(); 183 return resource_provider_->best_texture_format();
182 } 184 }
183 185
184 bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle() const { 186 bool ZeroCopyTileTaskWorkerPool::GetResourceRequiresSwizzle(
185 return !PlatformColor::SameComponentOrder(GetResourceFormat()); 187 bool must_be_noncompressed,
188 bool must_support_alpha) const {
189 return !PlatformColor::SameComponentOrder(
190 GetResourceFormat(must_be_noncompressed, must_support_alpha));
186 } 191 }
187 192
188 scoped_ptr<RasterBuffer> ZeroCopyTileTaskWorkerPool::AcquireBufferForRaster( 193 scoped_ptr<RasterBuffer> ZeroCopyTileTaskWorkerPool::AcquireBufferForRaster(
189 const Resource* resource, 194 const Resource* resource,
190 uint64_t resource_content_id, 195 uint64_t resource_content_id,
191 uint64_t previous_content_id) { 196 uint64_t previous_content_id) {
192 return make_scoped_ptr<RasterBuffer>( 197 return make_scoped_ptr<RasterBuffer>(
193 new RasterBufferImpl(resource_provider_, resource)); 198 new RasterBufferImpl(resource_provider_, resource));
194 } 199 }
195 200
(...skipping 23 matching lines...) Expand all
219 new base::trace_event::TracedValue(); 224 new base::trace_event::TracedValue();
220 225
221 state->BeginArray("tasks_pending"); 226 state->BeginArray("tasks_pending");
222 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set) 227 for (TaskSet task_set = 0; task_set < kNumberOfTaskSets; ++task_set)
223 state->AppendBoolean(tasks_pending_[task_set]); 228 state->AppendBoolean(tasks_pending_[task_set]);
224 state->EndArray(); 229 state->EndArray();
225 return state; 230 return state;
226 } 231 }
227 232
228 } // namespace cc 233 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698