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

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

Powered by Google App Engine
This is Rietveld 408576698