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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: remove runtime flag unsafeES3APIs from blink webgl module Created 4 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/fuzzer_main.cc ('k') | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698