| 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/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/debug/benchmark_instrumentation.h" | 10 #include "cc/debug/benchmark_instrumentation.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Record the solid color prediction. | 83 // Record the solid color prediction. |
| 84 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed", | 84 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed", |
| 85 analysis_.is_solid_color); | 85 analysis_.is_solid_color); |
| 86 rendering_stats_->AddAnalysisResult(duration, analysis_.is_solid_color); | 86 rendering_stats_->AddAnalysisResult(duration, analysis_.is_solid_color); |
| 87 | 87 |
| 88 // Clear the flag if we're not using the estimator. | 88 // Clear the flag if we're not using the estimator. |
| 89 analysis_.is_solid_color &= kUseColorEstimator; | 89 analysis_.is_solid_color &= kUseColorEstimator; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool RunRasterOnThread(SkDevice* device, unsigned thread_index) { | 92 bool RunRasterOnThread(SkBaseDevice* device, unsigned thread_index) { |
| 93 TRACE_EVENT2( | 93 TRACE_EVENT2( |
| 94 benchmark_instrumentation::kCategory, | 94 benchmark_instrumentation::kCategory, |
| 95 benchmark_instrumentation::kRunRasterOnThread, | 95 benchmark_instrumentation::kRunRasterOnThread, |
| 96 benchmark_instrumentation::kData, | 96 benchmark_instrumentation::kData, |
| 97 TracedValue::FromValue(DataAsValue().release()), | 97 TracedValue::FromValue(DataAsValue().release()), |
| 98 "raster_mode", | 98 "raster_mode", |
| 99 TracedValue::FromValue(RasterModeAsValue(raster_mode_).release())); | 99 TracedValue::FromValue(RasterModeAsValue(raster_mode_).release())); |
| 100 | 100 |
| 101 devtools_instrumentation::ScopedLayerTask raster_task( | 101 devtools_instrumentation::ScopedLayerTask raster_task( |
| 102 devtools_instrumentation::kRasterTask, layer_id_); | 102 devtools_instrumentation::kRasterTask, layer_id_); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 100000, | 146 100000, |
| 147 100); | 147 100); |
| 148 } else { | 148 } else { |
| 149 picture_clone->RasterToBitmap( | 149 picture_clone->RasterToBitmap( |
| 150 &canvas, content_rect_, contents_scale_, NULL); | 150 &canvas, content_rect_, contents_scale_, NULL); |
| 151 } | 151 } |
| 152 return true; | 152 return true; |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Overridden from internal::RasterWorkerPoolTask: | 155 // Overridden from internal::RasterWorkerPoolTask: |
| 156 virtual bool RunOnWorkerThread(SkDevice* device, unsigned thread_index) | 156 virtual bool RunOnWorkerThread(SkBaseDevice* device, unsigned thread_index) |
| 157 OVERRIDE { | 157 OVERRIDE { |
| 158 RunAnalysisOnThread(thread_index); | 158 RunAnalysisOnThread(thread_index); |
| 159 return RunRasterOnThread(device, thread_index); | 159 return RunRasterOnThread(device, thread_index); |
| 160 } | 160 } |
| 161 virtual void CompleteOnOriginThread() OVERRIDE { | 161 virtual void CompleteOnOriginThread() OVERRIDE { |
| 162 reply_.Run(analysis_, !HasFinishedRunning() || WasCanceled()); | 162 reply_.Run(analysis_, !HasFinishedRunning() || WasCanceled()); |
| 163 } | 163 } |
| 164 | 164 |
| 165 protected: | 165 protected: |
| 166 virtual ~RasterWorkerPoolTaskImpl() {} | 166 virtual ~RasterWorkerPoolTaskImpl() {} |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 internal::GraphNode* decode_node = CreateGraphNodeForTask( | 535 internal::GraphNode* decode_node = CreateGraphNodeForTask( |
| 536 decode_task, priority, graph); | 536 decode_task, priority, graph); |
| 537 decode_node->add_dependent(raster_node); | 537 decode_node->add_dependent(raster_node); |
| 538 } | 538 } |
| 539 | 539 |
| 540 return raster_node; | 540 return raster_node; |
| 541 } | 541 } |
| 542 | 542 |
| 543 } // namespace cc | 543 } // namespace cc |
| OLD | NEW |