Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: cc/resources/raster_worker_pool.cc

Issue 16907002: Update Android to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/devtools_instrumentation.h" 10 #include "cc/debug/devtools_instrumentation.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 metadata_(metadata), 87 metadata_(metadata),
88 rendering_stats_(rendering_stats), 88 rendering_stats_(rendering_stats),
89 reply_(reply) {} 89 reply_(reply) {}
90 90
91 void RunAnalysisOnThread(unsigned thread_index) { 91 void RunAnalysisOnThread(unsigned thread_index) {
92 TRACE_EVENT1("cc", 92 TRACE_EVENT1("cc",
93 "RasterWorkerPoolTaskImpl::RunAnalysisOnThread", 93 "RasterWorkerPoolTaskImpl::RunAnalysisOnThread",
94 "metadata", 94 "metadata",
95 TracedValue::FromValue(metadata_.AsValue().release())); 95 TracedValue::FromValue(metadata_.AsValue().release()));
96 96
97 DCHECK(picture_pile_); 97 DCHECK(picture_pile_.get());
98 DCHECK(rendering_stats_); 98 DCHECK(rendering_stats_);
99 99
100 PicturePileImpl* picture_clone = 100 PicturePileImpl* picture_clone =
101 picture_pile_->GetCloneForDrawingOnThread(thread_index); 101 picture_pile_->GetCloneForDrawingOnThread(thread_index);
102 102
103 DCHECK(picture_clone); 103 DCHECK(picture_clone);
104 104
105 base::TimeTicks start_time = rendering_stats_->StartRecording(); 105 base::TimeTicks start_time = rendering_stats_->StartRecording();
106 picture_clone->AnalyzeInRect(content_rect_, contents_scale_, &analysis_); 106 picture_clone->AnalyzeInRect(content_rect_, contents_scale_, &analysis_);
107 base::TimeDelta duration = rendering_stats_->EndRecording(start_time); 107 base::TimeDelta duration = rendering_stats_->EndRecording(start_time);
108 108
109 // Record the solid color prediction. 109 // Record the solid color prediction.
110 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed", 110 UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed",
111 analysis_.is_solid_color); 111 analysis_.is_solid_color);
112 rendering_stats_->AddTileAnalysisResult(duration, 112 rendering_stats_->AddTileAnalysisResult(duration,
113 analysis_.is_solid_color); 113 analysis_.is_solid_color);
114 114
115 // Clear the flag if we're not using the estimator. 115 // Clear the flag if we're not using the estimator.
116 analysis_.is_solid_color &= use_color_estimator_; 116 analysis_.is_solid_color &= use_color_estimator_;
117 } 117 }
118 118
119 bool RunRasterOnThread(SkDevice* device, unsigned thread_index) { 119 bool RunRasterOnThread(SkDevice* device, unsigned thread_index) {
120 TRACE_EVENT1( 120 TRACE_EVENT1(
121 "cc", "RasterWorkerPoolTaskImpl::RunRasterOnThread", 121 "cc", "RasterWorkerPoolTaskImpl::RunRasterOnThread",
122 "metadata", TracedValue::FromValue(metadata_.AsValue().release())); 122 "metadata", TracedValue::FromValue(metadata_.AsValue().release()));
123 devtools_instrumentation::ScopedLayerTask raster_task( 123 devtools_instrumentation::ScopedLayerTask raster_task(
124 devtools_instrumentation::kRasterTask, metadata_.layer_id); 124 devtools_instrumentation::kRasterTask, metadata_.layer_id);
125 125
126 DCHECK(picture_pile_); 126 DCHECK(picture_pile_.get());
127 DCHECK(device); 127 DCHECK(device);
128 128
129 if (analysis_.is_solid_color) 129 if (analysis_.is_solid_color)
130 return false; 130 return false;
131 131
132 PicturePileImpl* picture_clone = 132 PicturePileImpl* picture_clone =
133 picture_pile_->GetCloneForDrawingOnThread(thread_index); 133 picture_pile_->GetCloneForDrawingOnThread(thread_index);
134 134
135 SkCanvas canvas(device); 135 SkCanvas canvas(device);
136 136
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 scoped_refptr<internal::WorkerPoolTask> new_root(root.internal_); 411 scoped_refptr<internal::WorkerPoolTask> new_root(root.internal_);
412 412
413 TaskGraph graph; 413 TaskGraph graph;
414 BuildTaskGraph(new_root, &graph); 414 BuildTaskGraph(new_root, &graph);
415 WorkerPool::SetTaskGraph(&graph); 415 WorkerPool::SetTaskGraph(&graph);
416 416
417 root_.swap(new_root); 417 root_.swap(new_root);
418 } 418 }
419 419
420 } // namespace cc 420 } // namespace cc
OLDNEW
« no previous file with comments | « android_webview/native/cookie_manager.cc ('k') | chrome/browser/profile_resetter/profile_resetter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698