| 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/raster_worker_pool.h" | 5 #include "cc/resources/raster_worker_pool.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event_synthetic_delay.h" | 7 #include "base/debug/trace_event_synthetic_delay.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 internal::RasterWorkerPoolTask* task) const { | 609 internal::RasterWorkerPoolTask* task) const { |
| 610 return | 610 return |
| 611 raster_tasks_required_for_activation_.find(task) != | 611 raster_tasks_required_for_activation_.find(task) != |
| 612 raster_tasks_required_for_activation_.end(); | 612 raster_tasks_required_for_activation_.end(); |
| 613 } | 613 } |
| 614 | 614 |
| 615 void RasterWorkerPool::RunGpuRasterTasks(const RasterTaskVector& tasks) { | 615 void RasterWorkerPool::RunGpuRasterTasks(const RasterTaskVector& tasks) { |
| 616 if (tasks.empty()) | 616 if (tasks.empty()) |
| 617 return; | 617 return; |
| 618 | 618 |
| 619 context_provider_->MakeGrContextCurrent(); | |
| 620 | |
| 621 GrContext* gr_context = context_provider_->GrContext(); | 619 GrContext* gr_context = context_provider_->GrContext(); |
| 622 // TODO(alokp): Implement TestContextProvider::GrContext(). | 620 // TODO(alokp): Implement TestContextProvider::GrContext(). |
| 623 if (gr_context) | 621 if (gr_context) |
| 624 gr_context->resetContext(); | 622 gr_context->resetContext(); |
| 625 | 623 |
| 626 for (RasterTaskVector::const_iterator it = tasks.begin(); | 624 for (RasterTaskVector::const_iterator it = tasks.begin(); |
| 627 it != tasks.end(); ++it) { | 625 it != tasks.end(); ++it) { |
| 628 internal::RasterWorkerPoolTask* task = it->get(); | 626 internal::RasterWorkerPoolTask* task = it->get(); |
| 629 DCHECK(task->use_gpu_rasterization()); | 627 DCHECK(task->use_gpu_rasterization()); |
| 630 | 628 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 728 |
| 731 internal::GraphNode* decode_node = CreateGraphNodeForTask( | 729 internal::GraphNode* decode_node = CreateGraphNodeForTask( |
| 732 decode_task, priority, graph); | 730 decode_task, priority, graph); |
| 733 decode_node->add_dependent(raster_node); | 731 decode_node->add_dependent(raster_node); |
| 734 } | 732 } |
| 735 | 733 |
| 736 return raster_node; | 734 return raster_node; |
| 737 } | 735 } |
| 738 | 736 |
| 739 } // namespace cc | 737 } // namespace cc |
| OLD | NEW |