1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #include "WebGLExtensions.h"
6 
7 #include "GLContext.h"
8 #include "mozilla/dom/WebGLRenderingContextBinding.h"
9 #include "WebGLContext.h"
10 #include "WebGLFormats.h"
11 
12 namespace mozilla {
13 
WebGLExtensionCompressedTextureETC1(WebGLContext * webgl)14 WebGLExtensionCompressedTextureETC1::WebGLExtensionCompressedTextureETC1(
15     WebGLContext* webgl)
16     : WebGLExtensionBase(webgl) {
17   RefPtr<WebGLContext> webgl_ = webgl;  // Bug 1201275
18   const auto fnAdd = [&webgl_](GLenum sizedFormat,
19                                webgl::EffectiveFormat effFormat) {
20     auto& fua = webgl_->mFormatUsage;
21 
22     auto usage = fua->EditUsage(effFormat);
23     usage->isFilterable = true;
24     fua->AllowSizedTexFormat(sizedFormat, usage);
25   };
26 
27 #define FOO(x) LOCAL_GL_##x, webgl::EffectiveFormat::x
28 
29   fnAdd(FOO(ETC1_RGB8_OES));
30 
31 #undef FOO
32 }
33 
34 }  // namespace mozilla
35