This source file includes following definitions.
- name
- create
- supported
- extensionName
#include "config.h"
#include "core/html/canvas/WebGLCompressedTextureS3TC.h"
#include "core/html/canvas/WebGLRenderingContextBase.h"
namespace WebCore {
WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC(WebGLRenderingContextBase* context)
: WebGLExtension(context)
{
ScriptWrappable::init(this);
context->addCompressedTextureFormat(GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
context->addCompressedTextureFormat(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
}
WebGLCompressedTextureS3TC::~WebGLCompressedTextureS3TC()
{
}
WebGLExtensionName WebGLCompressedTextureS3TC::name() const
{
return WebGLCompressedTextureS3TCName;
}
PassRefPtr<WebGLCompressedTextureS3TC> WebGLCompressedTextureS3TC::create(WebGLRenderingContextBase* context)
{
return adoptRef(new WebGLCompressedTextureS3TC(context));
}
bool WebGLCompressedTextureS3TC::supported(WebGLRenderingContextBase* context)
{
Extensions3DUtil* extensionsUtil = context->extensionsUtil();
return extensionsUtil->supportsExtension("GL_EXT_texture_compression_s3tc")
|| (extensionsUtil->supportsExtension("GL_EXT_texture_compression_dxt1")
&& extensionsUtil->supportsExtension("GL_CHROMIUM_texture_compression_dxt3")
&& extensionsUtil->supportsExtension("GL_CHROMIUM_texture_compression_dxt5"));
}
const char* WebGLCompressedTextureS3TC::extensionName()
{
return "WEBGL_compressed_texture_s3tc";
}
}