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

Unified Diff: content/common/gpu/gpu_channel.cc

Issue 10868048: Report texture upload time in renderingStats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 52ea50ca00455b0590602744945662130ee4f8f8..e76fb1bbbb741786531f83668bd355fcad725ba7 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -400,6 +400,8 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(GpuChannelMsg_EstablishStreamTexture,
OnEstablishStreamTexture)
#endif
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CollectRenderingStats,
+ OnCollectRenderingStats)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled) << msg.type();
@@ -537,3 +539,26 @@ void GpuChannel::OnEstablishStreamTexture(
}
#endif
+void GpuChannel::OnCollectRenderingStats(IPC::Message* reply_message) {
+ content::GpuRenderingStats stats;
+
+#if defined(ENABLE_GPU)
+ for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_);
+ !it.IsAtEnd(); it.Advance()) {
+
+ // Ignore offscreen command buffers.
+ if (!it.GetCurrentValue()->surface_id())
+ continue;
+
+ stats.textureUploadCount +=
+ it.GetCurrentValue()->decoder()->GetTextureUploadCount();
+ stats.totalTextureUploadTimeInSeconds +=
+ it.GetCurrentValue()->decoder()->GetTotalTextureUploadTimeInSeconds();
+ }
+#endif // defined (ENABLE_GPU)
+
+ GpuChannelMsg_CollectRenderingStats::WriteReplyParams(
+ reply_message,
+ stats);
+ Send(reply_message);
+}

Powered by Google App Engine
This is Rietveld 408576698