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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

Issue 640293002: [WebGL-blink] Return meaningful information in WebGL context creation error message (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | public/platform/Platform.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 76d2a4376b24a1d7f9865d73f3a21ba1a85f393c..53bb4ed84d76fdc057745e593a6e45de3aea373d 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -85,9 +85,20 @@ PassOwnPtrWillBeRawPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTML
attrs = defaultAttrs.get();
}
blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(document.topDocument().url().string(), settings, 1);
- OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes, 0));
+ blink::WebGLInfo glInfo;
+ OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes, 0, glInfo));
if (!context) {
- canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL context."));
+ String statusMessage("Could not create a WebGL context for");
+ statusMessage.append("VendorInfo= ");
+ statusMessage.append(glInfo.vendorInfo);
+ statusMessage.append(",");
+ statusMessage.append("RendererInfo= ");
+ statusMessage.append(glInfo.rendererInfo);
+ statusMessage.append(",");
+ statusMessage.append("DriverInfo= ");
+ statusMessage.append(glInfo.driverVersion);
+ statusMessage.append(",");
+ canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, statusMessage));
return nullptr;
}
« no previous file with comments | « no previous file | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | public/platform/Platform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698