Chromium Code Reviews| 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 972 return in_process_context.release(); | 972 return in_process_context.release(); |
| 973 } | 973 } |
| 974 #endif | 974 #endif |
| 975 | 975 |
| 976 scoped_refptr<GpuChannelHost> gpu_channel_host( | 976 scoped_refptr<GpuChannelHost> gpu_channel_host( |
| 977 RenderThreadImpl::current()->EstablishGpuChannelSync( | 977 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 978 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); | 978 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); |
| 979 | 979 |
| 980 if (gpu_channel_host.get() && gl_info) { | 980 if (gpu_channel_host.get() && gl_info) { |
| 981 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); | 981 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); |
| 982 gl_info->vendorInfo.assign(blink::WebString::fromUTF8(gpu_info.gl_vendor)); | 982 if (gpu_info.basic_info_state != gpu::kCollectInfoSuccess) { |
|
no sievers
2014/12/12 18:41:26
I think you want to check |context_info_state| ins
Ken Russell (switch to Gerrit)
2014/12/12 22:43:05
Agreed; |context_info_state| is what should be che
sivag
2014/12/15 13:36:03
My intention here is to check, whether the GPUInfo
no sievers
2014/12/15 21:18:20
|basic_info_state| is for CollectBasicGraphicsInfo
| |
| 983 gl_info->rendererInfo.assign( | 983 switch (gpu_info.basic_info_state) { |
| 984 blink::WebString::fromUTF8(gpu_info.gl_renderer)); | 984 // TODO (sikugu): On Mac gpu's this info is not collected, some tests |
| 985 gl_info->driverVersion.assign( | 985 // fail.Need to check the root cause. Other references:crbug.com/222934 |
|
no sievers
2014/12/12 18:41:26
nit: space before "Need".. also just say TODO(siku
sivag
2014/12/15 13:36:03
Done.
| |
| 986 blink::WebString::fromUTF8(gpu_info.gl_version)); | 986 case gpu::kCollectInfoNonFatalFailure: |
| 987 gl_info->basicInfoCollectionFailure.assign(blink::WebString::fromUTF8( | |
|
no sievers
2014/12/12 18:41:26
Looks like kCollectInfoNonFatalFailure gets set wh
sivag
2014/12/15 13:36:03
GL_VENDOR, GL_RENDERER, GL_VERSION all these strin
Zhenyao Mo
2014/12/15 18:57:12
I agree with sievers. You should set the three st
sivag
2014/12/16 12:51:28
Done.
| |
| 988 "GPUInfoCollectionFailure: Not able to fetch GPU info.")); | |
| 989 break; | |
| 990 case gpu::kCollectInfoFatalFailure: | |
| 991 gl_info->contextInfoCollectionFailure.assign( | |
| 992 blink::WebString::fromUTF8( | |
| 993 "GPUInfoCollectionFailure: GPU initialization Failed. GPU " | |
| 994 "Info " | |
| 995 "not " | |
|
no sievers
2014/12/12 18:41:26
nit: weird formatting, can fit in one line
sivag
2014/12/15 13:36:03
Done.
| |
| 996 "collected.")); | |
| 997 break; | |
| 998 default: | |
| 999 NOTREACHED(); | |
|
no sievers
2014/12/12 18:46:26
So we will be hitting this? Because you commented
Ken Russell (switch to Gerrit)
2014/12/12 22:43:05
I had the same question.
sivag
2014/12/15 13:36:03
It works fine with browser build.
kCollectInfoNone
Zhenyao Mo
2014/12/15 18:57:12
layout tests run with content_shell, where this Gp
sivag
2014/12/16 12:51:28
Done.
| |
| 1000 }; | |
| 1001 } else { | |
| 1002 gl_info->vendorInfo.assign( | |
| 1003 blink::WebString::fromUTF8(gpu_info.gl_vendor)); | |
| 1004 gl_info->rendererInfo.assign( | |
| 1005 blink::WebString::fromUTF8(gpu_info.gl_renderer)); | |
| 1006 gl_info->driverVersion.assign( | |
| 1007 blink::WebString::fromUTF8(gpu_info.gl_version)); | |
| 1008 } | |
| 987 } | 1009 } |
| 988 | 1010 |
| 989 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 1011 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
| 990 bool lose_context_when_out_of_memory = false; | 1012 bool lose_context_when_out_of_memory = false; |
| 991 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 1013 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
| 992 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1014 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 993 gpu_channel_host.get(), | 1015 gpu_channel_host.get(), |
| 994 attributes, | 1016 attributes, |
| 995 lose_context_when_out_of_memory, | 1017 lose_context_when_out_of_memory, |
| 996 GURL(attributes.topDocumentURL), | 1018 GURL(attributes.topDocumentURL), |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1221 //------------------------------------------------------------------------------ | 1243 //------------------------------------------------------------------------------ |
| 1222 | 1244 |
| 1223 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1245 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1224 const blink::WebBatteryStatus& status) { | 1246 const blink::WebBatteryStatus& status) { |
| 1225 if (!g_test_battery_status_listener) | 1247 if (!g_test_battery_status_listener) |
| 1226 return; | 1248 return; |
| 1227 g_test_battery_status_listener->updateBatteryStatus(status); | 1249 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1228 } | 1250 } |
| 1229 | 1251 |
| 1230 } // namespace content | 1252 } // namespace content |
| OLD | NEW |