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