Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/webgl/WebGL2RenderingContext.h" | 5 #include "modules/webgl/WebGL2RenderingContext.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h" | 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h" |
| 8 #include "bindings/modules/v8/RenderingContext.h" | 8 #include "bindings/modules/v8/RenderingContext.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #include "public/platform/Platform.h" | 31 #include "public/platform/Platform.h" |
| 32 #include "public/platform/WebGraphicsContext3DProvider.h" | 32 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 33 #include <memory> | 33 #include <memory> |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 CanvasRenderingContext* WebGL2RenderingContext::Factory::create( | 37 CanvasRenderingContext* WebGL2RenderingContext::Factory::create( |
| 38 HTMLCanvasElement* canvas, | 38 HTMLCanvasElement* canvas, |
| 39 const CanvasContextCreationAttributes& attrs, | 39 const CanvasContextCreationAttributes& attrs, |
| 40 Document&) { | 40 Document&) { |
| 41 if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { | 41 /* if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { |
| 42 canvas->dispatchEvent(WebGLContextEvent::create( | 42 canvas->dispatchEvent(WebGLContextEvent::create( |
| 43 EventTypeNames::webglcontextcreationerror, false, true, | 43 EventTypeNames::webglcontextcreationerror, false, true, |
| 44 "Creation of WebGL2 contexts disabled.")); | 44 "Creation of WebGL2 contexts disabled.")); |
| 45 return nullptr; | 45 return nullptr; |
| 46 } | 46 } */ |
| 47 | 47 |
| 48 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider( | 48 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider( |
| 49 createWebGraphicsContext3DProvider(canvas, attrs, 2)); | 49 createWebGraphicsContext3DProvider(canvas, attrs, 2)); |
| 50 if (!contextProvider) | 50 if (!contextProvider) |
|
Zhenyao Mo
2016/10/25 16:52:05
I am wondering if only with the blink side change
yunchao
2016/10/26 03:27:09
I tried your suggestion in my local Linux desktop,
| |
| 51 return nullptr; | 51 return nullptr; |
| 52 gpu::gles2::GLES2Interface* gl = contextProvider->contextGL(); | 52 gpu::gles2::GLES2Interface* gl = contextProvider->contextGL(); |
| 53 std::unique_ptr<Extensions3DUtil> extensionsUtil = | 53 std::unique_ptr<Extensions3DUtil> extensionsUtil = |
| 54 Extensions3DUtil::create(gl); | 54 Extensions3DUtil::create(gl); |
| 55 if (!extensionsUtil) | 55 if (!extensionsUtil) |
| 56 return nullptr; | 56 return nullptr; |
| 57 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { | 57 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { |
| 58 String contextLabel( | 58 String contextLabel( |
| 59 String::format("WebGL2RenderingContext-%p", contextProvider.get())); | 59 String::format("WebGL2RenderingContext-%p", contextProvider.get())); |
| 60 gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); | 60 gl->PushGroupMarkerEXT(0, contextLabel.ascii().data()); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 visitor->traceWrappers(m_webglCompressedTexturePVRTC); | 161 visitor->traceWrappers(m_webglCompressedTexturePVRTC); |
| 162 visitor->traceWrappers(m_webglCompressedTextureS3TC); | 162 visitor->traceWrappers(m_webglCompressedTextureS3TC); |
| 163 visitor->traceWrappers(m_webglCompressedTextureS3TCsRGB); | 163 visitor->traceWrappers(m_webglCompressedTextureS3TCsRGB); |
| 164 visitor->traceWrappers(m_webglDebugRendererInfo); | 164 visitor->traceWrappers(m_webglDebugRendererInfo); |
| 165 visitor->traceWrappers(m_webglDebugShaders); | 165 visitor->traceWrappers(m_webglDebugShaders); |
| 166 visitor->traceWrappers(m_webglLoseContext); | 166 visitor->traceWrappers(m_webglLoseContext); |
| 167 WebGL2RenderingContextBase::traceWrappers(visitor); | 167 WebGL2RenderingContextBase::traceWrappers(visitor); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace blink | 170 } // namespace blink |
| OLD | NEW |