OLD | NEW |
---|---|
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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CreateOffscreenCommandBuffer, | 393 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CreateOffscreenCommandBuffer, |
394 OnCreateOffscreenCommandBuffer) | 394 OnCreateOffscreenCommandBuffer) |
395 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_DestroyCommandBuffer, | 395 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_DestroyCommandBuffer, |
396 OnDestroyCommandBuffer) | 396 OnDestroyCommandBuffer) |
397 #if defined(OS_ANDROID) | 397 #if defined(OS_ANDROID) |
398 IPC_MESSAGE_HANDLER(GpuChannelMsg_RegisterStreamTextureProxy, | 398 IPC_MESSAGE_HANDLER(GpuChannelMsg_RegisterStreamTextureProxy, |
399 OnRegisterStreamTextureProxy) | 399 OnRegisterStreamTextureProxy) |
400 IPC_MESSAGE_HANDLER(GpuChannelMsg_EstablishStreamTexture, | 400 IPC_MESSAGE_HANDLER(GpuChannelMsg_EstablishStreamTexture, |
401 OnEstablishStreamTexture) | 401 OnEstablishStreamTexture) |
402 #endif | 402 #endif |
403 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CollectRenderingStats, | |
404 OnCollectRenderingStats) | |
403 IPC_MESSAGE_UNHANDLED(handled = false) | 405 IPC_MESSAGE_UNHANDLED(handled = false) |
404 IPC_END_MESSAGE_MAP() | 406 IPC_END_MESSAGE_MAP() |
405 DCHECK(handled) << msg.type(); | 407 DCHECK(handled) << msg.type(); |
406 return handled; | 408 return handled; |
407 } | 409 } |
408 | 410 |
409 void GpuChannel::HandleMessage() { | 411 void GpuChannel::HandleMessage() { |
410 handle_messages_scheduled_ = false; | 412 handle_messages_scheduled_ = false; |
411 | 413 |
412 if (!deferred_messages_.empty()) { | 414 if (!deferred_messages_.empty()) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 } | 532 } |
531 | 533 |
532 void GpuChannel::OnEstablishStreamTexture( | 534 void GpuChannel::OnEstablishStreamTexture( |
533 int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type, | 535 int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type, |
534 int32 primary_id, int32 secondary_id) { | 536 int32 primary_id, int32 secondary_id) { |
535 stream_texture_manager_->EstablishStreamTexture( | 537 stream_texture_manager_->EstablishStreamTexture( |
536 stream_id, type, primary_id, secondary_id); | 538 stream_id, type, primary_id, secondary_id); |
537 } | 539 } |
538 #endif | 540 #endif |
539 | 541 |
542 void GpuChannel::OnCollectRenderingStats( | |
543 int32 surface_id, IPC::Message* reply_message) { | |
544 content::GpuRenderingStats stats; | |
545 | |
546 #if defined(ENABLE_GPU) | |
apatrick_chromium
2012/08/28 20:07:06
you don't need to check ENABLE_GPU is defined any
| |
547 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | |
548 !it.IsAtEnd(); it.Advance()) { | |
549 int textureUploadCount = | |
apatrick_chromium
2012/08/28 20:07:06
Google style is texture_upload_count. ditto all th
| |
550 it.GetCurrentValue()->decoder()->GetTextureUploadCount(); | |
551 double totalTextureUploadTimeInSeconds = | |
552 it.GetCurrentValue()->decoder()->GetTotalTextureUploadTimeInSeconds(); | |
553 | |
554 stats.globalTextureUploadCount += textureUploadCount; | |
555 stats.globalTotalTextureUploadTimeInSeconds += | |
556 totalTextureUploadTimeInSeconds; | |
557 if (it.GetCurrentValue()->surface_id() == surface_id) { | |
558 stats.textureUploadCount += textureUploadCount; | |
559 stats.totalTextureUploadTimeInSeconds += | |
560 totalTextureUploadTimeInSeconds; | |
561 } | |
562 } | |
563 #endif // defined (ENABLE_GPU) | |
564 | |
565 GpuChannelMsg_CollectRenderingStats::WriteReplyParams( | |
566 reply_message, | |
567 stats); | |
568 Send(reply_message); | |
569 } | |
OLD | NEW |