| 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 #include "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 #if defined(USE_OZONE) | 55 #if defined(USE_OZONE) |
| 56 #include "ui/ozone/public/ozone_switches.h" | 56 #include "ui/ozone/public/ozone_switches.h" |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 59 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 60 #include "ui/gfx/x/x11_switches.h" | 60 #include "ui/gfx/x/x11_switches.h" |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 64 #include "content/browser/browser_io_surface_manager_mac.h" |
| 65 #include "content/common/child_process_messages.h" |
| 66 #endif |
| 67 |
| 63 namespace content { | 68 namespace content { |
| 64 | 69 |
| 65 bool GpuProcessHost::gpu_enabled_ = true; | 70 bool GpuProcessHost::gpu_enabled_ = true; |
| 66 bool GpuProcessHost::hardware_gpu_enabled_ = true; | 71 bool GpuProcessHost::hardware_gpu_enabled_ = true; |
| 67 int GpuProcessHost::gpu_crash_count_ = 0; | 72 int GpuProcessHost::gpu_crash_count_ = 0; |
| 68 int GpuProcessHost::gpu_recent_crash_count_ = 0; | 73 int GpuProcessHost::gpu_recent_crash_count_ = 0; |
| 69 bool GpuProcessHost::crashed_before_ = false; | 74 bool GpuProcessHost::crashed_before_ = false; |
| 70 int GpuProcessHost::swiftshader_crash_count_ = 0; | 75 int GpuProcessHost::swiftshader_crash_count_ = 0; |
| 71 | 76 |
| 72 namespace { | 77 namespace { |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 587 |
| 583 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) | 588 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) |
| 584 IPC_END_MESSAGE_MAP() | 589 IPC_END_MESSAGE_MAP() |
| 585 | 590 |
| 586 return true; | 591 return true; |
| 587 } | 592 } |
| 588 | 593 |
| 589 void GpuProcessHost::OnChannelConnected(int32 peer_pid) { | 594 void GpuProcessHost::OnChannelConnected(int32 peer_pid) { |
| 590 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelConnected"); | 595 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelConnected"); |
| 591 | 596 |
| 597 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 598 Send(new ChildProcessMsg_SetIOSurfaceManagerToken( |
| 599 BrowserIOSurfaceManager::GetInstance()->GetGpuProcessToken())); |
| 600 #endif |
| 601 |
| 592 while (!queued_messages_.empty()) { | 602 while (!queued_messages_.empty()) { |
| 593 Send(queued_messages_.front()); | 603 Send(queued_messages_.front()); |
| 594 queued_messages_.pop(); | 604 queued_messages_.pop(); |
| 595 } | 605 } |
| 596 } | 606 } |
| 597 | 607 |
| 598 void GpuProcessHost::EstablishGpuChannel( | 608 void GpuProcessHost::EstablishGpuChannel( |
| 599 int client_id, | 609 int client_id, |
| 600 bool share_context, | 610 bool share_context, |
| 601 bool allow_future_sync_points, | 611 bool allow_future_sync_points, |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1100 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1091 ClientIdToShaderCacheMap::iterator iter = | 1101 ClientIdToShaderCacheMap::iterator iter = |
| 1092 client_id_to_shader_cache_.find(client_id); | 1102 client_id_to_shader_cache_.find(client_id); |
| 1093 // If the cache doesn't exist then this is an off the record profile. | 1103 // If the cache doesn't exist then this is an off the record profile. |
| 1094 if (iter == client_id_to_shader_cache_.end()) | 1104 if (iter == client_id_to_shader_cache_.end()) |
| 1095 return; | 1105 return; |
| 1096 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1106 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1097 } | 1107 } |
| 1098 | 1108 |
| 1099 } // namespace content | 1109 } // namespace content |
| OLD | NEW |