1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #include "WebGLExtensions.h" 7 8 #include "GLContext.h" 9 #include "mozilla/dom/WebGLRenderingContextBinding.h" 10 #include "WebGLContext.h" 11 12 namespace mozilla { 13 WebGLExtensionFragDepth(WebGLContext * webgl)14WebGLExtensionFragDepth::WebGLExtensionFragDepth(WebGLContext* webgl) 15 : WebGLExtensionBase(webgl) { 16 MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported."); 17 } 18 IsSupported(const WebGLContext * webgl)19bool WebGLExtensionFragDepth::IsSupported(const WebGLContext* webgl) { 20 if (webgl->IsWebGL2()) return false; 21 22 gl::GLContext* gl = webgl->GL(); 23 if (gl->IsGLES() && gl->Version() >= 300) { 24 // ANGLE's shader translator can't translate ESSL1 exts to ESSL3. (bug 25 // 1524804) 26 return false; 27 } 28 return gl->IsSupported(gl::GLFeature::frag_depth); 29 } 30 31 } // namespace mozilla 32