| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Record the solid color prediction. | 114 // Record the solid color prediction. |
| 115 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed", | 115 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed", |
| 116 analysis_.is_solid_color); | 116 analysis_.is_solid_color); |
| 117 | 117 |
| 118 // Clear the flag if we're not using the estimator. | 118 // Clear the flag if we're not using the estimator. |
| 119 analysis_.is_solid_color &= kUseColorEstimator; | 119 analysis_.is_solid_color &= kUseColorEstimator; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool RunRasterOnThread(unsigned thread_index, | 122 bool RunRasterOnThread(unsigned thread_index, |
| 123 void* buffer, | 123 void* buffer, |
| 124 const gfx::Size& size, | 124 gfx::Size size, |
| 125 int stride) { | 125 int stride) { |
| 126 TRACE_EVENT2( | 126 TRACE_EVENT2( |
| 127 "cc", | 127 "cc", |
| 128 "RasterWorkerPoolTaskImpl::RunRasterOnThread", | 128 "RasterWorkerPoolTaskImpl::RunRasterOnThread", |
| 129 "data", | 129 "data", |
| 130 TracedValue::FromValue(DataAsValue().release()), | 130 TracedValue::FromValue(DataAsValue().release()), |
| 131 "raster_mode", | 131 "raster_mode", |
| 132 TracedValue::FromValue(RasterModeAsValue(raster_mode_).release())); | 132 TracedValue::FromValue(RasterModeAsValue(raster_mode_).release())); |
| 133 | 133 |
| 134 devtools_instrumentation::ScopedLayerTask raster_task( | 134 devtools_instrumentation::ScopedLayerTask raster_task( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 SkCanvas canvas(&device); | 166 SkCanvas canvas(&device); |
| 167 Raster(picture_pile_->GetCloneForDrawingOnThread(thread_index), &canvas); | 167 Raster(picture_pile_->GetCloneForDrawingOnThread(thread_index), &canvas); |
| 168 ChangeBitmapConfigIfNeeded(bitmap, buffer); | 168 ChangeBitmapConfigIfNeeded(bitmap, buffer); |
| 169 | 169 |
| 170 return true; | 170 return true; |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Overridden from internal::RasterWorkerPoolTask: | 173 // Overridden from internal::RasterWorkerPoolTask: |
| 174 virtual bool RunOnWorkerThread(unsigned thread_index, | 174 virtual bool RunOnWorkerThread(unsigned thread_index, |
| 175 void* buffer, | 175 void* buffer, |
| 176 const gfx::Size& size, | 176 gfx::Size size, |
| 177 int stride) OVERRIDE { | 177 int stride) OVERRIDE { |
| 178 // TODO(alokp): For now run-on-worker-thread implies software rasterization. | 178 // TODO(alokp): For now run-on-worker-thread implies software rasterization. |
| 179 DCHECK(!use_gpu_rasterization()); | 179 DCHECK(!use_gpu_rasterization()); |
| 180 RunAnalysisOnThread(thread_index); | 180 RunAnalysisOnThread(thread_index); |
| 181 return RunRasterOnThread(thread_index, buffer, size, stride); | 181 return RunRasterOnThread(thread_index, buffer, size, stride); |
| 182 } | 182 } |
| 183 | 183 |
| 184 virtual void RunOnOriginThread(ResourceProvider* resource_provider, | 184 virtual void RunOnOriginThread(ResourceProvider* resource_provider, |
| 185 ContextProvider* context_provider) OVERRIDE { | 185 ContextProvider* context_provider) OVERRIDE { |
| 186 // TODO(alokp): For now run-on-origin-thread implies gpu rasterization. | 186 // TODO(alokp): For now run-on-origin-thread implies gpu rasterization. |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 | 770 |
| 771 internal::GraphNode* decode_node = | 771 internal::GraphNode* decode_node = |
| 772 CreateGraphNodeForTask(decode_task, priority, graph); | 772 CreateGraphNodeForTask(decode_task, priority, graph); |
| 773 decode_node->add_dependent(raster_node); | 773 decode_node->add_dependent(raster_node); |
| 774 } | 774 } |
| 775 | 775 |
| 776 return raster_node; | 776 return raster_node; |
| 777 } | 777 } |
| 778 | 778 |
| 779 } // namespace cc | 779 } // namespace cc |
| OLD | NEW |