Bug 1700051: part 26) Correct typo in comment of `mozInlineSpellWordUtil::BuildSoftTe...
[gecko.git] / dom / canvas / WebGLExtensionDrawBuffers.cpp
blobc97ef63831e33a95b6b6913c0c6a0da107bc280f
1 /* -*- Mode: C++; tab-width: 4; 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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "WebGLExtensions.h"
8 #include <algorithm>
9 #include "GLContext.h"
10 #include "mozilla/dom/WebGLRenderingContextBinding.h"
11 #include "WebGLContext.h"
12 #include "WebGLFramebuffer.h"
13 #include "WebGLRenderbuffer.h"
14 #include "WebGLTexture.h"
16 namespace mozilla {
18 WebGLExtensionDrawBuffers::WebGLExtensionDrawBuffers(WebGLContext* webgl)
19 : WebGLExtensionBase(webgl) {
20 MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported.");
23 bool WebGLExtensionDrawBuffers::IsSupported(const WebGLContext* webgl) {
24 if (webgl->IsWebGL2()) return false;
26 gl::GLContext* gl = webgl->GL();
27 if (gl->IsGLES() && gl->Version() >= 300) {
28 // ANGLE's shader translator can't translate ESSL1 exts to ESSL3. (bug
29 // 1524804)
30 return false;
32 return gl->IsSupported(gl::GLFeature::draw_buffers);
35 } // namespace mozilla