Chromium Code Reviews| 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..206bfbd95cef149671f6e934c47ae90c3ef3eb7d 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,31 @@ void GpuChannel::OnEstablishStreamTexture( |
| } |
| #endif |
| +void GpuChannel::OnCollectRenderingStats( |
| + int32 surface_id, IPC::Message* reply_message) { |
| + content::GpuRenderingStats stats; |
| + |
| +#if defined(ENABLE_GPU) |
|
apatrick_chromium
2012/08/28 20:07:06
you don't need to check ENABLE_GPU is defined any
|
| + for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
| + !it.IsAtEnd(); it.Advance()) { |
| + int textureUploadCount = |
|
apatrick_chromium
2012/08/28 20:07:06
Google style is texture_upload_count. ditto all th
|
| + it.GetCurrentValue()->decoder()->GetTextureUploadCount(); |
| + double totalTextureUploadTimeInSeconds = |
| + it.GetCurrentValue()->decoder()->GetTotalTextureUploadTimeInSeconds(); |
| + |
| + stats.globalTextureUploadCount += textureUploadCount; |
| + stats.globalTotalTextureUploadTimeInSeconds += |
| + totalTextureUploadTimeInSeconds; |
| + if (it.GetCurrentValue()->surface_id() == surface_id) { |
| + stats.textureUploadCount += textureUploadCount; |
| + stats.totalTextureUploadTimeInSeconds += |
| + totalTextureUploadTimeInSeconds; |
| + } |
| + } |
| +#endif // defined (ENABLE_GPU) |
| + |
| + GpuChannelMsg_CollectRenderingStats::WriteReplyParams( |
| + reply_message, |
| + stats); |
| + Send(reply_message); |
| +} |