| OLD | NEW |
| 1 // TODO(jam): move this file to src/content once we have an interface that the | 1 // TODO(jam): move this file to src/content once we have an interface that the |
| 2 // embedder provides. We can then use it to get the resource and resize the | 2 // embedder provides. We can then use it to get the resource and resize the |
| 3 // window. | 3 // window. |
| 4 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 4 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 5 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
| 6 // found in the LICENSE file. | 6 // found in the LICENSE file. |
| 7 | 7 |
| 8 #include "chrome/browser/gpu_process_host_ui_shim.h" | 8 #include "chrome/browser/gpu_process_host_ui_shim.h" |
| 9 | 9 |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 374 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 375 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, | 375 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, |
| 376 OnChannelEstablished) | 376 OnChannelEstablished) |
| 377 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, | 377 IPC_MESSAGE_HANDLER(GpuHostMsg_CommandBufferCreated, |
| 378 OnCommandBufferCreated) | 378 OnCommandBufferCreated) |
| 379 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, | 379 IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyCommandBuffer, |
| 380 OnDestroyCommandBuffer) | 380 OnDestroyCommandBuffer) |
| 381 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 381 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
| 382 OnGraphicsInfoCollected) | 382 OnGraphicsInfoCollected) |
| 383 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_PreliminaryGraphicsInfoCollected, | |
| 384 OnPreliminaryGraphicsInfoCollected) | |
| 385 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, | 383 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, |
| 386 OnLogMessage) | 384 OnLogMessage) |
| 387 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, | 385 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, |
| 388 OnSynchronizeReply) | 386 OnSynchronizeReply) |
| 389 #if defined(OS_LINUX) && !defined(TOUCH_UI) | 387 #if defined(OS_LINUX) && !defined(TOUCH_UI) |
| 390 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID) | 388 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID) |
| 391 #elif defined(OS_MACOSX) | 389 #elif defined(OS_MACOSX) |
| 392 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, | 390 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, |
| 393 OnAcceleratedSurfaceSetIOSurface) | 391 OnAcceleratedSurfaceSetIOSurface) |
| 394 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 392 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 gfx::PluginWindowHandle window, int32 renderer_id, | 454 gfx::PluginWindowHandle window, int32 renderer_id, |
| 457 int32 render_view_id) { | 455 int32 render_view_id) { |
| 458 ViewID view_id(renderer_id, render_view_id); | 456 ViewID view_id(renderer_id, render_view_id); |
| 459 acquired_surfaces_.erase(view_id); | 457 acquired_surfaces_.erase(view_id); |
| 460 } | 458 } |
| 461 | 459 |
| 462 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { | 460 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { |
| 463 gpu_data_manager_->UpdateGpuInfo(gpu_info); | 461 gpu_data_manager_->UpdateGpuInfo(gpu_info); |
| 464 } | 462 } |
| 465 | 463 |
| 466 void GpuProcessHostUIShim::OnPreliminaryGraphicsInfoCollected( | |
| 467 const GPUInfo& gpu_info, IPC::Message* reply_msg) { | |
| 468 gpu_data_manager_->UpdateGpuInfo(gpu_info); | |
| 469 GpuFeatureFlags flags = gpu_data_manager_->GetGpuFeatureFlags(); | |
| 470 | |
| 471 GpuHostMsg_PreliminaryGraphicsInfoCollected::WriteReplyParams( | |
| 472 reply_msg, flags.flags() != 0); | |
| 473 Send(reply_msg); | |
| 474 } | |
| 475 | |
| 476 void GpuProcessHostUIShim::OnLogMessage(int level, | 464 void GpuProcessHostUIShim::OnLogMessage(int level, |
| 477 const std::string& header, | 465 const std::string& header, |
| 478 const std::string& message) { | 466 const std::string& message) { |
| 479 DictionaryValue* dict = new DictionaryValue(); | 467 DictionaryValue* dict = new DictionaryValue(); |
| 480 dict->SetInteger("level", level); | 468 dict->SetInteger("level", level); |
| 481 dict->SetString("header", header); | 469 dict->SetString("header", header); |
| 482 dict->SetString("message", message); | 470 dict->SetString("message", message); |
| 483 gpu_data_manager_->AddLogMessage(dict); | 471 gpu_data_manager_->AddLogMessage(dict); |
| 484 } | 472 } |
| 485 | 473 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 RenderViewHost* host = RenderViewHost::FromID(renderer_id, | 530 RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
| 543 render_view_id); | 531 render_view_id); |
| 544 if (!host) { | 532 if (!host) { |
| 545 return; | 533 return; |
| 546 } | 534 } |
| 547 host->ScheduleComposite(); | 535 host->ScheduleComposite(); |
| 548 } | 536 } |
| 549 | 537 |
| 550 #endif | 538 #endif |
| 551 | 539 |
| OLD | NEW |