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

Side by Side Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 10818038: Make GPU benchmarking numAnimationFrames and totalPaintTime work in software mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge. Created 8 years, 4 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
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/gpu/gpu_benchmarking_extension.h" 5 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 static v8::Handle<v8::Value> GetRenderingStats(const v8::Arguments& args) { 153 static v8::Handle<v8::Value> GetRenderingStats(const v8::Arguments& args) {
154 WebFrame* web_frame = WebFrame::frameForEnteredContext(); 154 WebFrame* web_frame = WebFrame::frameForEnteredContext();
155 if (!web_frame) 155 if (!web_frame)
156 return v8::Undefined(); 156 return v8::Undefined();
157 157
158 WebView* web_view = web_frame->view(); 158 WebView* web_view = web_frame->view();
159 if (!web_view) 159 if (!web_view)
160 return v8::Undefined(); 160 return v8::Undefined();
161 161
162 RenderViewImpl* render_view_impl = RenderViewImpl::FromWebView(web_view);
163 if (!render_view_impl)
164 return v8::Undefined();
165
162 WebRenderingStats stats; 166 WebRenderingStats stats;
163 web_view->renderingStats(stats); 167 render_view_impl->GetRenderingStats(stats);
164 168
165 v8::Handle<v8::Object> stats_object = v8::Object::New(); 169 v8::Handle<v8::Object> stats_object = v8::Object::New();
166 if (stats.numAnimationFrames) 170 if (stats.numAnimationFrames)
167 stats_object->Set(v8::String::New("numAnimationFrames"), 171 stats_object->Set(v8::String::New("numAnimationFrames"),
168 v8::Integer::New(stats.numAnimationFrames), 172 v8::Integer::New(stats.numAnimationFrames),
169 v8::ReadOnly); 173 v8::ReadOnly);
170 if (stats.numFramesSentToScreen) 174 if (stats.numFramesSentToScreen)
171 stats_object->Set(v8::String::New("numFramesSentToScreen"), 175 stats_object->Set(v8::String::New("numFramesSentToScreen"),
172 v8::Integer::New(stats.numFramesSentToScreen), 176 v8::Integer::New(stats.numFramesSentToScreen),
173 v8::ReadOnly); 177 v8::ReadOnly);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 298
295 return results.results_array(); 299 return results.results_array();
296 } 300 }
297 }; 301 };
298 302
299 v8::Extension* GpuBenchmarkingExtension::Get() { 303 v8::Extension* GpuBenchmarkingExtension::Get() {
300 return new GpuBenchmarkingWrapper(); 304 return new GpuBenchmarkingWrapper();
301 } 305 }
302 306
303 } // namespace content 307 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698