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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 switches::kVModule, | 145 switches::kVModule, |
146 #if defined(OS_MACOSX) | 146 #if defined(OS_MACOSX) |
147 switches::kDisableRemoteCoreAnimation, | 147 switches::kDisableRemoteCoreAnimation, |
148 switches::kEnableSandboxLogging, | 148 switches::kEnableSandboxLogging, |
149 switches::kShowMacOverlayBorders, | 149 switches::kShowMacOverlayBorders, |
150 #endif | 150 #endif |
151 #if defined(USE_OZONE) | 151 #if defined(USE_OZONE) |
152 switches::kOzonePlatform, | 152 switches::kOzonePlatform, |
153 #endif | 153 #endif |
154 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 154 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
155 switches::kWindowDepth, | |
156 switches::kX11Display, | 155 switches::kX11Display, |
157 switches::kX11VisualID, | |
158 #endif | 156 #endif |
159 switches::kGpuTestingGLVendor, | 157 switches::kGpuTestingGLVendor, |
160 switches::kGpuTestingGLRenderer, | 158 switches::kGpuTestingGLRenderer, |
161 switches::kGpuTestingGLVersion, | 159 switches::kGpuTestingGLVersion, |
162 switches::kDisableGpuDriverBugWorkarounds | 160 switches::kDisableGpuDriverBugWorkarounds |
163 }; | 161 }; |
164 | 162 |
165 enum GPUProcessLifetimeEvent { | 163 enum GPUProcessLifetimeEvent { |
166 LAUNCHED, | 164 LAUNCHED, |
167 DIED_FIRST_TIME, | 165 DIED_FIRST_TIME, |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 } | 791 } |
794 #endif | 792 #endif |
795 | 793 |
796 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { | 794 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { |
797 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); | 795 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); |
798 initialized_ = result; | 796 initialized_ = result; |
799 gpu_info_ = gpu_info; | 797 gpu_info_ = gpu_info; |
800 | 798 |
801 if (!initialized_) | 799 if (!initialized_) |
802 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); | 800 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); |
803 else if (!in_process_) | 801 else |
804 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 802 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
805 } | 803 } |
806 | 804 |
807 void GpuProcessHost::OnChannelEstablished( | 805 void GpuProcessHost::OnChannelEstablished( |
808 const IPC::ChannelHandle& channel_handle) { | 806 const IPC::ChannelHandle& channel_handle) { |
809 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); | 807 TRACE_EVENT0("gpu", "GpuProcessHost::OnChannelEstablished"); |
810 | 808 |
811 if (channel_requests_.empty()) { | 809 if (channel_requests_.empty()) { |
812 // This happens when GPU process is compromised. | 810 // This happens when GPU process is compromised. |
813 RouteOnUIThread(GpuHostMsg_OnLogMessage( | 811 RouteOnUIThread(GpuHostMsg_OnLogMessage( |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1165 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1168 ClientIdToShaderCacheMap::iterator iter = | 1166 ClientIdToShaderCacheMap::iterator iter = |
1169 client_id_to_shader_cache_.find(client_id); | 1167 client_id_to_shader_cache_.find(client_id); |
1170 // If the cache doesn't exist then this is an off the record profile. | 1168 // If the cache doesn't exist then this is an off the record profile. |
1171 if (iter == client_id_to_shader_cache_.end()) | 1169 if (iter == client_id_to_shader_cache_.end()) |
1172 return; | 1170 return; |
1173 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1171 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1174 } | 1172 } |
1175 | 1173 |
1176 } // namespace content | 1174 } // namespace content |
OLD | NEW |