Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 645613002: [WebGL-chromium] Return meaningful information in WebGL context creation error message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dnt alter public api, created new api. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 gl_info;
piman 2014/10/27 19:43:47 Why create a WebGLInfo if we're going to discard i
sivag 2014/10/28 15:29:00 Done. Sorry i missed this.
933 return createOffscreenGraphicsContext3D(attributes, NULL, &gl_info);
933 } 934 }
934 935
935 blink::WebGraphicsContext3D* 936 blink::WebGraphicsContext3D*
937 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
938 const blink::WebGraphicsContext3D::Attributes& attributes,
939 blink::WebGraphicsContext3D* share_context,
940 blink::WebGLInfo* gl_info) {
941
942 RenderThreadImpl* render_thread = RenderThreadImpl::current();
943 if (render_thread && gl_info) {
944 GpuChannelHost* gpu_channel_host = render_thread->GetGpuChannel();
piman 2014/10/27 19:43:47 This could be NULL, or a different channel than th
sivag 2014/10/28 15:29:00 Done.
945 if (gpu_channel_host) {
946 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info();
947 gl_info->vendorInfo.assign(
948 blink::WebString::fromUTF8(gpu_info.gl_vendor));
949 gl_info->rendererInfo.assign(
950 blink::WebString::fromUTF8(gpu_info.gl_renderer));
951 gl_info->driverVersion.assign(
952 blink::WebString::fromUTF8(gpu_info.gl_version));
953 }
954 }
955
956 return createOffscreenGraphicsContext3D(attributes, share_context);
957 }
958
959 blink::WebGraphicsContext3D*
936 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D( 960 RendererBlinkPlatformImpl::createOffscreenGraphicsContext3D(
937 const blink::WebGraphicsContext3D::Attributes& attributes, 961 const blink::WebGraphicsContext3D::Attributes& attributes,
938 blink::WebGraphicsContext3D* share_context) { 962 blink::WebGraphicsContext3D* share_context) {
939 if (!RenderThreadImpl::current()) 963 if (!RenderThreadImpl::current())
940 return NULL; 964 return NULL;
941 965
942 #if defined(OS_ANDROID) 966 #if defined(OS_ANDROID)
943 if (SynchronousCompositorFactory* factory = 967 if (SynchronousCompositorFactory* factory =
944 SynchronousCompositorFactory::GetInstance()) { 968 SynchronousCompositorFactory::GetInstance()) {
945 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> 969 scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl>
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1195 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1172 const blink::WebBatteryStatus& status) { 1196 const blink::WebBatteryStatus& status) {
1173 PlatformEventObserverBase* observer = 1197 PlatformEventObserverBase* observer =
1174 platform_event_observers_.Lookup(blink::WebPlatformEventBattery); 1198 platform_event_observers_.Lookup(blink::WebPlatformEventBattery);
1175 if (!observer) 1199 if (!observer)
1176 return; 1200 return;
1177 observer->SendFakeDataForTesting((void*)&status); 1201 observer->SendFakeDataForTesting((void*)&status);
1178 } 1202 }
1179 1203
1180 } // namespace content 1204 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698