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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
922 content::RenderThread::Get()->Send( | 922 content::RenderThread::Get()->Send( |
923 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); | 923 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); |
924 return true; | 924 return true; |
925 } | 925 } |
926 | 926 |
927 //------------------------------------------------------------------------------ | 927 //------------------------------------------------------------------------------ |
928 | 928 |
929 blink::WebGraphicsContext3D* | 929 blink::WebGraphicsContext3D* |
930 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D( | 930 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D( |
931 const blink::WebGraphicsContext3D::Attributes& attributes) { | 931 const blink::WebGraphicsContext3D::Attributes& attributes) { |
932 return createOffscreenGraphicsContext3D(attributes, NULL); | 932 blink::WebGLInfo glInfo; |
piman
2014/10/10 20:25:00
nit: gl_info
sivag
2014/10/27 13:34:52
Done.
| |
933 return createOffscreenGraphicsContext3D(attributes, NULL, glInfo); | |
933 } | 934 } |
934 | 935 |
935 blink::WebGraphicsContext3D* | 936 blink::WebGraphicsContext3D* |
936 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D( | 937 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D( |
937 const blink::WebGraphicsContext3D::Attributes& attributes, | 938 const blink::WebGraphicsContext3D::Attributes& attributes, |
938 blink::WebGraphicsContext3D* share_context) { | 939 blink::WebGraphicsContext3D* share_context, |
940 blink::WebGLInfo& glInfo) { | |
piman
2014/10/10 20:25:00
nit: gl_info
sivag
2014/10/27 13:34:52
Done.
| |
939 if (!RenderThreadImpl::current()) | 941 if (!RenderThreadImpl::current()) |
940 return NULL; | 942 return NULL; |
941 | 943 |
942 #if defined(OS_ANDROID) | 944 #if defined(OS_ANDROID) |
943 if (SynchronousCompositorFactory* factory = | 945 if (SynchronousCompositorFactory* factory = |
944 SynchronousCompositorFactory::GetInstance()) { | 946 SynchronousCompositorFactory::GetInstance()) { |
945 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> | 947 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> |
946 in_process_context( | 948 in_process_context( |
947 factory->CreateOffscreenGraphicsContext3D(attributes)); | 949 factory->CreateOffscreenGraphicsContext3D(attributes)); |
948 if (!in_process_context || | 950 if (!in_process_context || |
949 !in_process_context->InitializeOnCurrentThread()) | 951 !in_process_context->InitializeOnCurrentThread()) |
950 return NULL; | 952 return NULL; |
951 return in_process_context.release(); | 953 return in_process_context.release(); |
952 } | 954 } |
953 #endif | 955 #endif |
954 | 956 |
955 scoped_refptr<GpuChannelHost> gpu_channel_host( | 957 scoped_refptr<GpuChannelHost> gpu_channel_host( |
956 RenderThreadImpl::current()->EstablishGpuChannelSync( | 958 RenderThreadImpl::current()->EstablishGpuChannelSync( |
957 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); | 959 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); |
958 | 960 |
961 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); | |
962 glInfo.vendorInfo.assign( | |
963 blink::WebString::fromUTF8(gpu_info.gl_vendor)); | |
964 glInfo.rendererInfo.assign( | |
965 blink::WebString::fromUTF8(gpu_info.gl_renderer)); | |
966 glInfo.driverVersion.assign( | |
967 blink::WebString::fromUTF8(gpu_info.gl_version)); | |
968 | |
959 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 969 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
960 bool lose_context_when_out_of_memory = false; | 970 bool lose_context_when_out_of_memory = false; |
961 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 971 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
962 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 972 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
963 gpu_channel_host.get(), | 973 gpu_channel_host.get(), |
964 attributes, | 974 attributes, |
965 lose_context_when_out_of_memory, | 975 lose_context_when_out_of_memory, |
966 GURL(attributes.topDocumentURL), | 976 GURL(attributes.topDocumentURL), |
967 limits, | 977 limits, |
968 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context))); | 978 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context))); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1171 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1181 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1172 const blink::WebBatteryStatus& status) { | 1182 const blink::WebBatteryStatus& status) { |
1173 PlatformEventObserverBase* observer = | 1183 PlatformEventObserverBase* observer = |
1174 platform_event_observers_.Lookup(blink::WebPlatformEventBattery); | 1184 platform_event_observers_.Lookup(blink::WebPlatformEventBattery); |
1175 if (!observer) | 1185 if (!observer) |
1176 return; | 1186 return; |
1177 observer->SendFakeDataForTesting((void*)&status); | 1187 observer->SendFakeDataForTesting((void*)&status); |
1178 } | 1188 } |
1179 | 1189 |
1180 } // namespace content | 1190 } // namespace content |
OLD | NEW |