Chromium Code Reviews| Index: Source/core/html/canvas/WebGLRenderingContext.cpp |
| diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp |
| index 200dabb94acd0ea0fa82263972e808c8aee9ab6c..160a234ac0a2b27ae3a1d4205ba4cb11a31c1f81 100644 |
| --- a/Source/core/html/canvas/WebGLRenderingContext.cpp |
| +++ b/Source/core/html/canvas/WebGLRenderingContext.cpp |
| @@ -87,13 +87,32 @@ PassOwnPtrWillBeRawPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTML |
| OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo)); |
| if (!context || shouldFailContextCreationForTesting) { |
| shouldFailContextCreationForTesting = false; |
| - String statusMessage("Could not create a WebGL context for VendorInfo = "); |
| - statusMessage.append(glInfo.vendorInfo); |
| - statusMessage.append(", RendererInfo = "); |
| - statusMessage.append(glInfo.rendererInfo); |
| - statusMessage.append(", DriverInfo = "); |
| - statusMessage.append(glInfo.driverVersion); |
| - statusMessage.append("."); |
| + String statusMessage; |
| + if (!glInfo.contextInfoCollectionFailure.isEmpty()) { |
| + statusMessage.append("Could not create a WebGL context."); |
|
philipj_slow
2014/12/27 09:13:14
Add a space at the end of this string or assert th
sivag
2014/12/29 13:08:53
Done.
|
| + statusMessage.append(glInfo.contextInfoCollectionFailure); |
| + } else { |
| + statusMessage.append("Could not create a WebGL context"); |
| + if (!glInfo.vendorInfo.isEmpty()) { |
| + statusMessage.append(" VendorInfo = "); |
| + statusMessage.append(glInfo.vendorInfo); |
| + } else { |
| + statusMessage.append(" VendorInfo = Not Available"); |
| + } |
| + if (!glInfo.rendererInfo.isEmpty()) { |
| + statusMessage.append(", RendererInfo = "); |
| + statusMessage.append(glInfo.rendererInfo); |
| + } else { |
| + statusMessage.append(", RendererInfo = Not Available"); |
| + } |
| + if (!glInfo.driverVersion.isEmpty()) { |
| + statusMessage.append(", DriverInfo = "); |
| + statusMessage.append(glInfo.driverVersion); |
| + } else { |
| + statusMessage.append(", DriverInfo = Not Available"); |
| + } |
| + statusMessage.append("."); |
| + } |
| canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, statusMessage)); |
| return nullptr; |
| } |