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

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

Issue 234403005: cc: Add CopyResource function to ResourceProvider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review feedback Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/image_raster_worker_pool.cc ('k') | cc/resources/resource_pool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 RasterTaskState::TaskComparator(task)); 394 RasterTaskState::TaskComparator(task));
395 DCHECK(state_it != raster_task_states_.end()); 395 DCHECK(state_it != raster_task_states_.end());
396 RasterTaskState& state = *state_it; 396 RasterTaskState& state = *state_it;
397 397
398 bytes_pending_upload_ -= task->resource()->bytes(); 398 bytes_pending_upload_ -= task->resource()->bytes();
399 399
400 task->WillComplete(); 400 task->WillComplete();
401 task->CompleteOnOriginThread(this); 401 task->CompleteOnOriginThread(this);
402 task->DidComplete(); 402 task->DidComplete();
403 403
404 // Async set pixels commands are not necessarily processed in-sequence with
405 // drawing commands. Read lock fences are required to ensure that async
406 // commands don't access the resource while used for drawing.
407 resource_provider_->EnableReadLockFences(task->resource()->id(), true);
408
404 DCHECK(std::find(completed_raster_tasks_.begin(), 409 DCHECK(std::find(completed_raster_tasks_.begin(),
405 completed_raster_tasks_.end(), 410 completed_raster_tasks_.end(),
406 task) == completed_raster_tasks_.end()); 411 task) == completed_raster_tasks_.end());
407 completed_raster_tasks_.push_back(task); 412 completed_raster_tasks_.push_back(task);
408 state.type = RasterTaskState::COMPLETED; 413 state.type = RasterTaskState::COMPLETED;
409 DCHECK_LE(static_cast<size_t>(state.required_for_activation), 414 DCHECK_LE(static_cast<size_t>(state.required_for_activation),
410 raster_tasks_required_for_activation_count_); 415 raster_tasks_required_for_activation_count_);
411 raster_tasks_required_for_activation_count_ -= 416 raster_tasks_required_for_activation_count_ -=
412 state.required_for_activation; 417 state.required_for_activation;
413 } 418 }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 792
788 throttle_state->SetInteger("bytes_available_for_upload", 793 throttle_state->SetInteger("bytes_available_for_upload",
789 max_bytes_pending_upload_ - bytes_pending_upload_); 794 max_bytes_pending_upload_ - bytes_pending_upload_);
790 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); 795 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_);
791 throttle_state->SetInteger("scheduled_raster_task_count", 796 throttle_state->SetInteger("scheduled_raster_task_count",
792 scheduled_raster_task_count_); 797 scheduled_raster_task_count_);
793 return throttle_state.PassAs<base::Value>(); 798 return throttle_state.PassAs<base::Value>();
794 } 799 }
795 800
796 } // namespace cc 801 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/image_raster_worker_pool.cc ('k') | cc/resources/resource_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698