Bumping manifests a=b2g-bump
[gecko.git] / dom / canvas / WebGLExtensionSRGB.cpp
blobb1e3e155951584dac8bd1dd7baebfa564df4108d
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
6 #include "WebGLExtensions.h"
8 #include "GLContext.h"
9 #include "mozilla/dom/WebGLRenderingContextBinding.h"
10 #include "WebGLContext.h"
12 namespace mozilla {
14 WebGLExtensionSRGB::WebGLExtensionSRGB(WebGLContext* webgl)
15 : WebGLExtensionBase(webgl)
17 MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported.");
19 gl::GLContext* gl = webgl->GL();
20 if (!gl->IsGLES()) {
21 // Desktop OpenGL requires the following to be enabled in order to
22 // support sRGB operations on framebuffers.
23 gl->MakeCurrent();
24 gl->fEnable(LOCAL_GL_FRAMEBUFFER_SRGB_EXT);
28 WebGLExtensionSRGB::~WebGLExtensionSRGB()
32 bool
33 WebGLExtensionSRGB::IsSupported(const WebGLContext* webgl)
35 gl::GLContext* gl = webgl->GL();
37 return gl->IsSupported(gl::GLFeature::sRGB);
41 IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionSRGB)
43 } // namespace mozilla