| OLD | NEW |
| 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 "base/containers/stack_container.h" | 7 #include "base/containers/stack_container.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 // Only used as std::find_if predicate for DCHECKs. | 85 // Only used as std::find_if predicate for DCHECKs. |
| 86 bool WasCanceled(const internal::RasterWorkerPoolTask* task) { | 86 bool WasCanceled(const internal::RasterWorkerPoolTask* task) { |
| 87 return task->WasCanceled(); | 87 return task->WasCanceled(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace | 90 } // namespace |
| 91 | 91 |
| 92 PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool( | 92 PixelBufferRasterWorkerPool::PixelBufferRasterWorkerPool( |
| 93 ResourceProvider* resource_provider, | 93 ResourceProvider* resource_provider, |
| 94 ContextProvider* context_provider, |
| 94 size_t num_threads, | 95 size_t num_threads, |
| 95 size_t max_transfer_buffer_usage_bytes) | 96 size_t max_transfer_buffer_usage_bytes) |
| 96 : RasterWorkerPool(resource_provider, num_threads), | 97 : RasterWorkerPool(resource_provider, context_provider, num_threads), |
| 97 shutdown_(false), | 98 shutdown_(false), |
| 98 scheduled_raster_task_count_(0), | 99 scheduled_raster_task_count_(0), |
| 99 bytes_pending_upload_(0), | 100 bytes_pending_upload_(0), |
| 100 max_bytes_pending_upload_(max_transfer_buffer_usage_bytes), | 101 max_bytes_pending_upload_(max_transfer_buffer_usage_bytes), |
| 101 has_performed_uploads_since_last_flush_(false), | 102 has_performed_uploads_since_last_flush_(false), |
| 102 check_for_completed_raster_tasks_pending_(false), | 103 check_for_completed_raster_tasks_pending_(false), |
| 103 should_notify_client_if_no_tasks_are_pending_(false), | 104 should_notify_client_if_no_tasks_are_pending_(false), |
| 104 should_notify_client_if_no_tasks_required_for_activation_are_pending_( | 105 should_notify_client_if_no_tasks_required_for_activation_are_pending_( |
| 105 false) { | 106 false) { |
| 106 } | 107 } |
| 107 | 108 |
| 108 PixelBufferRasterWorkerPool::~PixelBufferRasterWorkerPool() { | 109 PixelBufferRasterWorkerPool::~PixelBufferRasterWorkerPool() { |
| 109 DCHECK(shutdown_); | 110 DCHECK(shutdown_); |
| 110 DCHECK(!check_for_completed_raster_tasks_pending_); | 111 DCHECK(!check_for_completed_raster_tasks_pending_); |
| 111 DCHECK_EQ(0u, pixel_buffer_tasks_.size()); | 112 DCHECK_EQ(0u, pixel_buffer_tasks_.size()); |
| 112 DCHECK_EQ(0u, tasks_with_pending_upload_.size()); | 113 DCHECK_EQ(0u, tasks_with_pending_upload_.size()); |
| 113 DCHECK_EQ(0u, completed_tasks_.size()); | 114 DCHECK_EQ(0u, completed_tasks_.size()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 void PixelBufferRasterWorkerPool::Shutdown() { | 117 void PixelBufferRasterWorkerPool::Shutdown() { |
| 117 shutdown_ = true; | 118 shutdown_ = true; |
| 118 RasterWorkerPool::Shutdown(); | 119 RasterWorkerPool::Shutdown(); |
| 119 RasterWorkerPool::CheckForCompletedTasks(); | 120 CheckForCompletedWorkerTasks(); |
| 120 CheckForCompletedUploads(); | 121 CheckForCompletedUploads(); |
| 121 check_for_completed_raster_tasks_callback_.Cancel(); | 122 check_for_completed_raster_tasks_callback_.Cancel(); |
| 122 check_for_completed_raster_tasks_pending_ = false; | 123 check_for_completed_raster_tasks_pending_ = false; |
| 123 for (TaskMap::iterator it = pixel_buffer_tasks_.begin(); | 124 for (TaskMap::iterator it = pixel_buffer_tasks_.begin(); |
| 124 it != pixel_buffer_tasks_.end(); ++it) { | 125 it != pixel_buffer_tasks_.end(); ++it) { |
| 125 internal::RasterWorkerPoolTask* task = it->first; | 126 internal::RasterWorkerPoolTask* task = it->first; |
| 126 internal::WorkerPoolTask* pixel_buffer_task = it->second.get(); | 127 internal::WorkerPoolTask* pixel_buffer_task = it->second.get(); |
| 127 | 128 |
| 128 // All inactive tasks needs to be canceled. | 129 // All inactive tasks needs to be canceled. |
| 129 if (!pixel_buffer_task && !task->HasFinishedRunning()) { | 130 if (!pixel_buffer_task && !task->HasFinishedRunning()) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 142 if (!should_notify_client_if_no_tasks_are_pending_) | 143 if (!should_notify_client_if_no_tasks_are_pending_) |
| 143 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); | 144 TRACE_EVENT_ASYNC_BEGIN0("cc", "ScheduledTasks", this); |
| 144 | 145 |
| 145 should_notify_client_if_no_tasks_are_pending_ = true; | 146 should_notify_client_if_no_tasks_are_pending_ = true; |
| 146 should_notify_client_if_no_tasks_required_for_activation_are_pending_ = true; | 147 should_notify_client_if_no_tasks_required_for_activation_are_pending_ = true; |
| 147 | 148 |
| 148 tasks_required_for_activation_.clear(); | 149 tasks_required_for_activation_.clear(); |
| 149 | 150 |
| 150 // Build new pixel buffer task set. | 151 // Build new pixel buffer task set. |
| 151 TaskMap new_pixel_buffer_tasks; | 152 TaskMap new_pixel_buffer_tasks; |
| 153 RasterTaskVector gpu_raster_tasks; |
| 152 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); | 154 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); |
| 153 it != raster_tasks().end(); ++it) { | 155 it != raster_tasks().end(); ++it) { |
| 154 internal::RasterWorkerPoolTask* task = it->get(); | 156 internal::RasterWorkerPoolTask* task = it->get(); |
| 155 DCHECK(new_pixel_buffer_tasks.find(task) == new_pixel_buffer_tasks.end()); | 157 DCHECK(new_pixel_buffer_tasks.find(task) == new_pixel_buffer_tasks.end()); |
| 156 DCHECK(!task->HasCompleted()); | 158 DCHECK(!task->HasCompleted()); |
| 157 DCHECK(!task->WasCanceled()); | 159 DCHECK(!task->WasCanceled()); |
| 158 | 160 |
| 161 if (task->use_gpu_rasterization()) { |
| 162 gpu_raster_tasks.push_back(task); |
| 163 continue; |
| 164 } |
| 165 |
| 159 new_pixel_buffer_tasks[task] = pixel_buffer_tasks_[task]; | 166 new_pixel_buffer_tasks[task] = pixel_buffer_tasks_[task]; |
| 160 pixel_buffer_tasks_.erase(task); | 167 pixel_buffer_tasks_.erase(task); |
| 161 | 168 |
| 162 if (IsRasterTaskRequiredForActivation(task)) | 169 if (IsRasterTaskRequiredForActivation(task)) |
| 163 tasks_required_for_activation_.insert(task); | 170 tasks_required_for_activation_.insert(task); |
| 164 } | 171 } |
| 165 | 172 |
| 166 // Transfer remaining pixel buffer tasks to |new_pixel_buffer_tasks| | 173 // Transfer remaining pixel buffer tasks to |new_pixel_buffer_tasks| |
| 167 // and cancel all remaining inactive tasks. | 174 // and cancel all remaining inactive tasks. |
| 168 for (TaskMap::iterator it = pixel_buffer_tasks_.begin(); | 175 for (TaskMap::iterator it = pixel_buffer_tasks_.begin(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 181 task) == completed_tasks_.end()); | 188 task) == completed_tasks_.end()); |
| 182 completed_tasks_.push_back(task); | 189 completed_tasks_.push_back(task); |
| 183 } else if (IsRasterTaskRequiredForActivation(task)) { | 190 } else if (IsRasterTaskRequiredForActivation(task)) { |
| 184 tasks_required_for_activation_.insert(task); | 191 tasks_required_for_activation_.insert(task); |
| 185 } | 192 } |
| 186 } | 193 } |
| 187 | 194 |
| 188 // |tasks_required_for_activation_| contains all tasks that need to | 195 // |tasks_required_for_activation_| contains all tasks that need to |
| 189 // complete before we can send a "ready to activate" signal. Tasks | 196 // complete before we can send a "ready to activate" signal. Tasks |
| 190 // that have already completed should not be part of this set. | 197 // that have already completed should not be part of this set. |
| 191 for (TaskDeque::const_iterator it = completed_tasks_.begin(); | 198 for (RasterTaskDeque::const_iterator it = completed_tasks_.begin(); |
| 192 it != completed_tasks_.end() && !tasks_required_for_activation_.empty(); | 199 it != completed_tasks_.end() && !tasks_required_for_activation_.empty(); |
| 193 ++it) { | 200 ++it) { |
| 194 tasks_required_for_activation_.erase(*it); | 201 tasks_required_for_activation_.erase(*it); |
| 195 } | 202 } |
| 196 | 203 |
| 197 pixel_buffer_tasks_.swap(new_pixel_buffer_tasks); | 204 pixel_buffer_tasks_.swap(new_pixel_buffer_tasks); |
| 198 | 205 |
| 199 // Check for completed tasks when ScheduleTasks() is called as | 206 // Check for completed tasks when ScheduleTasks() is called as |
| 200 // priorities might have changed and this maximizes the number | 207 // priorities might have changed and this maximizes the number |
| 201 // of top priority tasks that are scheduled. | 208 // of top priority tasks that are scheduled. |
| 202 RasterWorkerPool::CheckForCompletedTasks(); | 209 CheckForCompletedWorkerTasks(); |
| 203 CheckForCompletedUploads(); | 210 CheckForCompletedUploads(); |
| 204 FlushUploads(); | 211 FlushUploads(); |
| 205 | 212 |
| 206 // Schedule new tasks. | 213 // Schedule new tasks. |
| 207 ScheduleMoreTasks(); | 214 ScheduleMoreTasks(); |
| 208 | 215 |
| 209 // Cancel any pending check for completed raster tasks and schedule | 216 // Cancel any pending check for completed raster tasks and schedule |
| 210 // another check. | 217 // another check. |
| 211 check_for_completed_raster_tasks_callback_.Cancel(); | 218 check_for_completed_raster_tasks_callback_.Cancel(); |
| 212 check_for_completed_raster_tasks_pending_ = false; | 219 check_for_completed_raster_tasks_pending_ = false; |
| 213 ScheduleCheckForCompletedRasterTasks(); | 220 ScheduleCheckForCompletedRasterTasks(); |
| 214 | 221 |
| 222 RunGpuRasterTasks(gpu_raster_tasks); |
| 223 |
| 215 TRACE_EVENT_ASYNC_STEP_INTO1( | 224 TRACE_EVENT_ASYNC_STEP_INTO1( |
| 216 "cc", "ScheduledTasks", this, StateName(), | 225 "cc", "ScheduledTasks", this, StateName(), |
| 217 "state", TracedValue::FromValue(StateAsValue().release())); | 226 "state", TracedValue::FromValue(StateAsValue().release())); |
| 218 } | 227 } |
| 219 | 228 |
| 220 GLenum PixelBufferRasterWorkerPool::GetResourceTarget() const { | 229 GLenum PixelBufferRasterWorkerPool::GetResourceTarget() const { |
| 221 return GL_TEXTURE_2D; | 230 return GL_TEXTURE_2D; |
| 222 } | 231 } |
| 223 | 232 |
| 224 ResourceFormat PixelBufferRasterWorkerPool::GetResourceFormat() const { | 233 ResourceFormat PixelBufferRasterWorkerPool::GetResourceFormat() const { |
| 225 return resource_provider()->memory_efficient_texture_format(); | 234 return resource_provider()->memory_efficient_texture_format(); |
| 226 } | 235 } |
| 227 | 236 |
| 228 void PixelBufferRasterWorkerPool::CheckForCompletedTasks() { | 237 void PixelBufferRasterWorkerPool::CheckForCompletedTasks() { |
| 229 TRACE_EVENT0("cc", "PixelBufferRasterWorkerPool::CheckForCompletedTasks"); | 238 TRACE_EVENT0("cc", "PixelBufferRasterWorkerPool::CheckForCompletedTasks"); |
| 230 | 239 |
| 231 RasterWorkerPool::CheckForCompletedTasks(); | 240 RasterWorkerPool::CheckForCompletedTasks(); |
| 232 CheckForCompletedUploads(); | 241 CheckForCompletedUploads(); |
| 233 FlushUploads(); | 242 FlushUploads(); |
| 234 | 243 |
| 235 TaskDeque completed_tasks; | 244 RasterTaskDeque completed_tasks; |
| 236 completed_tasks_.swap(completed_tasks); | 245 completed_tasks_.swap(completed_tasks); |
| 237 | 246 |
| 238 while (!completed_tasks.empty()) { | 247 while (!completed_tasks.empty()) { |
| 239 internal::RasterWorkerPoolTask* task = completed_tasks.front().get(); | 248 internal::RasterWorkerPoolTask* task = completed_tasks.front().get(); |
| 240 DCHECK(pixel_buffer_tasks_.find(task) != pixel_buffer_tasks_.end()); | 249 DCHECK(pixel_buffer_tasks_.find(task) != pixel_buffer_tasks_.end()); |
| 241 | 250 |
| 242 pixel_buffer_tasks_.erase(task); | 251 pixel_buffer_tasks_.erase(task); |
| 243 | 252 |
| 244 task->WillComplete(); | 253 task->WillComplete(); |
| 245 task->CompleteOnOriginThread(); | 254 task->CompleteOnOriginThread(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 286 |
| 278 void PixelBufferRasterWorkerPool::FlushUploads() { | 287 void PixelBufferRasterWorkerPool::FlushUploads() { |
| 279 if (!has_performed_uploads_since_last_flush_) | 288 if (!has_performed_uploads_since_last_flush_) |
| 280 return; | 289 return; |
| 281 | 290 |
| 282 resource_provider()->ShallowFlushIfSupported(); | 291 resource_provider()->ShallowFlushIfSupported(); |
| 283 has_performed_uploads_since_last_flush_ = false; | 292 has_performed_uploads_since_last_flush_ = false; |
| 284 } | 293 } |
| 285 | 294 |
| 286 void PixelBufferRasterWorkerPool::CheckForCompletedUploads() { | 295 void PixelBufferRasterWorkerPool::CheckForCompletedUploads() { |
| 287 TaskDeque tasks_with_completed_uploads; | 296 RasterTaskDeque tasks_with_completed_uploads; |
| 288 | 297 |
| 289 // First check if any have completed. | 298 // First check if any have completed. |
| 290 while (!tasks_with_pending_upload_.empty()) { | 299 while (!tasks_with_pending_upload_.empty()) { |
| 291 internal::RasterWorkerPoolTask* task = | 300 internal::RasterWorkerPoolTask* task = |
| 292 tasks_with_pending_upload_.front().get(); | 301 tasks_with_pending_upload_.front().get(); |
| 293 | 302 |
| 294 // Uploads complete in the order they are issued. | 303 // Uploads complete in the order they are issued. |
| 295 if (!resource_provider()->DidSetPixelsComplete(task->resource()->id())) | 304 if (!resource_provider()->DidSetPixelsComplete(task->resource()->id())) |
| 296 break; | 305 break; |
| 297 | 306 |
| 298 tasks_with_completed_uploads.push_back(task); | 307 tasks_with_completed_uploads.push_back(task); |
| 299 tasks_with_pending_upload_.pop_front(); | 308 tasks_with_pending_upload_.pop_front(); |
| 300 } | 309 } |
| 301 | 310 |
| 302 DCHECK(client()); | 311 DCHECK(client()); |
| 303 bool should_force_some_uploads_to_complete = | 312 bool should_force_some_uploads_to_complete = |
| 304 shutdown_ || client()->ShouldForceTasksRequiredForActivationToComplete(); | 313 shutdown_ || client()->ShouldForceTasksRequiredForActivationToComplete(); |
| 305 | 314 |
| 306 if (should_force_some_uploads_to_complete) { | 315 if (should_force_some_uploads_to_complete) { |
| 307 TaskDeque tasks_with_uploads_to_force; | 316 RasterTaskDeque tasks_with_uploads_to_force; |
| 308 TaskDeque::iterator it = tasks_with_pending_upload_.begin(); | 317 RasterTaskDeque::iterator it = tasks_with_pending_upload_.begin(); |
| 309 while (it != tasks_with_pending_upload_.end()) { | 318 while (it != tasks_with_pending_upload_.end()) { |
| 310 internal::RasterWorkerPoolTask* task = it->get(); | 319 internal::RasterWorkerPoolTask* task = it->get(); |
| 311 DCHECK(pixel_buffer_tasks_.find(task) != pixel_buffer_tasks_.end()); | 320 DCHECK(pixel_buffer_tasks_.find(task) != pixel_buffer_tasks_.end()); |
| 312 | 321 |
| 313 // Force all uploads required for activation to complete. | 322 // Force all uploads required for activation to complete. |
| 314 // During shutdown, force all pending uploads to complete. | 323 // During shutdown, force all pending uploads to complete. |
| 315 if (shutdown_ || IsRasterTaskRequiredForActivation(task)) { | 324 if (shutdown_ || IsRasterTaskRequiredForActivation(task)) { |
| 316 tasks_with_uploads_to_force.push_back(task); | 325 tasks_with_uploads_to_force.push_back(task); |
| 317 tasks_with_completed_uploads.push_back(task); | 326 tasks_with_completed_uploads.push_back(task); |
| 318 it = tasks_with_pending_upload_.erase(it); | 327 it = tasks_with_pending_upload_.erase(it); |
| 319 continue; | 328 continue; |
| 320 } | 329 } |
| 321 | 330 |
| 322 ++it; | 331 ++it; |
| 323 } | 332 } |
| 324 | 333 |
| 325 // Force uploads in reverse order. Since forcing can cause a wait on | 334 // Force uploads in reverse order. Since forcing can cause a wait on |
| 326 // all previous uploads, we would rather wait only once downstream. | 335 // all previous uploads, we would rather wait only once downstream. |
| 327 for (TaskDeque::reverse_iterator it = tasks_with_uploads_to_force.rbegin(); | 336 for (RasterTaskDeque::reverse_iterator it = |
| 328 it != tasks_with_uploads_to_force.rend(); | 337 tasks_with_uploads_to_force.rbegin(); |
| 329 ++it) { | 338 it != tasks_with_uploads_to_force.rend(); ++it) { |
| 330 resource_provider()->ForceSetPixelsToComplete((*it)->resource()->id()); | 339 resource_provider()->ForceSetPixelsToComplete((*it)->resource()->id()); |
| 331 has_performed_uploads_since_last_flush_ = true; | 340 has_performed_uploads_since_last_flush_ = true; |
| 332 } | 341 } |
| 333 } | 342 } |
| 334 | 343 |
| 335 // Release shared memory and move tasks with completed uploads | 344 // Release shared memory and move tasks with completed uploads |
| 336 // to |completed_tasks_|. | 345 // to |completed_tasks_|. |
| 337 while (!tasks_with_completed_uploads.empty()) { | 346 while (!tasks_with_completed_uploads.empty()) { |
| 338 internal::RasterWorkerPoolTask* task = | 347 internal::RasterWorkerPoolTask* task = |
| 339 tasks_with_completed_uploads.front().get(); | 348 tasks_with_completed_uploads.front().get(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 381 |
| 373 void PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks() { | 382 void PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks() { |
| 374 TRACE_EVENT0( | 383 TRACE_EVENT0( |
| 375 "cc", "PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks"); | 384 "cc", "PixelBufferRasterWorkerPool::CheckForCompletedRasterTasks"); |
| 376 | 385 |
| 377 DCHECK(should_notify_client_if_no_tasks_are_pending_); | 386 DCHECK(should_notify_client_if_no_tasks_are_pending_); |
| 378 | 387 |
| 379 check_for_completed_raster_tasks_callback_.Cancel(); | 388 check_for_completed_raster_tasks_callback_.Cancel(); |
| 380 check_for_completed_raster_tasks_pending_ = false; | 389 check_for_completed_raster_tasks_pending_ = false; |
| 381 | 390 |
| 382 RasterWorkerPool::CheckForCompletedTasks(); | 391 CheckForCompletedWorkerTasks(); |
| 383 CheckForCompletedUploads(); | 392 CheckForCompletedUploads(); |
| 384 FlushUploads(); | 393 FlushUploads(); |
| 385 | 394 |
| 386 // Determine what client notifications to generate. | 395 // Determine what client notifications to generate. |
| 387 bool will_notify_client_that_no_tasks_required_for_activation_are_pending = | 396 bool will_notify_client_that_no_tasks_required_for_activation_are_pending = |
| 388 (should_notify_client_if_no_tasks_required_for_activation_are_pending_ && | 397 (should_notify_client_if_no_tasks_required_for_activation_are_pending_ && |
| 389 !HasPendingTasksRequiredForActivation()); | 398 !HasPendingTasksRequiredForActivation()); |
| 390 bool will_notify_client_that_no_tasks_are_pending = | 399 bool will_notify_client_that_no_tasks_are_pending = |
| 391 (should_notify_client_if_no_tasks_are_pending_ && | 400 (should_notify_client_if_no_tasks_are_pending_ && |
| 392 !HasPendingTasks()); | 401 !HasPendingTasks()); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 586 |
| 578 void PixelBufferRasterWorkerPool::OnRasterTaskCompleted( | 587 void PixelBufferRasterWorkerPool::OnRasterTaskCompleted( |
| 579 scoped_refptr<internal::RasterWorkerPoolTask> task, | 588 scoped_refptr<internal::RasterWorkerPoolTask> task, |
| 580 bool was_canceled, | 589 bool was_canceled, |
| 581 bool needs_upload) { | 590 bool needs_upload) { |
| 582 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("cc"), | 591 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("cc"), |
| 583 "PixelBufferRasterWorkerPool::OnRasterTaskCompleted", | 592 "PixelBufferRasterWorkerPool::OnRasterTaskCompleted", |
| 584 "was_canceled", was_canceled, | 593 "was_canceled", was_canceled, |
| 585 "needs_upload", needs_upload); | 594 "needs_upload", needs_upload); |
| 586 | 595 |
| 596 DCHECK(!task->use_gpu_rasterization()); |
| 587 DCHECK(pixel_buffer_tasks_.find(task.get()) != pixel_buffer_tasks_.end()); | 597 DCHECK(pixel_buffer_tasks_.find(task.get()) != pixel_buffer_tasks_.end()); |
| 588 | 598 |
| 589 // Balanced with MapPixelBuffer() call in ScheduleMoreTasks(). | 599 // Balanced with MapPixelBuffer() call in ScheduleMoreTasks(). |
| 590 resource_provider()->UnmapPixelBuffer(task->resource()->id()); | 600 resource_provider()->UnmapPixelBuffer(task->resource()->id()); |
| 591 | 601 |
| 592 if (!needs_upload) { | 602 if (!needs_upload) { |
| 593 resource_provider()->ReleasePixelBuffer(task->resource()->id()); | 603 resource_provider()->ReleasePixelBuffer(task->resource()->id()); |
| 594 | 604 |
| 595 if (was_canceled) { | 605 if (was_canceled) { |
| 596 // When priorites change, a raster task can be canceled as a result of | 606 // When priorites change, a raster task can be canceled as a result of |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 | 678 |
| 669 throttle_state->SetInteger("bytes_available_for_upload", | 679 throttle_state->SetInteger("bytes_available_for_upload", |
| 670 max_bytes_pending_upload_ - bytes_pending_upload_); | 680 max_bytes_pending_upload_ - bytes_pending_upload_); |
| 671 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); | 681 throttle_state->SetInteger("bytes_pending_upload", bytes_pending_upload_); |
| 672 throttle_state->SetInteger("scheduled_raster_task_count", | 682 throttle_state->SetInteger("scheduled_raster_task_count", |
| 673 scheduled_raster_task_count_); | 683 scheduled_raster_task_count_); |
| 674 return throttle_state.PassAs<base::Value>(); | 684 return throttle_state.PassAs<base::Value>(); |
| 675 } | 685 } |
| 676 | 686 |
| 677 } // namespace cc | 687 } // namespace cc |
| OLD | NEW |