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/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 return in_process_context.release(); | 976 return in_process_context.release(); |
977 } | 977 } |
978 #endif | 978 #endif |
979 | 979 |
980 scoped_refptr<GpuChannelHost> gpu_channel_host( | 980 scoped_refptr<GpuChannelHost> gpu_channel_host( |
981 RenderThreadImpl::current()->EstablishGpuChannelSync( | 981 RenderThreadImpl::current()->EstablishGpuChannelSync( |
982 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
); | 982 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
); |
983 | 983 |
984 if (gpu_channel_host.get() && gl_info) { | 984 if (gpu_channel_host.get() && gl_info) { |
985 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); | 985 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); |
986 gl_info->vendorInfo.assign(blink::WebString::fromUTF8(gpu_info.gl_vendor)); | 986 switch (gpu_info.context_info_state) { |
987 gl_info->rendererInfo.assign( | 987 case gpu::kCollectInfoSuccess: |
988 blink::WebString::fromUTF8(gpu_info.gl_renderer)); | 988 case gpu::kCollectInfoNonFatalFailure: |
989 gl_info->driverVersion.assign( | 989 gl_info->vendorInfo.assign( |
990 blink::WebString::fromUTF8(gpu_info.gl_version)); | 990 blink::WebString::fromUTF8(gpu_info.gl_vendor)); |
| 991 gl_info->rendererInfo.assign( |
| 992 blink::WebString::fromUTF8(gpu_info.gl_renderer)); |
| 993 gl_info->driverVersion.assign( |
| 994 blink::WebString::fromUTF8(gpu_info.driver_version)); |
| 995 gl_info->vendorId = gpu_info.gpu.vendor_id; |
| 996 gl_info->deviceId = gpu_info.gpu.device_id; |
| 997 break; |
| 998 case gpu::kCollectInfoFatalFailure: |
| 999 case gpu::kCollectInfoNone: |
| 1000 gl_info->contextInfoCollectionFailure.assign(blink::WebString::fromUTF8( |
| 1001 "GPUInfoCollectionFailure: GPU initialization Failed. GPU " |
| 1002 "Info not Collected.")); |
| 1003 break; |
| 1004 default: |
| 1005 NOTREACHED(); |
| 1006 }; |
991 } | 1007 } |
992 | 1008 |
993 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 1009 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
994 bool lose_context_when_out_of_memory = false; | 1010 bool lose_context_when_out_of_memory = false; |
995 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 1011 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
996 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1012 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
997 gpu_channel_host.get(), | 1013 gpu_channel_host.get(), |
998 attributes, | 1014 attributes, |
999 lose_context_when_out_of_memory, | 1015 lose_context_when_out_of_memory, |
1000 GURL(attributes.topDocumentURL), | 1016 GURL(attributes.topDocumentURL), |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 //------------------------------------------------------------------------------ | 1243 //------------------------------------------------------------------------------ |
1228 | 1244 |
1229 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1245 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1230 const blink::WebBatteryStatus& status) { | 1246 const blink::WebBatteryStatus& status) { |
1231 if (!g_test_battery_status_listener) | 1247 if (!g_test_battery_status_listener) |
1232 return; | 1248 return; |
1233 g_test_battery_status_listener->updateBatteryStatus(status); | 1249 g_test_battery_status_listener->updateBatteryStatus(status); |
1234 } | 1250 } |
1235 | 1251 |
1236 } // namespace content | 1252 } // namespace content |
OLD | NEW |