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

Side by Side Diff: cc/raster/pixel_buffer_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/pixel_buffer_tile_task_worker_pool.h" 5 #include "cc/raster/pixel_buffer_tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/containers/stack_container.h" 9 #include "base/containers/stack_container.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type); 306 DCHECK_EQ(RasterTaskState::COMPLETED, state_it->type);
307 307
308 std::swap(*state_it, raster_task_states_.back()); 308 std::swap(*state_it, raster_task_states_.back());
309 raster_task_states_.pop_back(); 309 raster_task_states_.pop_back();
310 310
311 task->RunReplyOnOriginThread(); 311 task->RunReplyOnOriginThread();
312 } 312 }
313 completed_raster_tasks_.clear(); 313 completed_raster_tasks_.clear();
314 } 314 }
315 315
316 ResourceFormat PixelBufferTileTaskWorkerPool::GetResourceFormat() const { 316 ResourceFormat PixelBufferTileTaskWorkerPool::GetResourceFormat(
317 return resource_provider_->memory_efficient_texture_format(); 317 bool must_be_noncompressed,
318 bool must_support_alpha) const {
319 return resource_provider_->memory_efficient_texture_format(
320 must_be_noncompressed, must_support_alpha);
318 } 321 }
319 322
320 bool PixelBufferTileTaskWorkerPool::GetResourceRequiresSwizzle() const { 323 bool PixelBufferTileTaskWorkerPool::GetResourceRequiresSwizzle(
321 return !PlatformColor::SameComponentOrder(GetResourceFormat()); 324 bool must_be_noncompressed,
325 bool must_support_alpha) const {
326 return !PlatformColor::SameComponentOrder(
327 GetResourceFormat(must_be_noncompressed, must_support_alpha));
322 } 328 }
323 329
324 scoped_ptr<RasterBuffer> PixelBufferTileTaskWorkerPool::AcquireBufferForRaster( 330 scoped_ptr<RasterBuffer> PixelBufferTileTaskWorkerPool::AcquireBufferForRaster(
325 const Resource* resource, 331 const Resource* resource,
326 uint64_t resource_content_id, 332 uint64_t resource_content_id,
327 uint64_t previous_content_id) { 333 uint64_t previous_content_id) {
328 return make_scoped_ptr<RasterBuffer>( 334 return make_scoped_ptr<RasterBuffer>(
329 new RasterBufferImpl(resource_provider_, resource)); 335 new RasterBufferImpl(resource_provider_, resource));
330 } 336 }
331 337
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 throttle_state->SetInteger( 751 throttle_state->SetInteger(
746 "bytes_available_for_upload", 752 "bytes_available_for_upload",
747 static_cast<int>(max_bytes_pending_upload_ - bytes_pending_upload_)); 753 static_cast<int>(max_bytes_pending_upload_ - bytes_pending_upload_));
748 throttle_state->SetInteger("bytes_pending_upload", 754 throttle_state->SetInteger("bytes_pending_upload",
749 static_cast<int>(bytes_pending_upload_)); 755 static_cast<int>(bytes_pending_upload_));
750 throttle_state->SetInteger("scheduled_raster_task_count", 756 throttle_state->SetInteger("scheduled_raster_task_count",
751 static_cast<int>(scheduled_raster_task_count_)); 757 static_cast<int>(scheduled_raster_task_count_));
752 } 758 }
753 759
754 } // namespace cc 760 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698