| 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/UnionTypesModules.h" | 7 #include "bindings/modules/v8/UnionTypesModules.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/loader/FrameLoader.h" | 10 #include "core/loader/FrameLoader.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 { | 33 { |
| 34 if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { | 34 if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) { |
| 35 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Creation of WebGL2 contexts disabled.")); | 35 canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcon
textcreationerror, false, true, "Creation of WebGL2 contexts disabled.")); |
| 36 return nullptr; | 36 return nullptr; |
| 37 } | 37 } |
| 38 | 38 |
| 39 WebGLContextAttributes attributes = toWebGLContextAttributes(attrs); | 39 WebGLContextAttributes attributes = toWebGLContextAttributes(attrs); |
| 40 OwnPtr<WebGraphicsContext3D> context(createWebGraphicsContext3D(canvas, attr
ibutes, 2)); | 40 OwnPtr<WebGraphicsContext3D> context(createWebGraphicsContext3D(canvas, attr
ibutes, 2)); |
| 41 if (!context) | 41 if (!context) |
| 42 return nullptr; | 42 return nullptr; |
| 43 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g
et()); | 43 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.g
et(), context->getGLES2Interface()); |
| 44 if (!extensionsUtil) | 44 if (!extensionsUtil) |
| 45 return nullptr; | 45 return nullptr; |
| 46 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { | 46 if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) { |
| 47 String contextLabel(String::format("WebGL2RenderingContext-%p", context.
get())); | 47 String contextLabel(String::format("WebGL2RenderingContext-%p", context.
get())); |
| 48 context->pushGroupMarkerEXT(contextLabel.ascii().data()); | 48 context->pushGroupMarkerEXT(contextLabel.ascii().data()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 OwnPtrWillBeRawPtr<WebGL2RenderingContext> renderingContext = adoptPtrWillBe
Noop(new WebGL2RenderingContext(canvas, context.release(), attributes)); | 51 OwnPtrWillBeRawPtr<WebGL2RenderingContext> renderingContext = adoptPtrWillBe
Noop(new WebGL2RenderingContext(canvas, context.release(), attributes)); |
| 52 | 52 |
| 53 if (!renderingContext->drawingBuffer()) { | 53 if (!renderingContext->drawingBuffer()) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 visitor->trace(m_webglCompressedTextureETC1); | 111 visitor->trace(m_webglCompressedTextureETC1); |
| 112 visitor->trace(m_webglCompressedTexturePVRTC); | 112 visitor->trace(m_webglCompressedTexturePVRTC); |
| 113 visitor->trace(m_webglCompressedTextureS3TC); | 113 visitor->trace(m_webglCompressedTextureS3TC); |
| 114 visitor->trace(m_webglDebugRendererInfo); | 114 visitor->trace(m_webglDebugRendererInfo); |
| 115 visitor->trace(m_webglDebugShaders); | 115 visitor->trace(m_webglDebugShaders); |
| 116 visitor->trace(m_webglLoseContext); | 116 visitor->trace(m_webglLoseContext); |
| 117 WebGL2RenderingContextBase::trace(visitor); | 117 WebGL2RenderingContextBase::trace(visitor); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |