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

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

Issue 10868048: Report texture upload time in renderingStats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert to surface_id instead of route_id. Created 8 years, 3 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 | « content/public/common/gpu_rendering_stats.cc ('k') | 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"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
13 #include "content/public/common/gpu_rendering_stats.h"
13 #include "content/public/renderer/render_thread.h" 14 #include "content/public/renderer/render_thread.h"
14 #include "content/renderer/all_rendering_benchmarks.h" 15 #include "content/renderer/all_rendering_benchmarks.h"
15 #include "content/renderer/render_view_impl.h" 16 #include "content/renderer/render_view_impl.h"
16 #include "content/renderer/rendering_benchmark.h" 17 #include "content/renderer/rendering_benchmark.h"
17 #include "third_party/skia/include/core/SkGraphics.h" 18 #include "third_party/skia/include/core/SkGraphics.h"
18 #include "third_party/skia/include/core/SkPicture.h" 19 #include "third_party/skia/include/core/SkPicture.h"
19 #include "third_party/skia/include/core/SkStream.h" 20 #include "third_party/skia/include/core/SkStream.h"
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h " 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h "
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (!web_view) 145 if (!web_view)
145 return v8::Undefined(); 146 return v8::Undefined();
146 147
147 RenderViewImpl* render_view_impl = RenderViewImpl::FromWebView(web_view); 148 RenderViewImpl* render_view_impl = RenderViewImpl::FromWebView(web_view);
148 if (!render_view_impl) 149 if (!render_view_impl)
149 return v8::Undefined(); 150 return v8::Undefined();
150 151
151 WebRenderingStats stats; 152 WebRenderingStats stats;
152 render_view_impl->GetRenderingStats(stats); 153 render_view_impl->GetRenderingStats(stats);
153 154
155 content::GpuRenderingStats gpu_stats;
156 render_view_impl->GetGpuRenderingStats(&gpu_stats);
157
154 v8::Handle<v8::Object> stats_object = v8::Object::New(); 158 v8::Handle<v8::Object> stats_object = v8::Object::New();
155 stats_object->Set(v8::String::New("numAnimationFrames"), 159 stats_object->Set(v8::String::New("numAnimationFrames"),
156 v8::Integer::New(stats.numAnimationFrames)); 160 v8::Integer::New(stats.numAnimationFrames));
157 stats_object->Set(v8::String::New("numFramesSentToScreen"), 161 stats_object->Set(v8::String::New("numFramesSentToScreen"),
158 v8::Integer::New(stats.numFramesSentToScreen)); 162 v8::Integer::New(stats.numFramesSentToScreen));
159 stats_object->Set(v8::String::New("droppedFrameCount"), 163 stats_object->Set(v8::String::New("droppedFrameCount"),
160 v8::Integer::New(stats.droppedFrameCount)); 164 v8::Integer::New(stats.droppedFrameCount));
161 stats_object->Set(v8::String::New("totalPaintTimeInSeconds"), 165 stats_object->Set(v8::String::New("totalPaintTimeInSeconds"),
162 v8::Number::New(stats.totalPaintTimeInSeconds)); 166 v8::Number::New(stats.totalPaintTimeInSeconds));
163 stats_object->Set(v8::String::New("totalRasterizeTimeInSeconds"), 167 stats_object->Set(v8::String::New("totalRasterizeTimeInSeconds"),
164 v8::Number::New(stats.totalRasterizeTimeInSeconds)); 168 v8::Number::New(stats.totalRasterizeTimeInSeconds));
169 stats_object->Set(v8::String::New("globalTextureUploadCount"),
170 v8::Number::New(gpu_stats.global_texture_upload_count));
171 stats_object->Set(
172 v8::String::New("globalTotalTextureUploadTimeInSeconds"),
173 v8::Number::New(
174 gpu_stats.global_total_texture_upload_time.InSecondsF()));
175 stats_object->Set(v8::String::New("textureUploadCount"),
176 v8::Number::New(gpu_stats.texture_upload_count));
177 stats_object->Set(
178 v8::String::New("totalTextureUploadTimeInSeconds"),
179 v8::Number::New(gpu_stats.total_texture_upload_time.InSecondsF()));
180 stats_object->Set(
181 v8::String::New("globalTotalProcessingCommandsTimeInSeconds"),
182 v8::Number::New(
183 gpu_stats.global_total_processing_commands_time.InSecondsF()));
184 stats_object->Set(
185 v8::String::New("totalProcessingCommandsTimeInSeconds"),
186 v8::Number::New(
187 gpu_stats.total_processing_commands_time.InSecondsF()));
165 return stats_object; 188 return stats_object;
166 } 189 }
167 190
168 static v8::Handle<v8::Value> PrintToSkPicture(const v8::Arguments& args) { 191 static v8::Handle<v8::Value> PrintToSkPicture(const v8::Arguments& args) {
169 if (args.Length() != 1) 192 if (args.Length() != 1)
170 return v8::Undefined(); 193 return v8::Undefined();
171 194
172 v8::String::AsciiValue dirname(args[0]); 195 v8::String::AsciiValue dirname(args[0]);
173 if (dirname.length() == 0) 196 if (dirname.length() == 0)
174 return v8::Undefined(); 197 return v8::Undefined();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 335
313 return results; 336 return results;
314 } 337 }
315 }; 338 };
316 339
317 v8::Extension* GpuBenchmarkingExtension::Get() { 340 v8::Extension* GpuBenchmarkingExtension::Get() {
318 return new GpuBenchmarkingWrapper(); 341 return new GpuBenchmarkingWrapper();
319 } 342 }
320 343
321 } // namespace content 344 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/gpu_rendering_stats.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698