2012-09-25 16:49:28 +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"
|
2014-11-14 07:03:50 +03:00
|
|
|
|
2016-07-22 09:25:41 +03:00
|
|
|
#include "GLContext.h"
|
2012-10-04 01:13:05 +04:00
|
|
|
#include "mozilla/dom/WebGLRenderingContextBinding.h"
|
2014-11-14 07:03:50 +03:00
|
|
|
#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 {
|
2012-09-25 16:49:28 +04:00
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
WebGLExtensionCompressedTexturePVRTC::WebGLExtensionCompressedTexturePVRTC(
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FOO(x) LOCAL_GL_##x, webgl::EffectiveFormat::x
|
|
|
|
|
|
|
|
fnAdd(FOO(COMPRESSED_RGB_PVRTC_4BPPV1));
|
|
|
|
fnAdd(FOO(COMPRESSED_RGB_PVRTC_2BPPV1));
|
|
|
|
fnAdd(FOO(COMPRESSED_RGBA_PVRTC_4BPPV1));
|
|
|
|
fnAdd(FOO(COMPRESSED_RGBA_PVRTC_2BPPV1));
|
|
|
|
|
|
|
|
#undef FOO
|
2012-09-25 16:49:28 +04:00
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
} // namespace mozilla
|