2014-03-11 02:42:58 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "WebGLExtensions.h"
|
|
|
|
|
2016-07-22 09:25:41 +03:00
|
|
|
#include "GLContext.h"
|
2014-03-11 02:42:58 +04:00
|
|
|
#include "mozilla/dom/WebGLRenderingContextBinding.h"
|
|
|
|
#include "WebGLContext.h"
|
2018-09-28 02:38:23 +03:00
|
|
|
#include "WebGLFormats.h"
|
2018-10-10 08:15:09 +03:00
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
namespace mozilla {
|
2014-03-11 02:42:58 +04:00
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
WebGLExtensionCompressedTextureETC1::WebGLExtensionCompressedTextureETC1(
|
|
|
|
WebGLContext* webgl)
|
|
|
|
: WebGLExtensionBase(webgl) {
|
2015-11-25 07:15:29 +03:00
|
|
|
RefPtr<WebGLContext> webgl_ = webgl; // Bug 1201275
|
|
|
|
const auto fnAdd = [&webgl_](GLenum sizedFormat,
|
|
|
|
webgl::EffectiveFormat effFormat) {
|
|
|
|
auto& fua = webgl_->mFormatUsage;
|
|
|
|
|
|
|
|
auto usage = fua->EditUsage(effFormat);
|
|
|
|
usage->isFilterable = true;
|
|
|
|
fua->AllowSizedTexFormat(sizedFormat, usage);
|
|
|
|
|
|
|
|
webgl_->mCompressedTextureFormats.AppendElement(sizedFormat);
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FOO(x) LOCAL_GL_##x, webgl::EffectiveFormat::x
|
|
|
|
|
|
|
|
fnAdd(FOO(ETC1_RGB8_OES));
|
|
|
|
|
|
|
|
#undef FOO
|
2014-03-11 02:42:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
WebGLExtensionCompressedTextureETC1::~WebGLExtensionCompressedTextureETC1() {}
|
|
|
|
|
2015-06-01 17:17:00 +03:00
|
|
|
IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTextureETC1,
|
|
|
|
WEBGL_compressed_texture_etc1)
|
2014-11-14 07:03:50 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|