2011-09-30 21:45:50 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2011-09-30 21:45:50 -07:00
|
|
|
|
|
|
|
#ifndef WEBGLEXTENSIONS_H_
|
|
|
|
#define WEBGLEXTENSIONS_H_
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
#include "WebGLContext.h"
|
|
|
|
|
2011-09-30 21:45:50 -07:00
|
|
|
namespace mozilla {
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionBase
|
|
|
|
: public nsISupports
|
|
|
|
, public WebGLContextBoundObject
|
|
|
|
, public nsWrapperCache
|
2011-10-26 13:00:44 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionBase(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionBase();
|
|
|
|
|
|
|
|
WebGLContext *GetParentObject() const {
|
|
|
|
return Context();
|
|
|
|
}
|
2011-10-26 13:00:44 -07:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WebGLExtensionBase)
|
2011-10-26 13:00:44 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
#define DECL_WEBGL_EXTENSION_GOOP \
|
|
|
|
JSObject* WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap);
|
|
|
|
|
|
|
|
#define IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionType) \
|
|
|
|
JSObject* \
|
|
|
|
WebGLExtensionType::WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap) { \
|
|
|
|
return dom::WebGLExtensionType##Binding::Wrap(cx, scope, this, triedToWrap); \
|
|
|
|
}
|
|
|
|
|
|
|
|
class WebGLExtensionCompressedTextureATC
|
|
|
|
: public WebGLExtensionBase
|
2011-09-30 21:45:50 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionCompressedTextureATC(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionCompressedTextureATC();
|
2011-09-30 21:45:50 -07:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2011-09-30 21:45:50 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionCompressedTexturePVRTC
|
|
|
|
: public WebGLExtensionBase
|
2012-02-23 05:43:57 -08:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionCompressedTexturePVRTC(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionCompressedTexturePVRTC();
|
2012-02-23 05:43:57 -08:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2012-02-23 05:43:57 -08:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionCompressedTextureS3TC
|
|
|
|
: public WebGLExtensionBase
|
2012-05-08 10:29:31 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionCompressedTextureS3TC(WebGLContext*);
|
2012-05-08 10:29:31 -07:00
|
|
|
virtual ~WebGLExtensionCompressedTextureS3TC();
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2012-05-08 10:29:31 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionDepthTexture
|
|
|
|
: public WebGLExtensionBase
|
2012-09-25 05:49:28 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionDepthTexture(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionDepthTexture();
|
2012-09-25 05:49:28 -07:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2012-09-25 05:49:28 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionLoseContext
|
|
|
|
: public WebGLExtensionBase
|
2012-09-25 05:49:28 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionLoseContext(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionLoseContext();
|
2012-09-25 05:49:28 -07:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
void LoseContext();
|
|
|
|
void RestoreContext();
|
|
|
|
|
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2012-09-25 05:49:28 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
class WebGLExtensionStandardDerivatives
|
|
|
|
: public WebGLExtensionBase
|
2012-08-13 18:17:55 -07:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 14:13:05 -07:00
|
|
|
WebGLExtensionStandardDerivatives(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionStandardDerivatives();
|
|
|
|
|
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
|
|
|
};
|
|
|
|
|
|
|
|
class WebGLExtensionTextureFilterAnisotropic
|
|
|
|
: public WebGLExtensionBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WebGLExtensionTextureFilterAnisotropic(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionTextureFilterAnisotropic();
|
|
|
|
|
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
|
|
|
};
|
|
|
|
|
|
|
|
class WebGLExtensionTextureFloat
|
|
|
|
: public WebGLExtensionBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WebGLExtensionTextureFloat(WebGLContext*);
|
|
|
|
virtual ~WebGLExtensionTextureFloat();
|
2012-08-13 18:17:55 -07:00
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
DECL_WEBGL_EXTENSION_GOOP
|
2012-08-13 18:17:55 -07:00
|
|
|
};
|
|
|
|
|
2012-10-03 14:13:05 -07:00
|
|
|
} // namespace mozilla
|
2011-09-30 21:45:50 -07:00
|
|
|
|
|
|
|
#endif // WEBGLEXTENSIONS_H_
|