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

Side by Side Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 375303002: cc: Refactor ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/resources/pixel_buffer_raster_worker_pool.h" 5 #include "cc/resources/pixel_buffer_raster_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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // This reduces latency between the time when all tasks required for 308 // This reduces latency between the time when all tasks required for
309 // activation have finished running and the time when the client is 309 // activation have finished running and the time when the client is
310 // notified. 310 // notified.
311 CheckForCompletedRasterTasks(); 311 CheckForCompletedRasterTasks();
312 } 312 }
313 313
314 void PixelBufferRasterWorkerPool::FlushUploads() { 314 void PixelBufferRasterWorkerPool::FlushUploads() {
315 if (!has_performed_uploads_since_last_flush_) 315 if (!has_performed_uploads_since_last_flush_)
316 return; 316 return;
317 317
318 resource_provider_->ShallowFlushIfSupported(); 318 resource_provider_->GetResourceHelper()->ShallowFlushIfSupported();
danakj 2014/07/09 16:01:33 can we just call ShallowFlushCHROMIUM() directly h
sohanjg 2014/07/10 15:11:06 Done.
319 has_performed_uploads_since_last_flush_ = false; 319 has_performed_uploads_since_last_flush_ = false;
320 } 320 }
321 321
322 void PixelBufferRasterWorkerPool::CheckForCompletedUploads() { 322 void PixelBufferRasterWorkerPool::CheckForCompletedUploads() {
323 RasterTask::Vector tasks_with_completed_uploads; 323 RasterTask::Vector tasks_with_completed_uploads;
324 324
325 // First check if any have completed. 325 // First check if any have completed.
326 while (!raster_tasks_with_pending_upload_.empty()) { 326 while (!raster_tasks_with_pending_upload_.empty()) {
327 RasterTask* task = raster_tasks_with_pending_upload_.front().get(); 327 RasterTask* task = raster_tasks_with_pending_upload_.front().get();
328 DCHECK(std::find_if(raster_task_states_.begin(), 328 DCHECK(std::find_if(raster_task_states_.begin(),
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 755
756 throttle_state->SetInteger("bytes_available_for_upload", 756 throttle_state->SetInteger("bytes_available_for_upload",
757 max_bytes_pending_upload_ - bytes_pending_upload_); 757 max_bytes_pending_upload_ - bytes_pending_upload_);
758 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); 758 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_);
759 throttle_state->SetInteger("scheduled_raster_task_count", 759 throttle_state->SetInteger("scheduled_raster_task_count",
760 scheduled_raster_task_count_); 760 scheduled_raster_task_count_);
761 return throttle_state.PassAs<base::Value>(); 761 return throttle_state.PassAs<base::Value>();
762 } 762 }
763 763
764 } // namespace cc 764 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698