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"
|
2012-09-25 16:49:28 +04:00
|
|
|
|
2015-11-25 07:15:29 +03:00
|
|
|
#ifdef FOO
|
|
|
|
#error FOO is already defined! We use FOO() macros to keep things succinct in this file.
|
|
|
|
#endif
|
|
|
|
|
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)
|
2012-09-25 16:49:28 +04:00
|
|
|
{
|
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(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
|
|
|
}
|
|
|
|
|
|
|
|
WebGLExtensionCompressedTexturePVRTC::~WebGLExtensionCompressedTexturePVRTC()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-06-01 17:17:00 +03:00
|
|
|
IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionCompressedTexturePVRTC, WEBGL_compressed_texture_pvrtc)
|
2014-11-14 07:03:50 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|