зеркало из https://github.com/mozilla/gecko-dev.git
Bug 911855 - Remove redundant WebGL integer typedefs - r=jgilbert
This commit is contained in:
Родитель
4276103912
Коммит
7e265eab98
|
@ -16,7 +16,7 @@ namespace mozilla {
|
|||
class WebGLActiveInfo MOZ_FINAL
|
||||
{
|
||||
public:
|
||||
WebGLActiveInfo(WebGLint size, WebGLenum type, const nsACString& name) :
|
||||
WebGLActiveInfo(GLint size, GLenum type, const nsACString& name) :
|
||||
mSize(size),
|
||||
mType(type),
|
||||
mName(NS_ConvertASCIItoUTF16(name))
|
||||
|
@ -24,11 +24,11 @@ public:
|
|||
|
||||
// WebIDL attributes
|
||||
|
||||
WebGLint Size() const {
|
||||
GLint Size() const {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
WebGLenum Type() const {
|
||||
GLenum Type() const {
|
||||
return mType;
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ public:
|
|||
NS_INLINE_DECL_REFCOUNTING(WebGLActiveInfo)
|
||||
|
||||
protected:
|
||||
WebGLint mSize;
|
||||
WebGLenum mType;
|
||||
GLint mSize;
|
||||
GLenum mType;
|
||||
nsString mName;
|
||||
};
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
void ElementArrayCacheBufferSubData(size_t pos, const void* ptr, size_t update_size_in_bytes);
|
||||
|
||||
bool Validate(WebGLenum type, uint32_t max_allowed, size_t first, size_t count) {
|
||||
bool Validate(GLenum type, uint32_t max_allowed, size_t first, size_t count) {
|
||||
return mCache->Validate(type, max_allowed, first, count);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
WebGLuint mGLName;
|
||||
GLuint mGLName;
|
||||
bool mHasEverBeenBound;
|
||||
WebGLsizeiptr mByteLength;
|
||||
GLenum mTarget;
|
||||
|
|
|
@ -914,7 +914,7 @@ WebGLContext::GetContextAttributes(Nullable<dom::WebGLContextAttributesInitializ
|
|||
result.mPreserveDrawingBuffer = mOptions.preserveDrawingBuffer;
|
||||
}
|
||||
|
||||
/* [noscript] DOMString mozGetUnderlyingParamString(in WebGLenum pname); */
|
||||
/* [noscript] DOMString mozGetUnderlyingParamString(in GLenum pname); */
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::MozGetUnderlyingParamString(uint32_t pname, nsAString& retval)
|
||||
{
|
||||
|
@ -1156,7 +1156,7 @@ WebGLContext::PresentScreenBuffer()
|
|||
void
|
||||
WebGLContext::DummyFramebufferOperation(const char *info)
|
||||
{
|
||||
WebGLenum status = CheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
GLenum status = CheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (status == LOCAL_GL_FRAMEBUFFER_COMPLETE)
|
||||
return;
|
||||
else
|
||||
|
|
|
@ -183,14 +183,14 @@ public:
|
|||
bool LoseContext();
|
||||
bool RestoreContext();
|
||||
|
||||
void SynthesizeGLError(WebGLenum err);
|
||||
void SynthesizeGLError(WebGLenum err, const char *fmt, ...);
|
||||
void SynthesizeGLError(GLenum err);
|
||||
void SynthesizeGLError(GLenum err, const char *fmt, ...);
|
||||
|
||||
void ErrorInvalidEnum(const char *fmt = 0, ...);
|
||||
void ErrorInvalidOperation(const char *fmt = 0, ...);
|
||||
void ErrorInvalidValue(const char *fmt = 0, ...);
|
||||
void ErrorInvalidFramebufferOperation(const char *fmt = 0, ...);
|
||||
void ErrorInvalidEnumInfo(const char *info, WebGLenum enumvalue) {
|
||||
void ErrorInvalidEnumInfo(const char *info, GLenum enumvalue) {
|
||||
return ErrorInvalidEnum("%s: invalid enum value 0x%x", info, enumvalue);
|
||||
}
|
||||
void ErrorOutOfMemory(const char *fmt = 0, ...);
|
||||
|
@ -200,7 +200,7 @@ public:
|
|||
|
||||
void DummyFramebufferOperation(const char *info);
|
||||
|
||||
WebGLTexture *activeBoundTextureForTarget(WebGLenum target) {
|
||||
WebGLTexture *activeBoundTextureForTarget(GLenum target) {
|
||||
return target == LOCAL_GL_TEXTURE_2D ? mBound2DTextures[mActiveTexture]
|
||||
: mBoundCubeMapTextures[mActiveTexture];
|
||||
}
|
||||
|
@ -296,12 +296,12 @@ public:
|
|||
dom::HTMLCanvasElement* GetCanvas() const {
|
||||
return mCanvasElement;
|
||||
}
|
||||
WebGLsizei DrawingBufferWidth() const {
|
||||
GLsizei DrawingBufferWidth() const {
|
||||
if (!IsContextStable())
|
||||
return 0;
|
||||
return mWidth;
|
||||
}
|
||||
WebGLsizei DrawingBufferHeight() const {
|
||||
GLsizei DrawingBufferHeight() const {
|
||||
if (!IsContextStable())
|
||||
return 0;
|
||||
return mHeight;
|
||||
|
@ -311,63 +311,63 @@ public:
|
|||
bool IsContextLost() const { return !IsContextStable(); }
|
||||
void GetSupportedExtensions(JSContext *cx, dom::Nullable< nsTArray<nsString> > &retval);
|
||||
JSObject* GetExtension(JSContext* cx, const nsAString& aName, ErrorResult& rv);
|
||||
void ActiveTexture(WebGLenum texture);
|
||||
void ActiveTexture(GLenum texture);
|
||||
void AttachShader(WebGLProgram* program, WebGLShader* shader);
|
||||
void BindAttribLocation(WebGLProgram* program, WebGLuint location,
|
||||
void BindAttribLocation(WebGLProgram* program, GLuint location,
|
||||
const nsAString& name);
|
||||
void BindFramebuffer(WebGLenum target, WebGLFramebuffer* wfb);
|
||||
void BindRenderbuffer(WebGLenum target, WebGLRenderbuffer* wrb);
|
||||
void BindTexture(WebGLenum target, WebGLTexture *tex);
|
||||
void BindFramebuffer(GLenum target, WebGLFramebuffer* wfb);
|
||||
void BindRenderbuffer(GLenum target, WebGLRenderbuffer* wrb);
|
||||
void BindTexture(GLenum target, WebGLTexture *tex);
|
||||
void BindVertexArray(WebGLVertexArray *vao);
|
||||
void BlendColor(WebGLclampf r, WebGLclampf g, WebGLclampf b, WebGLclampf a) {
|
||||
void BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a) {
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
MakeContextCurrent();
|
||||
gl->fBlendColor(r, g, b, a);
|
||||
}
|
||||
void BlendEquation(WebGLenum mode);
|
||||
void BlendEquationSeparate(WebGLenum modeRGB, WebGLenum modeAlpha);
|
||||
void BlendFunc(WebGLenum sfactor, WebGLenum dfactor);
|
||||
void BlendFuncSeparate(WebGLenum srcRGB, WebGLenum dstRGB,
|
||||
WebGLenum srcAlpha, WebGLenum dstAlpha);
|
||||
WebGLenum CheckFramebufferStatus(WebGLenum target);
|
||||
void Clear(WebGLbitfield mask);
|
||||
void ClearColor(WebGLclampf r, WebGLclampf g, WebGLclampf b, WebGLclampf a);
|
||||
void ClearDepth(WebGLclampf v);
|
||||
void ClearStencil(WebGLint v);
|
||||
void BlendEquation(GLenum mode);
|
||||
void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
void BlendFunc(GLenum sfactor, GLenum dfactor);
|
||||
void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
|
||||
GLenum srcAlpha, GLenum dstAlpha);
|
||||
GLenum CheckFramebufferStatus(GLenum target);
|
||||
void Clear(GLbitfield mask);
|
||||
void ClearColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a);
|
||||
void ClearDepth(GLclampf v);
|
||||
void ClearStencil(GLint v);
|
||||
void ColorMask(WebGLboolean r, WebGLboolean g, WebGLboolean b, WebGLboolean a);
|
||||
void CompileShader(WebGLShader *shader);
|
||||
void CompressedTexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLsizei width,
|
||||
WebGLsizei height, WebGLint border,
|
||||
void CompressedTexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLint border,
|
||||
const dom::ArrayBufferView& view);
|
||||
void CompressedTexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format,
|
||||
void CompressedTexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format,
|
||||
const dom::ArrayBufferView& view);
|
||||
void CopyTexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLint x, WebGLint y,
|
||||
WebGLsizei width, WebGLsizei height, WebGLint border);
|
||||
void CopyTexSubImage2D(WebGLenum target, WebGLint level, WebGLint xoffset,
|
||||
WebGLint yoffset, WebGLint x, WebGLint y,
|
||||
WebGLsizei width, WebGLsizei height);
|
||||
void CopyTexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height, GLint border);
|
||||
void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height);
|
||||
already_AddRefed<WebGLFramebuffer> CreateFramebuffer();
|
||||
already_AddRefed<WebGLProgram> CreateProgram();
|
||||
already_AddRefed<WebGLRenderbuffer> CreateRenderbuffer();
|
||||
already_AddRefed<WebGLTexture> CreateTexture();
|
||||
already_AddRefed<WebGLShader> CreateShader(WebGLenum type);
|
||||
already_AddRefed<WebGLShader> CreateShader(GLenum type);
|
||||
already_AddRefed<WebGLVertexArray> CreateVertexArray();
|
||||
void CullFace(WebGLenum face);
|
||||
void CullFace(GLenum face);
|
||||
void DeleteFramebuffer(WebGLFramebuffer *fbuf);
|
||||
void DeleteProgram(WebGLProgram *prog);
|
||||
void DeleteRenderbuffer(WebGLRenderbuffer *rbuf);
|
||||
void DeleteShader(WebGLShader *shader);
|
||||
void DeleteVertexArray(WebGLVertexArray *vao);
|
||||
void DeleteTexture(WebGLTexture *tex);
|
||||
void DepthFunc(WebGLenum func);
|
||||
void DepthFunc(GLenum func);
|
||||
void DepthMask(WebGLboolean b);
|
||||
void DepthRange(WebGLclampf zNear, WebGLclampf zFar);
|
||||
void DepthRange(GLclampf zNear, GLclampf zFar);
|
||||
void DetachShader(WebGLProgram *program, WebGLShader *shader);
|
||||
void DrawBuffers(const dom::Sequence<GLenum>& buffers);
|
||||
void Flush() {
|
||||
|
@ -382,119 +382,119 @@ public:
|
|||
MakeContextCurrent();
|
||||
gl->fFinish();
|
||||
}
|
||||
void FramebufferRenderbuffer(WebGLenum target, WebGLenum attachment,
|
||||
WebGLenum rbtarget, WebGLRenderbuffer *wrb);
|
||||
void FramebufferTexture2D(WebGLenum target, WebGLenum attachment,
|
||||
WebGLenum textarget, WebGLTexture *tobj,
|
||||
WebGLint level);
|
||||
void FrontFace(WebGLenum mode);
|
||||
void GenerateMipmap(WebGLenum target);
|
||||
void FramebufferRenderbuffer(GLenum target, GLenum attachment,
|
||||
GLenum rbtarget, WebGLRenderbuffer *wrb);
|
||||
void FramebufferTexture2D(GLenum target, GLenum attachment,
|
||||
GLenum textarget, WebGLTexture *tobj,
|
||||
GLint level);
|
||||
void FrontFace(GLenum mode);
|
||||
void GenerateMipmap(GLenum target);
|
||||
already_AddRefed<WebGLActiveInfo> GetActiveAttrib(WebGLProgram *prog,
|
||||
WebGLuint index);
|
||||
GLuint index);
|
||||
already_AddRefed<WebGLActiveInfo> GetActiveUniform(WebGLProgram *prog,
|
||||
WebGLuint index);
|
||||
GLuint index);
|
||||
void GetAttachedShaders(WebGLProgram* prog,
|
||||
dom::Nullable< nsTArray<WebGLShader*> > &retval);
|
||||
WebGLint GetAttribLocation(WebGLProgram* prog, const nsAString& name);
|
||||
JS::Value GetBufferParameter(WebGLenum target, WebGLenum pname);
|
||||
JS::Value GetBufferParameter(JSContext* /* unused */, WebGLenum target,
|
||||
WebGLenum pname) {
|
||||
GLint GetAttribLocation(WebGLProgram* prog, const nsAString& name);
|
||||
JS::Value GetBufferParameter(GLenum target, GLenum pname);
|
||||
JS::Value GetBufferParameter(JSContext* /* unused */, GLenum target,
|
||||
GLenum pname) {
|
||||
return GetBufferParameter(target, pname);
|
||||
}
|
||||
WebGLenum GetError();
|
||||
GLenum GetError();
|
||||
JS::Value GetFramebufferAttachmentParameter(JSContext* cx,
|
||||
WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum pname,
|
||||
GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum pname,
|
||||
ErrorResult& rv);
|
||||
JS::Value GetProgramParameter(WebGLProgram *prog, WebGLenum pname);
|
||||
JS::Value GetProgramParameter(WebGLProgram *prog, GLenum pname);
|
||||
JS::Value GetProgramParameter(JSContext* /* unused */, WebGLProgram *prog,
|
||||
WebGLenum pname) {
|
||||
GLenum pname) {
|
||||
return GetProgramParameter(prog, pname);
|
||||
}
|
||||
void GetProgramInfoLog(WebGLProgram *prog, nsACString& retval);
|
||||
void GetProgramInfoLog(WebGLProgram *prog, nsAString& retval);
|
||||
JS::Value GetRenderbufferParameter(WebGLenum target, WebGLenum pname);
|
||||
JS::Value GetRenderbufferParameter(GLenum target, GLenum pname);
|
||||
JS::Value GetRenderbufferParameter(JSContext* /* unused */,
|
||||
WebGLenum target, WebGLenum pname) {
|
||||
GLenum target, GLenum pname) {
|
||||
return GetRenderbufferParameter(target, pname);
|
||||
}
|
||||
JS::Value GetShaderParameter(WebGLShader *shader, WebGLenum pname);
|
||||
JS::Value GetShaderParameter(WebGLShader *shader, GLenum pname);
|
||||
JS::Value GetShaderParameter(JSContext* /* unused */, WebGLShader *shader,
|
||||
WebGLenum pname) {
|
||||
GLenum pname) {
|
||||
return GetShaderParameter(shader, pname);
|
||||
}
|
||||
already_AddRefed<WebGLShaderPrecisionFormat>
|
||||
GetShaderPrecisionFormat(WebGLenum shadertype, WebGLenum precisiontype);
|
||||
GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
|
||||
void GetShaderInfoLog(WebGLShader *shader, nsACString& retval);
|
||||
void GetShaderInfoLog(WebGLShader *shader, nsAString& retval);
|
||||
void GetShaderSource(WebGLShader *shader, nsAString& retval);
|
||||
JS::Value GetTexParameter(WebGLenum target, WebGLenum pname);
|
||||
JS::Value GetTexParameter(JSContext * /* unused */, WebGLenum target,
|
||||
WebGLenum pname) {
|
||||
JS::Value GetTexParameter(GLenum target, GLenum pname);
|
||||
JS::Value GetTexParameter(JSContext * /* unused */, GLenum target,
|
||||
GLenum pname) {
|
||||
return GetTexParameter(target, pname);
|
||||
}
|
||||
JS::Value GetUniform(JSContext* cx, WebGLProgram *prog,
|
||||
WebGLUniformLocation *location, ErrorResult& rv);
|
||||
already_AddRefed<WebGLUniformLocation>
|
||||
GetUniformLocation(WebGLProgram *prog, const nsAString& name);
|
||||
void Hint(WebGLenum target, WebGLenum mode);
|
||||
void Hint(GLenum target, GLenum mode);
|
||||
bool IsFramebuffer(WebGLFramebuffer *fb);
|
||||
bool IsProgram(WebGLProgram *prog);
|
||||
bool IsRenderbuffer(WebGLRenderbuffer *rb);
|
||||
bool IsShader(WebGLShader *shader);
|
||||
bool IsTexture(WebGLTexture *tex);
|
||||
bool IsVertexArray(WebGLVertexArray *vao);
|
||||
void LineWidth(WebGLfloat width) {
|
||||
void LineWidth(GLfloat width) {
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
MakeContextCurrent();
|
||||
gl->fLineWidth(width);
|
||||
}
|
||||
void LinkProgram(WebGLProgram *program);
|
||||
void PixelStorei(WebGLenum pname, WebGLint param);
|
||||
void PolygonOffset(WebGLfloat factor, WebGLfloat units) {
|
||||
void PixelStorei(GLenum pname, GLint param);
|
||||
void PolygonOffset(GLfloat factor, GLfloat units) {
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
MakeContextCurrent();
|
||||
gl->fPolygonOffset(factor, units);
|
||||
}
|
||||
void ReadPixels(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type,
|
||||
void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type,
|
||||
const Nullable<dom::ArrayBufferView> &pixels,
|
||||
ErrorResult& rv);
|
||||
void RenderbufferStorage(WebGLenum target, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height);
|
||||
void SampleCoverage(WebGLclampf value, WebGLboolean invert) {
|
||||
void RenderbufferStorage(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
void SampleCoverage(GLclampf value, WebGLboolean invert) {
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
MakeContextCurrent();
|
||||
gl->fSampleCoverage(value, invert);
|
||||
}
|
||||
void Scissor(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height);
|
||||
void Scissor(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void ShaderSource(WebGLShader *shader, const nsAString& source);
|
||||
void StencilFunc(WebGLenum func, WebGLint ref, WebGLuint mask);
|
||||
void StencilFuncSeparate(WebGLenum face, WebGLenum func, WebGLint ref,
|
||||
WebGLuint mask);
|
||||
void StencilMask(WebGLuint mask);
|
||||
void StencilMaskSeparate(WebGLenum face, WebGLuint mask);
|
||||
void StencilOp(WebGLenum sfail, WebGLenum dpfail, WebGLenum dppass);
|
||||
void StencilOpSeparate(WebGLenum face, WebGLenum sfail, WebGLenum dpfail,
|
||||
WebGLenum dppass);
|
||||
void TexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLsizei width,
|
||||
WebGLsizei height, WebGLint border, WebGLenum format,
|
||||
WebGLenum type,
|
||||
void StencilFunc(GLenum func, GLint ref, GLuint mask);
|
||||
void StencilFuncSeparate(GLenum face, GLenum func, GLint ref,
|
||||
GLuint mask);
|
||||
void StencilMask(GLuint mask);
|
||||
void StencilMaskSeparate(GLenum face, GLuint mask);
|
||||
void StencilOp(GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||
void StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail,
|
||||
GLenum dppass);
|
||||
void TexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLint border, GLenum format,
|
||||
GLenum type,
|
||||
const Nullable<dom::ArrayBufferView> &pixels,
|
||||
ErrorResult& rv);
|
||||
void TexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLenum format, WebGLenum type,
|
||||
void TexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLenum format, GLenum type,
|
||||
dom::ImageData* pixels, ErrorResult& rv);
|
||||
// Allow whatever element types the bindings are willing to pass
|
||||
// us in TexImage2D
|
||||
template<class ElementType>
|
||||
void TexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLenum format, WebGLenum type,
|
||||
void TexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLenum format, GLenum type,
|
||||
ElementType& elt, ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -513,28 +513,28 @@ public:
|
|||
0, format, type, isurf->Data(), byteLength,
|
||||
-1, srcFormat, mPixelStorePremultiplyAlpha);
|
||||
}
|
||||
void TexParameterf(WebGLenum target, WebGLenum pname, WebGLfloat param) {
|
||||
void TexParameterf(GLenum target, GLenum pname, GLfloat param) {
|
||||
TexParameter_base(target, pname, nullptr, ¶m);
|
||||
}
|
||||
void TexParameteri(WebGLenum target, WebGLenum pname, WebGLint param) {
|
||||
void TexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
TexParameter_base(target, pname, ¶m, nullptr);
|
||||
}
|
||||
|
||||
void TexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height, WebGLenum format,
|
||||
WebGLenum type,
|
||||
void TexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type,
|
||||
const Nullable<dom::ArrayBufferView> &pixels,
|
||||
ErrorResult& rv);
|
||||
void TexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset, WebGLenum format,
|
||||
WebGLenum type, dom::ImageData* pixels, ErrorResult& rv);
|
||||
void TexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset, GLenum format,
|
||||
GLenum type, dom::ImageData* pixels, ErrorResult& rv);
|
||||
// Allow whatever element types the bindings are willing to pass
|
||||
// us in TexSubImage2D
|
||||
template<class ElementType>
|
||||
void TexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset, WebGLenum format,
|
||||
WebGLenum type, ElementType& elt, ErrorResult& rv)
|
||||
void TexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset, GLenum format,
|
||||
GLenum type, ElementType& elt, ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -555,107 +555,107 @@ public:
|
|||
|
||||
}
|
||||
|
||||
void Uniform1i(WebGLUniformLocation* location, WebGLint x);
|
||||
void Uniform2i(WebGLUniformLocation* location, WebGLint x, WebGLint y);
|
||||
void Uniform3i(WebGLUniformLocation* location, WebGLint x, WebGLint y,
|
||||
WebGLint z);
|
||||
void Uniform4i(WebGLUniformLocation* location, WebGLint x, WebGLint y,
|
||||
WebGLint z, WebGLint w);
|
||||
void Uniform1i(WebGLUniformLocation* location, GLint x);
|
||||
void Uniform2i(WebGLUniformLocation* location, GLint x, GLint y);
|
||||
void Uniform3i(WebGLUniformLocation* location, GLint x, GLint y,
|
||||
GLint z);
|
||||
void Uniform4i(WebGLUniformLocation* location, GLint x, GLint y,
|
||||
GLint z, GLint w);
|
||||
|
||||
void Uniform1f(WebGLUniformLocation* location, WebGLfloat x);
|
||||
void Uniform2f(WebGLUniformLocation* location, WebGLfloat x, WebGLfloat y);
|
||||
void Uniform3f(WebGLUniformLocation* location, WebGLfloat x, WebGLfloat y,
|
||||
WebGLfloat z);
|
||||
void Uniform4f(WebGLUniformLocation* location, WebGLfloat x, WebGLfloat y,
|
||||
WebGLfloat z, WebGLfloat w);
|
||||
void Uniform1f(WebGLUniformLocation* location, GLfloat x);
|
||||
void Uniform2f(WebGLUniformLocation* location, GLfloat x, GLfloat y);
|
||||
void Uniform3f(WebGLUniformLocation* location, GLfloat x, GLfloat y,
|
||||
GLfloat z);
|
||||
void Uniform4f(WebGLUniformLocation* location, GLfloat x, GLfloat y,
|
||||
GLfloat z, GLfloat w);
|
||||
|
||||
void Uniform1iv(WebGLUniformLocation* location,
|
||||
const dom::Int32Array& arr) {
|
||||
Uniform1iv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform1iv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLint>& arr) {
|
||||
const dom::Sequence<GLint>& arr) {
|
||||
Uniform1iv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform1iv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLint* data);
|
||||
const GLint* data);
|
||||
|
||||
void Uniform2iv(WebGLUniformLocation* location,
|
||||
const dom::Int32Array& arr) {
|
||||
Uniform2iv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform2iv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLint>& arr) {
|
||||
const dom::Sequence<GLint>& arr) {
|
||||
Uniform2iv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform2iv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLint* data);
|
||||
const GLint* data);
|
||||
|
||||
void Uniform3iv(WebGLUniformLocation* location,
|
||||
const dom::Int32Array& arr) {
|
||||
Uniform3iv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform3iv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLint>& arr) {
|
||||
const dom::Sequence<GLint>& arr) {
|
||||
Uniform3iv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform3iv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLint* data);
|
||||
const GLint* data);
|
||||
|
||||
void Uniform4iv(WebGLUniformLocation* location,
|
||||
const dom::Int32Array& arr) {
|
||||
Uniform4iv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform4iv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLint>& arr) {
|
||||
const dom::Sequence<GLint>& arr) {
|
||||
Uniform4iv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform4iv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLint* data);
|
||||
const GLint* data);
|
||||
|
||||
void Uniform1fv(WebGLUniformLocation* location,
|
||||
const dom::Float32Array& arr) {
|
||||
Uniform1fv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform1fv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLfloat>& arr) {
|
||||
const dom::Sequence<GLfloat>& arr) {
|
||||
Uniform1fv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform1fv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLfloat* data);
|
||||
const GLfloat* data);
|
||||
|
||||
void Uniform2fv(WebGLUniformLocation* location,
|
||||
const dom::Float32Array& arr) {
|
||||
Uniform2fv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform2fv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLfloat>& arr) {
|
||||
const dom::Sequence<GLfloat>& arr) {
|
||||
Uniform2fv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform2fv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLfloat* data);
|
||||
const GLfloat* data);
|
||||
|
||||
void Uniform3fv(WebGLUniformLocation* location,
|
||||
const dom::Float32Array& arr) {
|
||||
Uniform3fv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform3fv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLfloat>& arr) {
|
||||
const dom::Sequence<GLfloat>& arr) {
|
||||
Uniform3fv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform3fv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLfloat* data);
|
||||
const GLfloat* data);
|
||||
|
||||
void Uniform4fv(WebGLUniformLocation* location,
|
||||
const dom::Float32Array& arr) {
|
||||
Uniform4fv_base(location, arr.Length(), arr.Data());
|
||||
}
|
||||
void Uniform4fv(WebGLUniformLocation* location,
|
||||
const dom::Sequence<WebGLfloat>& arr) {
|
||||
const dom::Sequence<GLfloat>& arr) {
|
||||
Uniform4fv_base(location, arr.Length(), arr.Elements());
|
||||
}
|
||||
void Uniform4fv_base(WebGLUniformLocation* location, uint32_t arrayLength,
|
||||
const WebGLfloat* data);
|
||||
const GLfloat* data);
|
||||
|
||||
void UniformMatrix2fv(WebGLUniformLocation* location,
|
||||
WebGLboolean transpose,
|
||||
|
@ -714,20 +714,20 @@ public:
|
|||
bool ValidateUniformLocation(const char* info, WebGLUniformLocation *location_object);
|
||||
bool ValidateSamplerUniformSetter(const char* info,
|
||||
WebGLUniformLocation *location,
|
||||
WebGLint value);
|
||||
GLint value);
|
||||
|
||||
void Viewport(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height);
|
||||
void Viewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Asynchronous Queries (WebGLContextAsyncQueries.cpp)
|
||||
public:
|
||||
already_AddRefed<WebGLQuery> CreateQuery();
|
||||
void DeleteQuery(WebGLQuery *query);
|
||||
void BeginQuery(WebGLenum target, WebGLQuery *query);
|
||||
void EndQuery(WebGLenum target);
|
||||
void BeginQuery(GLenum target, WebGLQuery *query);
|
||||
void EndQuery(GLenum target);
|
||||
bool IsQuery(WebGLQuery *query);
|
||||
already_AddRefed<WebGLQuery> GetQuery(WebGLenum target, WebGLenum pname);
|
||||
JS::Value GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname);
|
||||
already_AddRefed<WebGLQuery> GetQuery(GLenum target, GLenum pname);
|
||||
JS::Value GetQueryObject(JSContext* cx, WebGLQuery *query, GLenum pname);
|
||||
|
||||
private:
|
||||
// ANY_SAMPLES_PASSED(_CONSERVATIVE) slot
|
||||
|
@ -736,24 +736,24 @@ private:
|
|||
// LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN slot
|
||||
WebGLRefPtr<WebGLQuery> mActiveTransformFeedbackQuery;
|
||||
|
||||
WebGLRefPtr<WebGLQuery>* GetQueryTargetSlot(WebGLenum target, const char* infos);
|
||||
WebGLRefPtr<WebGLQuery>* GetQueryTargetSlot(GLenum target, const char* infos);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Buffer Objects (WebGLContextBuffers.cpp)
|
||||
public:
|
||||
void BindBuffer(WebGLenum target, WebGLBuffer* buf);
|
||||
void BindBufferBase(WebGLenum target, WebGLuint index, WebGLBuffer* buffer);
|
||||
void BindBufferRange(WebGLenum target, WebGLuint index, WebGLBuffer* buffer,
|
||||
void BindBuffer(GLenum target, WebGLBuffer* buf);
|
||||
void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer);
|
||||
void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer,
|
||||
WebGLintptr offset, WebGLsizeiptr size);
|
||||
void BufferData(WebGLenum target, WebGLsizeiptr size, WebGLenum usage);
|
||||
void BufferData(WebGLenum target, const dom::ArrayBufferView &data,
|
||||
WebGLenum usage);
|
||||
void BufferData(WebGLenum target,
|
||||
void BufferData(GLenum target, WebGLsizeiptr size, GLenum usage);
|
||||
void BufferData(GLenum target, const dom::ArrayBufferView &data,
|
||||
GLenum usage);
|
||||
void BufferData(GLenum target,
|
||||
const Nullable<dom::ArrayBuffer> &maybeData,
|
||||
WebGLenum usage);
|
||||
void BufferSubData(WebGLenum target, WebGLsizeiptr byteOffset,
|
||||
GLenum usage);
|
||||
void BufferSubData(GLenum target, WebGLsizeiptr byteOffset,
|
||||
const dom::ArrayBufferView &data);
|
||||
void BufferSubData(WebGLenum target, WebGLsizeiptr byteOffset,
|
||||
void BufferSubData(GLenum target, WebGLsizeiptr byteOffset,
|
||||
const Nullable<dom::ArrayBuffer> &maybeData);
|
||||
already_AddRefed<WebGLBuffer> CreateBuffer();
|
||||
void DeleteBuffer(WebGLBuffer *buf);
|
||||
|
@ -769,16 +769,16 @@ private:
|
|||
// these two functions emit INVALID_ENUM for invalid `target`.
|
||||
WebGLRefPtr<WebGLBuffer>* GetBufferSlotByTarget(GLenum target, const char* infos);
|
||||
WebGLRefPtr<WebGLBuffer>* GetBufferSlotByTargetIndexed(GLenum target, GLuint index, const char* infos);
|
||||
bool ValidateBufferUsageEnum(WebGLenum target, const char* infos);
|
||||
bool ValidateBufferUsageEnum(GLenum target, const char* infos);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// State and State Requests (WebGLContextState.cpp)
|
||||
public:
|
||||
void Disable(WebGLenum cap);
|
||||
void Enable(WebGLenum cap);
|
||||
JS::Value GetParameter(JSContext* cx, WebGLenum pname, ErrorResult& rv);
|
||||
JS::Value GetParameterIndexed(JSContext* cx, WebGLenum pname, WebGLuint index);
|
||||
bool IsEnabled(WebGLenum cap);
|
||||
void Disable(GLenum cap);
|
||||
void Enable(GLenum cap);
|
||||
JS::Value GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv);
|
||||
JS::Value GetParameterIndexed(JSContext* cx, GLenum pname, GLuint index);
|
||||
bool IsEnabled(GLenum cap);
|
||||
|
||||
private:
|
||||
// State tracking slots
|
||||
|
@ -786,64 +786,64 @@ private:
|
|||
realGLboolean mRasterizerDiscardEnabled;
|
||||
realGLboolean mScissorTestEnabled;
|
||||
|
||||
bool ValidateCapabilityEnum(WebGLenum cap, const char* info);
|
||||
realGLboolean* GetStateTrackingSlot(WebGLenum cap);
|
||||
bool ValidateCapabilityEnum(GLenum cap, const char* info);
|
||||
realGLboolean* GetStateTrackingSlot(GLenum cap);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Vertices Feature (WebGLContextVertices.cpp)
|
||||
public:
|
||||
void DrawArrays(GLenum mode, WebGLint first, WebGLsizei count);
|
||||
void DrawArraysInstanced(GLenum mode, WebGLint first, WebGLsizei count, WebGLsizei primcount);
|
||||
void DrawElements(WebGLenum mode, WebGLsizei count, WebGLenum type, WebGLintptr byteOffset);
|
||||
void DrawElementsInstanced(WebGLenum mode, WebGLsizei count, WebGLenum type,
|
||||
WebGLintptr byteOffset, WebGLsizei primcount);
|
||||
void DrawArrays(GLenum mode, GLint first, GLsizei count);
|
||||
void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
void DrawElements(GLenum mode, GLsizei count, GLenum type, WebGLintptr byteOffset);
|
||||
void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
||||
WebGLintptr byteOffset, GLsizei primcount);
|
||||
|
||||
void EnableVertexAttribArray(WebGLuint index);
|
||||
void DisableVertexAttribArray(WebGLuint index);
|
||||
void EnableVertexAttribArray(GLuint index);
|
||||
void DisableVertexAttribArray(GLuint index);
|
||||
|
||||
JS::Value GetVertexAttrib(JSContext* cx, WebGLuint index, WebGLenum pname,
|
||||
JS::Value GetVertexAttrib(JSContext* cx, GLuint index, GLenum pname,
|
||||
ErrorResult& rv);
|
||||
WebGLsizeiptr GetVertexAttribOffset(WebGLuint index, WebGLenum pname);
|
||||
WebGLsizeiptr GetVertexAttribOffset(GLuint index, GLenum pname);
|
||||
|
||||
void VertexAttrib1f(WebGLuint index, WebGLfloat x0);
|
||||
void VertexAttrib2f(WebGLuint index, WebGLfloat x0, WebGLfloat x1);
|
||||
void VertexAttrib3f(WebGLuint index, WebGLfloat x0, WebGLfloat x1,
|
||||
WebGLfloat x2);
|
||||
void VertexAttrib4f(WebGLuint index, WebGLfloat x0, WebGLfloat x1,
|
||||
WebGLfloat x2, WebGLfloat x3);
|
||||
void VertexAttrib1f(GLuint index, GLfloat x0);
|
||||
void VertexAttrib2f(GLuint index, GLfloat x0, GLfloat x1);
|
||||
void VertexAttrib3f(GLuint index, GLfloat x0, GLfloat x1,
|
||||
GLfloat x2);
|
||||
void VertexAttrib4f(GLuint index, GLfloat x0, GLfloat x1,
|
||||
GLfloat x2, GLfloat x3);
|
||||
|
||||
void VertexAttrib1fv(WebGLuint idx, const dom::Float32Array &arr) {
|
||||
void VertexAttrib1fv(GLuint idx, const dom::Float32Array &arr) {
|
||||
VertexAttrib1fv_base(idx, arr.Length(), arr.Data());
|
||||
}
|
||||
void VertexAttrib1fv(WebGLuint idx, const dom::Sequence<WebGLfloat>& arr) {
|
||||
void VertexAttrib1fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
|
||||
VertexAttrib1fv_base(idx, arr.Length(), arr.Elements());
|
||||
}
|
||||
|
||||
void VertexAttrib2fv(WebGLuint idx, const dom::Float32Array &arr) {
|
||||
void VertexAttrib2fv(GLuint idx, const dom::Float32Array &arr) {
|
||||
VertexAttrib2fv_base(idx, arr.Length(), arr.Data());
|
||||
}
|
||||
void VertexAttrib2fv(WebGLuint idx, const dom::Sequence<WebGLfloat>& arr) {
|
||||
void VertexAttrib2fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
|
||||
VertexAttrib2fv_base(idx, arr.Length(), arr.Elements());
|
||||
}
|
||||
|
||||
void VertexAttrib3fv(WebGLuint idx, const dom::Float32Array &arr) {
|
||||
void VertexAttrib3fv(GLuint idx, const dom::Float32Array &arr) {
|
||||
VertexAttrib3fv_base(idx, arr.Length(), arr.Data());
|
||||
}
|
||||
void VertexAttrib3fv(WebGLuint idx, const dom::Sequence<WebGLfloat>& arr) {
|
||||
void VertexAttrib3fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
|
||||
VertexAttrib3fv_base(idx, arr.Length(), arr.Elements());
|
||||
}
|
||||
|
||||
void VertexAttrib4fv(WebGLuint idx, const dom::Float32Array &arr) {
|
||||
void VertexAttrib4fv(GLuint idx, const dom::Float32Array &arr) {
|
||||
VertexAttrib4fv_base(idx, arr.Length(), arr.Data());
|
||||
}
|
||||
void VertexAttrib4fv(WebGLuint idx, const dom::Sequence<WebGLfloat>& arr) {
|
||||
void VertexAttrib4fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
|
||||
VertexAttrib4fv_base(idx, arr.Length(), arr.Elements());
|
||||
}
|
||||
|
||||
void VertexAttribPointer(WebGLuint index, WebGLint size, WebGLenum type,
|
||||
WebGLboolean normalized, WebGLsizei stride,
|
||||
void VertexAttribPointer(GLuint index, GLint size, GLenum type,
|
||||
WebGLboolean normalized, GLsizei stride,
|
||||
WebGLintptr byteOffset);
|
||||
void VertexAttribDivisor(WebGLuint index, WebGLuint divisor);
|
||||
void VertexAttribDivisor(GLuint index, GLuint divisor);
|
||||
|
||||
private:
|
||||
// Cache the max number of vertices and instances that can be read from
|
||||
|
@ -861,15 +861,15 @@ private:
|
|||
mMaxFetchedInstances = 0;
|
||||
}
|
||||
|
||||
bool DrawArrays_check(WebGLint first, WebGLsizei count, WebGLsizei primcount, const char* info);
|
||||
bool DrawElements_check(WebGLsizei count, WebGLenum type, WebGLintptr byteOffset,
|
||||
WebGLsizei primcount, const char* info);
|
||||
bool DrawArrays_check(GLint first, GLsizei count, GLsizei primcount, const char* info);
|
||||
bool DrawElements_check(GLsizei count, GLenum type, WebGLintptr byteOffset,
|
||||
GLsizei primcount, const char* info);
|
||||
void Draw_cleanup();
|
||||
|
||||
void VertexAttrib1fv_base(WebGLuint idx, uint32_t arrayLength, const WebGLfloat* ptr);
|
||||
void VertexAttrib2fv_base(WebGLuint idx, uint32_t arrayLength, const WebGLfloat* ptr);
|
||||
void VertexAttrib3fv_base(WebGLuint idx, uint32_t arrayLength, const WebGLfloat* ptr);
|
||||
void VertexAttrib4fv_base(WebGLuint idx, uint32_t arrayLength, const WebGLfloat* ptr);
|
||||
void VertexAttrib1fv_base(GLuint idx, uint32_t arrayLength, const GLfloat* ptr);
|
||||
void VertexAttrib2fv_base(GLuint idx, uint32_t arrayLength, const GLfloat* ptr);
|
||||
void VertexAttrib3fv_base(GLuint idx, uint32_t arrayLength, const GLfloat* ptr);
|
||||
void VertexAttrib4fv_base(GLuint idx, uint32_t arrayLength, const GLfloat* ptr);
|
||||
|
||||
bool ValidateBufferFetching(const char *info);
|
||||
bool BindArrayAttribToLocation0(WebGLProgram *program);
|
||||
|
@ -886,12 +886,12 @@ protected:
|
|||
void UnbindFakeBlackTextures();
|
||||
|
||||
int WhatDoesVertexAttrib0Need();
|
||||
bool DoFakeVertexAttrib0(WebGLuint vertexCount);
|
||||
bool DoFakeVertexAttrib0(GLuint vertexCount);
|
||||
void UndoFakeVertexAttrib0();
|
||||
void InvalidateFakeVertexAttrib0();
|
||||
|
||||
static CheckedUint32 GetImageSize(WebGLsizei height,
|
||||
WebGLsizei width,
|
||||
static CheckedUint32 GetImageSize(GLsizei height,
|
||||
GLsizei width,
|
||||
uint32_t pixelSize,
|
||||
uint32_t alignment);
|
||||
|
||||
|
@ -922,8 +922,8 @@ protected:
|
|||
template<typename WebGLObjectType>
|
||||
void DeleteWebGLObjectsArray(nsTArray<WebGLObjectType>& array);
|
||||
|
||||
WebGLuint mActiveTexture;
|
||||
WebGLenum mWebGLError;
|
||||
GLuint mActiveTexture;
|
||||
GLenum mWebGLError;
|
||||
|
||||
// whether shader validation is supported
|
||||
bool mShaderValidation;
|
||||
|
@ -996,7 +996,7 @@ protected:
|
|||
|
||||
static const char* GetExtensionString(WebGLExtensionID ext);
|
||||
|
||||
nsTArray<WebGLenum> mCompressedTextureFormats;
|
||||
nsTArray<GLenum> mCompressedTextureFormats;
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -1010,29 +1010,29 @@ protected:
|
|||
// -------------------------------------------------------------------------
|
||||
// Validation functions (implemented in WebGLContextValidate.cpp)
|
||||
bool InitAndValidateGL();
|
||||
bool ValidateBlendEquationEnum(WebGLenum cap, const char *info);
|
||||
bool ValidateBlendFuncDstEnum(WebGLenum mode, const char *info);
|
||||
bool ValidateBlendFuncSrcEnum(WebGLenum mode, const char *info);
|
||||
bool ValidateBlendFuncEnumsCompatibility(WebGLenum sfactor, WebGLenum dfactor, const char *info);
|
||||
bool ValidateTextureTargetEnum(WebGLenum target, const char *info);
|
||||
bool ValidateComparisonEnum(WebGLenum target, const char *info);
|
||||
bool ValidateStencilOpEnum(WebGLenum action, const char *info);
|
||||
bool ValidateFaceEnum(WebGLenum face, const char *info);
|
||||
bool ValidateTexFormatAndType(WebGLenum format, WebGLenum type, int jsArrayType,
|
||||
bool ValidateBlendEquationEnum(GLenum cap, const char *info);
|
||||
bool ValidateBlendFuncDstEnum(GLenum mode, const char *info);
|
||||
bool ValidateBlendFuncSrcEnum(GLenum mode, const char *info);
|
||||
bool ValidateBlendFuncEnumsCompatibility(GLenum sfactor, GLenum dfactor, const char *info);
|
||||
bool ValidateTextureTargetEnum(GLenum target, const char *info);
|
||||
bool ValidateComparisonEnum(GLenum target, const char *info);
|
||||
bool ValidateStencilOpEnum(GLenum action, const char *info);
|
||||
bool ValidateFaceEnum(GLenum face, const char *info);
|
||||
bool ValidateTexFormatAndType(GLenum format, GLenum type, int jsArrayType,
|
||||
uint32_t *texelSize, const char *info);
|
||||
bool ValidateDrawModeEnum(WebGLenum mode, const char *info);
|
||||
bool ValidateAttribIndex(WebGLuint index, const char *info);
|
||||
bool ValidateDrawModeEnum(GLenum mode, const char *info);
|
||||
bool ValidateAttribIndex(GLuint index, const char *info);
|
||||
bool ValidateStencilParamsForDrawCall();
|
||||
|
||||
bool ValidateGLSLVariableName(const nsAString& name, const char *info);
|
||||
bool ValidateGLSLCharacter(PRUnichar c);
|
||||
bool ValidateGLSLString(const nsAString& string, const char *info);
|
||||
|
||||
bool ValidateTexImage2DTarget(WebGLenum target, WebGLsizei width, WebGLsizei height, const char* info);
|
||||
bool ValidateCompressedTextureSize(WebGLenum target, WebGLint level, WebGLenum format, WebGLsizei width, WebGLsizei height, uint32_t byteLength, const char* info);
|
||||
bool ValidateLevelWidthHeightForTarget(WebGLenum target, WebGLint level, WebGLsizei width, WebGLsizei height, const char* info);
|
||||
bool ValidateTexImage2DTarget(GLenum target, GLsizei width, GLsizei height, const char* info);
|
||||
bool ValidateCompressedTextureSize(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, uint32_t byteLength, const char* info);
|
||||
bool ValidateLevelWidthHeightForTarget(GLenum target, GLint level, GLsizei width, GLsizei height, const char* info);
|
||||
|
||||
static uint32_t GetBitsPerTexel(WebGLenum format, WebGLenum type);
|
||||
static uint32_t GetBitsPerTexel(GLenum format, GLenum type);
|
||||
|
||||
void Invalidate();
|
||||
void DestroyResourcesAndContext();
|
||||
|
@ -1040,21 +1040,21 @@ protected:
|
|||
void MakeContextCurrent() const { gl->MakeCurrent(); }
|
||||
|
||||
// helpers
|
||||
void TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height, WebGLsizei srcStrideOrZero, WebGLint border,
|
||||
WebGLenum format, WebGLenum type,
|
||||
void TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei srcStrideOrZero, GLint border,
|
||||
GLenum format, GLenum type,
|
||||
void *data, uint32_t byteLength,
|
||||
int jsArrayType,
|
||||
WebGLTexelFormat srcFormat, bool srcPremultiplied);
|
||||
void TexSubImage2D_base(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height, WebGLsizei srcStrideOrZero,
|
||||
WebGLenum format, WebGLenum type,
|
||||
void TexSubImage2D_base(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLsizei srcStrideOrZero,
|
||||
GLenum format, GLenum type,
|
||||
void *pixels, uint32_t byteLength,
|
||||
int jsArrayType,
|
||||
WebGLTexelFormat srcFormat, bool srcPremultiplied);
|
||||
void TexParameter_base(WebGLenum target, WebGLenum pname,
|
||||
WebGLint *intParamPtr, WebGLfloat *floatParamPtr);
|
||||
void TexParameter_base(GLenum target, GLenum pname,
|
||||
GLint *intParamPtr, GLfloat *floatParamPtr);
|
||||
|
||||
void ConvertImage(size_t width, size_t height, size_t srcStride, size_t dstStride,
|
||||
const uint8_t* src, uint8_t *dst,
|
||||
|
@ -1084,15 +1084,15 @@ protected:
|
|||
gfxImageSurface **imageOut,
|
||||
WebGLTexelFormat *format);
|
||||
|
||||
void CopyTexSubImage2D_base(WebGLenum target,
|
||||
WebGLint level,
|
||||
WebGLenum internalformat,
|
||||
WebGLint xoffset,
|
||||
WebGLint yoffset,
|
||||
WebGLint x,
|
||||
WebGLint y,
|
||||
WebGLsizei width,
|
||||
WebGLsizei height,
|
||||
void CopyTexSubImage2D_base(GLenum target,
|
||||
GLint level,
|
||||
GLenum internalformat,
|
||||
GLint xoffset,
|
||||
GLint yoffset,
|
||||
GLint x,
|
||||
GLint y,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
bool sub);
|
||||
|
||||
// Returns false if aObject is null or not valid
|
||||
|
@ -1116,7 +1116,7 @@ private:
|
|||
bool ValidateObjectAssumeNonNull(const char* info, ObjectType *aObject);
|
||||
|
||||
protected:
|
||||
int32_t MaxTextureSizeForTarget(WebGLenum target) const {
|
||||
int32_t MaxTextureSizeForTarget(GLenum target) const {
|
||||
return target == LOCAL_GL_TEXTURE_2D ? mGLMaxTextureSize : mGLMaxCubeMapTextureSize;
|
||||
}
|
||||
|
||||
|
@ -1173,23 +1173,23 @@ protected:
|
|||
|
||||
FakeBlackStatus mFakeBlackStatus;
|
||||
|
||||
WebGLuint mBlackTexture2D, mBlackTextureCubeMap;
|
||||
GLuint mBlackTexture2D, mBlackTextureCubeMap;
|
||||
bool mBlackTexturesAreInitialized;
|
||||
|
||||
WebGLfloat mVertexAttrib0Vector[4];
|
||||
WebGLfloat mFakeVertexAttrib0BufferObjectVector[4];
|
||||
GLfloat mVertexAttrib0Vector[4];
|
||||
GLfloat mFakeVertexAttrib0BufferObjectVector[4];
|
||||
size_t mFakeVertexAttrib0BufferObjectSize;
|
||||
GLuint mFakeVertexAttrib0BufferObject;
|
||||
int mFakeVertexAttrib0BufferStatus;
|
||||
|
||||
WebGLint mStencilRefFront, mStencilRefBack;
|
||||
WebGLuint mStencilValueMaskFront, mStencilValueMaskBack,
|
||||
GLint mStencilRefFront, mStencilRefBack;
|
||||
GLuint mStencilValueMaskFront, mStencilValueMaskBack,
|
||||
mStencilWriteMaskFront, mStencilWriteMaskBack;
|
||||
realGLboolean mColorWriteMask[4];
|
||||
realGLboolean mDepthWriteMask;
|
||||
WebGLfloat mColorClearValue[4];
|
||||
WebGLint mStencilClearValue;
|
||||
WebGLfloat mDepthClearValue;
|
||||
GLfloat mColorClearValue[4];
|
||||
GLint mStencilClearValue;
|
||||
GLfloat mDepthClearValue;
|
||||
|
||||
nsCOMPtr<nsITimer> mContextRestorer;
|
||||
bool mAllowRestore;
|
||||
|
@ -1224,7 +1224,7 @@ protected:
|
|||
template <typename WebGLObjectType>
|
||||
JSObject* WebGLObjectAsJSObject(JSContext *cx, const WebGLObjectType *, ErrorResult& rv) const;
|
||||
|
||||
void ReattachTextureToAnyFramebufferToWorkAroundBugs(WebGLTexture *tex, WebGLint level);
|
||||
void ReattachTextureToAnyFramebufferToWorkAroundBugs(WebGLTexture *tex, GLint level);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// see bug 713305. This RAII helper guarantees that we're on the discrete GPU, during its lifetime
|
||||
|
|
|
@ -19,7 +19,7 @@ using namespace mozilla;
|
|||
*/
|
||||
|
||||
static const char*
|
||||
GetQueryTargetEnumString(WebGLenum target)
|
||||
GetQueryTargetEnumString(GLenum target)
|
||||
{
|
||||
switch (target)
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ WebGLContext::DeleteQuery(WebGLQuery *query)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BeginQuery(WebGLenum target, WebGLQuery *query)
|
||||
WebGLContext::BeginQuery(GLenum target, WebGLQuery *query)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -178,7 +178,7 @@ WebGLContext::BeginQuery(WebGLenum target, WebGLQuery *query)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::EndQuery(WebGLenum target)
|
||||
WebGLContext::EndQuery(GLenum target)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -234,7 +234,7 @@ WebGLContext::IsQuery(WebGLQuery *query)
|
|||
}
|
||||
|
||||
already_AddRefed<WebGLQuery>
|
||||
WebGLContext::GetQuery(WebGLenum target, WebGLenum pname)
|
||||
WebGLContext::GetQuery(GLenum target, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return nullptr;
|
||||
|
@ -257,7 +257,7 @@ WebGLContext::GetQuery(WebGLenum target, WebGLenum pname)
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname)
|
||||
WebGLContext::GetQueryObject(JSContext* cx, WebGLQuery *query, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -333,7 +333,7 @@ WebGLContext::GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname)
|
|||
}
|
||||
|
||||
WebGLRefPtr<WebGLQuery>*
|
||||
WebGLContext::GetQueryTargetSlot(WebGLenum target, const char* infos)
|
||||
WebGLContext::GetQueryTargetSlot(GLenum target, const char* infos)
|
||||
{
|
||||
switch (target) {
|
||||
case LOCAL_GL_ANY_SAMPLES_PASSED:
|
||||
|
|
|
@ -11,7 +11,7 @@ using namespace mozilla;
|
|||
using namespace mozilla::dom;
|
||||
|
||||
void
|
||||
WebGLContext::BindBuffer(WebGLenum target, WebGLBuffer *buffer)
|
||||
WebGLContext::BindBuffer(GLenum target, WebGLBuffer *buffer)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -46,7 +46,7 @@ WebGLContext::BindBuffer(WebGLenum target, WebGLBuffer *buffer)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BindBufferBase(WebGLenum target, WebGLuint index, WebGLBuffer* buffer)
|
||||
WebGLContext::BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -87,7 +87,7 @@ WebGLContext::BindBufferBase(WebGLenum target, WebGLuint index, WebGLBuffer* buf
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BindBufferRange(WebGLenum target, WebGLuint index, WebGLBuffer* buffer,
|
||||
WebGLContext::BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer,
|
||||
WebGLintptr offset, WebGLsizeiptr size)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -134,8 +134,8 @@ WebGLContext::BindBufferRange(WebGLenum target, WebGLuint index, WebGLBuffer* bu
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BufferData(WebGLenum target, WebGLsizeiptr size,
|
||||
WebGLenum usage)
|
||||
WebGLContext::BufferData(GLenum target, WebGLsizeiptr size,
|
||||
GLenum usage)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -183,9 +183,9 @@ WebGLContext::BufferData(WebGLenum target, WebGLsizeiptr size,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BufferData(WebGLenum target,
|
||||
WebGLContext::BufferData(GLenum target,
|
||||
const Nullable<ArrayBuffer> &maybeData,
|
||||
WebGLenum usage)
|
||||
GLenum usage)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -232,8 +232,8 @@ WebGLContext::BufferData(WebGLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BufferData(WebGLenum target, const ArrayBufferView& data,
|
||||
WebGLenum usage)
|
||||
WebGLContext::BufferData(GLenum target, const ArrayBufferView& data,
|
||||
GLenum usage)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -315,7 +315,7 @@ WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr byteOffset,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BufferSubData(WebGLenum target, WebGLsizeiptr byteOffset,
|
||||
WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr byteOffset,
|
||||
const ArrayBufferView& data)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -401,7 +401,7 @@ WebGLContext::IsBuffer(WebGLBuffer *buffer)
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::ValidateBufferUsageEnum(WebGLenum target, const char *infos)
|
||||
WebGLContext::ValidateBufferUsageEnum(GLenum target, const char *infos)
|
||||
{
|
||||
switch (target) {
|
||||
case LOCAL_GL_STREAM_DRAW:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
using namespace mozilla;
|
||||
|
||||
void
|
||||
WebGLContext::Clear(WebGLbitfield mask)
|
||||
WebGLContext::Clear(GLbitfield mask)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -76,8 +76,8 @@ WebGLContext::Clear(WebGLbitfield mask)
|
|||
mShouldPresent = true;
|
||||
}
|
||||
|
||||
static WebGLclampf
|
||||
GLClampFloat(WebGLclampf val)
|
||||
static GLclampf
|
||||
GLClampFloat(GLclampf val)
|
||||
{
|
||||
if (val < 0.0)
|
||||
return 0.0;
|
||||
|
@ -89,8 +89,8 @@ GLClampFloat(WebGLclampf val)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::ClearColor(WebGLclampf r, WebGLclampf g,
|
||||
WebGLclampf b, WebGLclampf a)
|
||||
WebGLContext::ClearColor(GLclampf r, GLclampf g,
|
||||
GLclampf b, GLclampf a)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -104,7 +104,7 @@ WebGLContext::ClearColor(WebGLclampf r, WebGLclampf g,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::ClearDepth(WebGLclampf v)
|
||||
WebGLContext::ClearDepth(GLclampf v)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -115,7 +115,7 @@ WebGLContext::ClearDepth(WebGLclampf v)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::ClearStencil(WebGLint v)
|
||||
WebGLContext::ClearStencil(GLint v)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -227,7 +227,7 @@ WebGLContext::DrawBuffers(const dom::Sequence<GLenum>& buffers)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilMask(WebGLuint mask)
|
||||
WebGLContext::StencilMask(GLuint mask)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -240,7 +240,7 @@ WebGLContext::StencilMask(WebGLuint mask)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilMaskSeparate(WebGLenum face, WebGLuint mask)
|
||||
WebGLContext::StencilMaskSeparate(GLenum face, GLuint mask)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
|
|
@ -48,8 +48,8 @@ using namespace mozilla;
|
|||
using namespace mozilla::dom;
|
||||
using namespace mozilla::gl;
|
||||
|
||||
static bool BaseTypeAndSizeFromUniformType(WebGLenum uType, WebGLenum *baseType, WebGLint *unitSize);
|
||||
static WebGLenum InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2);
|
||||
static bool BaseTypeAndSizeFromUniformType(GLenum uType, GLenum *baseType, GLint *unitSize);
|
||||
static GLenum InternalFormatForFormatAndType(GLenum format, GLenum type, bool isGLES2);
|
||||
|
||||
//
|
||||
// WebGL API
|
||||
|
@ -61,7 +61,7 @@ inline const WebGLRectangleObject *WebGLContext::FramebufferRectangleObject() co
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::ActiveTexture(WebGLenum texture)
|
||||
WebGLContext::ActiveTexture(GLenum texture)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -103,7 +103,7 @@ WebGLContext::AttachShader(WebGLProgram *program, WebGLShader *shader)
|
|||
|
||||
|
||||
void
|
||||
WebGLContext::BindAttribLocation(WebGLProgram *prog, WebGLuint location,
|
||||
WebGLContext::BindAttribLocation(WebGLProgram *prog, GLuint location,
|
||||
const nsAString& name)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -112,7 +112,7 @@ WebGLContext::BindAttribLocation(WebGLProgram *prog, WebGLuint location,
|
|||
if (!ValidateObject("bindAttribLocation: program", prog))
|
||||
return;
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
|
||||
if (!ValidateGLSLVariableName(name, "bindAttribLocation"))
|
||||
return;
|
||||
|
@ -129,7 +129,7 @@ WebGLContext::BindAttribLocation(WebGLProgram *prog, WebGLuint location,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BindFramebuffer(WebGLenum target, WebGLFramebuffer *wfb)
|
||||
WebGLContext::BindFramebuffer(GLenum target, WebGLFramebuffer *wfb)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -149,7 +149,7 @@ WebGLContext::BindFramebuffer(WebGLenum target, WebGLFramebuffer *wfb)
|
|||
if (!wfb) {
|
||||
gl->fBindFramebuffer(target, 0);
|
||||
} else {
|
||||
WebGLuint framebuffername = wfb->GLName();
|
||||
GLuint framebuffername = wfb->GLName();
|
||||
gl->fBindFramebuffer(target, framebuffername);
|
||||
wfb->SetHasEverBeenBound(true);
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ WebGLContext::BindFramebuffer(WebGLenum target, WebGLFramebuffer *wfb)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BindRenderbuffer(WebGLenum target, WebGLRenderbuffer *wrb)
|
||||
WebGLContext::BindRenderbuffer(GLenum target, WebGLRenderbuffer *wrb)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -178,14 +178,14 @@ WebGLContext::BindRenderbuffer(WebGLenum target, WebGLRenderbuffer *wrb)
|
|||
|
||||
MakeContextCurrent();
|
||||
|
||||
WebGLuint renderbuffername = wrb ? wrb->GLName() : 0;
|
||||
GLuint renderbuffername = wrb ? wrb->GLName() : 0;
|
||||
gl->fBindRenderbuffer(target, renderbuffername);
|
||||
|
||||
mBoundRenderbuffer = wrb;
|
||||
}
|
||||
|
||||
void
|
||||
WebGLContext::BindTexture(WebGLenum target, WebGLTexture *tex)
|
||||
WebGLContext::BindTexture(GLenum target, WebGLTexture *tex)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -214,7 +214,7 @@ WebGLContext::BindTexture(WebGLenum target, WebGLTexture *tex)
|
|||
gl->fBindTexture(target, 0 /* == texturename */);
|
||||
}
|
||||
|
||||
void WebGLContext::BlendEquation(WebGLenum mode)
|
||||
void WebGLContext::BlendEquation(GLenum mode)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -226,7 +226,7 @@ void WebGLContext::BlendEquation(WebGLenum mode)
|
|||
gl->fBlendEquation(mode);
|
||||
}
|
||||
|
||||
void WebGLContext::BlendEquationSeparate(WebGLenum modeRGB, WebGLenum modeAlpha)
|
||||
void WebGLContext::BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -239,7 +239,7 @@ void WebGLContext::BlendEquationSeparate(WebGLenum modeRGB, WebGLenum modeAlpha)
|
|||
gl->fBlendEquationSeparate(modeRGB, modeAlpha);
|
||||
}
|
||||
|
||||
void WebGLContext::BlendFunc(WebGLenum sfactor, WebGLenum dfactor)
|
||||
void WebGLContext::BlendFunc(GLenum sfactor, GLenum dfactor)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -256,8 +256,8 @@ void WebGLContext::BlendFunc(WebGLenum sfactor, WebGLenum dfactor)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::BlendFuncSeparate(WebGLenum srcRGB, WebGLenum dstRGB,
|
||||
WebGLenum srcAlpha, WebGLenum dstAlpha)
|
||||
WebGLContext::BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
|
||||
GLenum srcAlpha, GLenum dstAlpha)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -312,8 +312,8 @@ GLenum WebGLContext::CheckedBufferData(GLenum target,
|
|||
}
|
||||
}
|
||||
|
||||
WebGLenum
|
||||
WebGLContext::CheckFramebufferStatus(WebGLenum target)
|
||||
GLenum
|
||||
WebGLContext::CheckFramebufferStatus(GLenum target)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
{
|
||||
|
@ -363,20 +363,20 @@ WebGLContext::CheckFramebufferStatus(WebGLenum target)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CopyTexSubImage2D_base(WebGLenum target,
|
||||
WebGLint level,
|
||||
WebGLenum internalformat,
|
||||
WebGLint xoffset,
|
||||
WebGLint yoffset,
|
||||
WebGLint x,
|
||||
WebGLint y,
|
||||
WebGLsizei width,
|
||||
WebGLsizei height,
|
||||
WebGLContext::CopyTexSubImage2D_base(GLenum target,
|
||||
GLint level,
|
||||
GLenum internalformat,
|
||||
GLint xoffset,
|
||||
GLint yoffset,
|
||||
GLint x,
|
||||
GLint y,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
bool sub)
|
||||
{
|
||||
const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject();
|
||||
WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
|
||||
WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;
|
||||
GLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
|
||||
GLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;
|
||||
|
||||
const char *info = sub ? "copyTexSubImage2D" : "copyTexImage2D";
|
||||
|
||||
|
@ -463,14 +463,14 @@ WebGLContext::CopyTexSubImage2D_base(WebGLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CopyTexImage2D(WebGLenum target,
|
||||
WebGLint level,
|
||||
WebGLenum internalformat,
|
||||
WebGLint x,
|
||||
WebGLint y,
|
||||
WebGLsizei width,
|
||||
WebGLsizei height,
|
||||
WebGLint border)
|
||||
WebGLContext::CopyTexImage2D(GLenum target,
|
||||
GLint level,
|
||||
GLenum internalformat,
|
||||
GLint x,
|
||||
GLint y,
|
||||
GLsizei width,
|
||||
GLsizei height,
|
||||
GLint border)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -509,7 +509,7 @@ WebGLContext::CopyTexImage2D(WebGLenum target,
|
|||
if (level < 0)
|
||||
return ErrorInvalidValue("copyTexImage2D: level may not be negative");
|
||||
|
||||
WebGLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
GLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
if (!(maxTextureSize >> level))
|
||||
return ErrorInvalidValue("copyTexImage2D: 2^level exceeds maximum texture size");
|
||||
|
||||
|
@ -572,14 +572,14 @@ WebGLContext::CopyTexImage2D(WebGLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CopyTexSubImage2D(WebGLenum target,
|
||||
WebGLint level,
|
||||
WebGLint xoffset,
|
||||
WebGLint yoffset,
|
||||
WebGLint x,
|
||||
WebGLint y,
|
||||
WebGLsizei width,
|
||||
WebGLsizei height)
|
||||
WebGLContext::CopyTexSubImage2D(GLenum target,
|
||||
GLint level,
|
||||
GLint xoffset,
|
||||
GLint yoffset,
|
||||
GLint x,
|
||||
GLint y,
|
||||
GLsizei width,
|
||||
GLsizei height)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -600,7 +600,7 @@ WebGLContext::CopyTexSubImage2D(WebGLenum target,
|
|||
if (level < 0)
|
||||
return ErrorInvalidValue("copyTexSubImage2D: level may not be negative");
|
||||
|
||||
WebGLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
GLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
if (!(maxTextureSize >> level))
|
||||
return ErrorInvalidValue("copyTexSubImage2D: 2^level exceeds maximum texture size");
|
||||
|
||||
|
@ -614,13 +614,13 @@ WebGLContext::CopyTexSubImage2D(WebGLenum target,
|
|||
if (!tex)
|
||||
return ErrorInvalidOperation("copyTexSubImage2D: no texture bound to this target");
|
||||
|
||||
WebGLint face = WebGLTexture::FaceForTarget(target);
|
||||
GLint face = WebGLTexture::FaceForTarget(target);
|
||||
if (!tex->HasImageInfoAt(level, face))
|
||||
return ErrorInvalidOperation("copyTexSubImage2D: no texture image previously defined for this level and face");
|
||||
|
||||
const WebGLTexture::ImageInfo &imageInfo = tex->ImageInfoAt(level, face);
|
||||
WebGLsizei texWidth = imageInfo.Width();
|
||||
WebGLsizei texHeight = imageInfo.Height();
|
||||
GLsizei texWidth = imageInfo.Width();
|
||||
GLsizei texHeight = imageInfo.Height();
|
||||
|
||||
if (xoffset + width > texWidth || xoffset + width < 0)
|
||||
return ErrorInvalidValue("copyTexSubImage2D: xoffset+width is too large");
|
||||
|
@ -628,7 +628,7 @@ WebGLContext::CopyTexSubImage2D(WebGLenum target,
|
|||
if (yoffset + height > texHeight || yoffset + height < 0)
|
||||
return ErrorInvalidValue("copyTexSubImage2D: yoffset+height is too large");
|
||||
|
||||
WebGLenum format = imageInfo.Format();
|
||||
GLenum format = imageInfo.Format();
|
||||
bool texFormatRequiresAlpha = format == LOCAL_GL_RGBA ||
|
||||
format == LOCAL_GL_ALPHA ||
|
||||
format == LOCAL_GL_LUMINANCE_ALPHA;
|
||||
|
@ -661,7 +661,7 @@ WebGLContext::CreateProgram()
|
|||
}
|
||||
|
||||
already_AddRefed<WebGLShader>
|
||||
WebGLContext::CreateShader(WebGLenum type)
|
||||
WebGLContext::CreateShader(GLenum type)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return nullptr;
|
||||
|
@ -678,7 +678,7 @@ WebGLContext::CreateShader(WebGLenum type)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CullFace(WebGLenum face)
|
||||
WebGLContext::CullFace(GLenum face)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -746,7 +746,7 @@ WebGLContext::DeleteTexture(WebGLTexture *tex)
|
|||
if (mBoundFramebuffer)
|
||||
mBoundFramebuffer->DetachTexture(tex);
|
||||
|
||||
WebGLuint activeTexture = mActiveTexture;
|
||||
GLuint activeTexture = mActiveTexture;
|
||||
for (int32_t i = 0; i < mGLMaxTextureUnits; i++) {
|
||||
if ((tex->Target() == LOCAL_GL_TEXTURE_2D && mBound2DTextures[i] == tex) ||
|
||||
(tex->Target() == LOCAL_GL_TEXTURE_CUBE_MAP && mBoundCubeMapTextures[i] == tex))
|
||||
|
@ -807,7 +807,7 @@ WebGLContext::DetachShader(WebGLProgram *program, WebGLShader *shader)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DepthFunc(WebGLenum func)
|
||||
WebGLContext::DepthFunc(GLenum func)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -820,7 +820,7 @@ WebGLContext::DepthFunc(WebGLenum func)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DepthRange(WebGLfloat zNear, WebGLfloat zFar)
|
||||
WebGLContext::DepthRange(GLfloat zNear, GLfloat zFar)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -853,7 +853,7 @@ WebGLContext::WhatDoesVertexAttrib0Need()
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::DoFakeVertexAttrib0(WebGLuint vertexCount)
|
||||
WebGLContext::DoFakeVertexAttrib0(GLuint vertexCount)
|
||||
{
|
||||
int whatDoesAttrib0Need = WhatDoesVertexAttrib0Need();
|
||||
|
||||
|
@ -869,7 +869,7 @@ WebGLContext::DoFakeVertexAttrib0(WebGLuint vertexCount)
|
|||
mAlreadyWarnedAboutFakeVertexAttrib0 = true;
|
||||
}
|
||||
|
||||
CheckedUint32 checked_dataSize = CheckedUint32(vertexCount) * 4 * sizeof(WebGLfloat);
|
||||
CheckedUint32 checked_dataSize = CheckedUint32(vertexCount) * 4 * sizeof(GLfloat);
|
||||
|
||||
if (!checked_dataSize.isValid()) {
|
||||
ErrorOutOfMemory("Integer overflow trying to construct a fake vertex attrib 0 array for a draw-operation "
|
||||
|
@ -877,7 +877,7 @@ WebGLContext::DoFakeVertexAttrib0(WebGLuint vertexCount)
|
|||
return false;
|
||||
}
|
||||
|
||||
WebGLuint dataSize = checked_dataSize.value();
|
||||
GLuint dataSize = checked_dataSize.value();
|
||||
|
||||
if (!mFakeVertexAttrib0BufferObject) {
|
||||
gl->fGenBuffers(1, &mFakeVertexAttrib0BufferObject);
|
||||
|
@ -910,7 +910,7 @@ WebGLContext::DoFakeVertexAttrib0(WebGLuint vertexCount)
|
|||
UpdateWebGLErrorAndClearGLError();
|
||||
|
||||
if (mFakeVertexAttrib0BufferStatus == VertexAttrib0Status::EmulatedInitializedArray) {
|
||||
nsAutoArrayPtr<WebGLfloat> array(new WebGLfloat[4 * vertexCount]);
|
||||
nsAutoArrayPtr<GLfloat> array(new GLfloat[4 * vertexCount]);
|
||||
for(size_t i = 0; i < vertexCount; ++i) {
|
||||
array[4 * i + 0] = mVertexAttrib0Vector[0];
|
||||
array[4 * i + 1] = mVertexAttrib0Vector[1];
|
||||
|
@ -1005,7 +1005,7 @@ WebGLContext::BindFakeBlackTextures()
|
|||
|
||||
gl->fGenTextures(1, &mBlackTextureCubeMap);
|
||||
gl->fBindTexture(LOCAL_GL_TEXTURE_CUBE_MAP, mBlackTextureCubeMap);
|
||||
for (WebGLuint i = 0; i < 6; ++i) {
|
||||
for (GLuint i = 0; i < 6; ++i) {
|
||||
gl->fTexImage2D(LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, LOCAL_GL_RGBA, 1, 1,
|
||||
0, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE, &black);
|
||||
}
|
||||
|
@ -1051,7 +1051,7 @@ WebGLContext::UnbindFakeBlackTextures()
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::FramebufferRenderbuffer(WebGLenum target, WebGLenum attachment, WebGLenum rbtarget, WebGLRenderbuffer *wrb)
|
||||
WebGLContext::FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum rbtarget, WebGLRenderbuffer *wrb)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -1063,11 +1063,11 @@ WebGLContext::FramebufferRenderbuffer(WebGLenum target, WebGLenum attachment, We
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::FramebufferTexture2D(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum textarget,
|
||||
WebGLContext::FramebufferTexture2D(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum textarget,
|
||||
WebGLTexture *tobj,
|
||||
WebGLint level)
|
||||
GLint level)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -1079,7 +1079,7 @@ WebGLContext::FramebufferTexture2D(WebGLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::FrontFace(WebGLenum mode)
|
||||
WebGLContext::FrontFace(GLenum mode)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -1108,7 +1108,7 @@ WebGLContext::GetActiveAttrib(WebGLProgram *prog, uint32_t index)
|
|||
MakeContextCurrent();
|
||||
|
||||
GLint len = 0;
|
||||
WebGLuint progname = prog->GLName();;
|
||||
GLuint progname = prog->GLName();;
|
||||
gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
|
||||
if (len == 0)
|
||||
return nullptr;
|
||||
|
@ -1131,7 +1131,7 @@ WebGLContext::GetActiveAttrib(WebGLProgram *prog, uint32_t index)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::GenerateMipmap(WebGLenum target)
|
||||
WebGLContext::GenerateMipmap(GLenum target)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -1193,7 +1193,7 @@ WebGLContext::GetActiveUniform(WebGLProgram *prog, uint32_t index)
|
|||
MakeContextCurrent();
|
||||
|
||||
GLint len = 0;
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH, &len);
|
||||
if (len == 0)
|
||||
return nullptr;
|
||||
|
@ -1255,7 +1255,7 @@ WebGLContext::GetAttachedShaders(WebGLProgram *prog,
|
|||
}
|
||||
}
|
||||
|
||||
WebGLint
|
||||
GLint
|
||||
WebGLContext::GetAttribLocation(WebGLProgram *prog, const nsAString& name)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -1271,14 +1271,14 @@ WebGLContext::GetAttribLocation(WebGLProgram *prog, const nsAString& name)
|
|||
nsCString mappedName;
|
||||
prog->MapIdentifier(cname, &mappedName);
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
|
||||
MakeContextCurrent();
|
||||
return gl->fGetAttribLocation(progname, mappedName.get());
|
||||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetBufferParameter(WebGLenum target, WebGLenum pname)
|
||||
WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -1314,9 +1314,9 @@ WebGLContext::GetBufferParameter(WebGLenum target, WebGLenum pname)
|
|||
|
||||
JS::Value
|
||||
WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
|
||||
WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum pname,
|
||||
GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum pname,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -1334,7 +1334,7 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
|
|||
if (IsExtensionEnabled(WEBGL_draw_buffers))
|
||||
{
|
||||
if (attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment >= WebGLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mGLMaxColorAttachments))
|
||||
attachment >= GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mGLMaxColorAttachments))
|
||||
{
|
||||
ErrorInvalidEnumInfo("getFramebufferAttachmentParameter: attachment", attachment);
|
||||
return JS::NullValue();
|
||||
|
@ -1407,7 +1407,7 @@ WebGLContext::GetFramebufferAttachmentParameter(JSContext* cx,
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetRenderbufferParameter(WebGLenum target, WebGLenum pname)
|
||||
WebGLContext::GetRenderbufferParameter(GLenum target, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -1458,7 +1458,7 @@ WebGLContext::CreateTexture()
|
|||
return globj.forget();
|
||||
}
|
||||
|
||||
WebGLenum
|
||||
GLenum
|
||||
WebGLContext::GetError()
|
||||
{
|
||||
if (mContextStatus == ContextStable) {
|
||||
|
@ -1469,13 +1469,13 @@ WebGLContext::GetError()
|
|||
mContextLostErrorSet = true;
|
||||
}
|
||||
|
||||
WebGLenum err = mWebGLError;
|
||||
GLenum err = mWebGLError;
|
||||
mWebGLError = LOCAL_GL_NO_ERROR;
|
||||
return err;
|
||||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetProgramParameter(WebGLProgram *prog, WebGLenum pname)
|
||||
WebGLContext::GetProgramParameter(WebGLProgram *prog, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -1483,7 +1483,7 @@ WebGLContext::GetProgramParameter(WebGLProgram *prog, WebGLenum pname)
|
|||
if (!ValidateObjectAllowDeleted("getProgramParameter: program", prog))
|
||||
return JS::NullValue();
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ WebGLContext::GetProgramInfoLog(WebGLProgram *prog, nsACString& retval)
|
|||
return;
|
||||
}
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
|
@ -1577,17 +1577,17 @@ WebGLContext::GetProgramInfoLog(WebGLProgram *prog, nsACString& retval)
|
|||
// here we have to support all pnames with both int and float params.
|
||||
// See this discussion:
|
||||
// https://www.khronos.org/webgl/public-mailing-list/archives/1008/msg00014.html
|
||||
void WebGLContext::TexParameter_base(WebGLenum target, WebGLenum pname,
|
||||
WebGLint *intParamPtr,
|
||||
WebGLfloat *floatParamPtr)
|
||||
void WebGLContext::TexParameter_base(GLenum target, GLenum pname,
|
||||
GLint *intParamPtr,
|
||||
GLfloat *floatParamPtr)
|
||||
{
|
||||
MOZ_ASSERT(intParamPtr || floatParamPtr);
|
||||
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
||||
WebGLint intParam = intParamPtr ? *intParamPtr : WebGLint(*floatParamPtr);
|
||||
WebGLfloat floatParam = floatParamPtr ? *floatParamPtr : WebGLfloat(*intParamPtr);
|
||||
GLint intParam = intParamPtr ? *intParamPtr : GLint(*floatParamPtr);
|
||||
GLfloat floatParam = floatParamPtr ? *floatParamPtr : GLfloat(*intParamPtr);
|
||||
|
||||
if (!ValidateTextureTargetEnum(target, "texParameter: target"))
|
||||
return;
|
||||
|
@ -1684,7 +1684,7 @@ void WebGLContext::TexParameter_base(WebGLenum target, WebGLenum pname,
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetTexParameter(WebGLenum target, WebGLenum pname)
|
||||
WebGLContext::GetTexParameter(GLenum target, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -1749,7 +1749,7 @@ WebGLContext::GetUniform(JSContext* cx, WebGLProgram *prog,
|
|||
return JS::NullValue();
|
||||
}
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
|
@ -1875,7 +1875,7 @@ WebGLContext::GetUniformLocation(WebGLProgram *prog, const nsAString& name)
|
|||
nsCString mappedName;
|
||||
prog->MapIdentifier(cname, &mappedName);
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
MakeContextCurrent();
|
||||
GLint intlocation = gl->fGetUniformLocation(progname, mappedName.get());
|
||||
|
||||
|
@ -1891,7 +1891,7 @@ WebGLContext::GetUniformLocation(WebGLProgram *prog, const nsAString& name)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Hint(WebGLenum target, WebGLenum mode)
|
||||
WebGLContext::Hint(GLenum target, GLenum mode)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2127,7 +2127,7 @@ WebGLContext::LinkProgram(WebGLProgram *program)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::PixelStorei(WebGLenum pname, WebGLint param)
|
||||
WebGLContext::PixelStorei(GLenum pname, GLint param)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2165,9 +2165,9 @@ WebGLContext::PixelStorei(WebGLenum pname, WebGLint param)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width,
|
||||
WebGLsizei height, WebGLenum format,
|
||||
WebGLenum type, const Nullable<ArrayBufferView> &pixels,
|
||||
WebGLContext::ReadPixels(GLint x, GLint y, GLsizei width,
|
||||
GLsizei height, GLenum format,
|
||||
GLenum type, const Nullable<ArrayBufferView> &pixels,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable()) {
|
||||
|
@ -2186,8 +2186,8 @@ WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width,
|
|||
return ErrorInvalidValue("readPixels: null destination buffer");
|
||||
|
||||
const WebGLRectangleObject *framebufferRect = FramebufferRectangleObject();
|
||||
WebGLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
|
||||
WebGLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;
|
||||
GLsizei framebufferWidth = framebufferRect ? framebufferRect->Width() : 0;
|
||||
GLsizei framebufferHeight = framebufferRect ? framebufferRect->Height() : 0;
|
||||
|
||||
uint32_t channels = 0;
|
||||
|
||||
|
@ -2391,7 +2391,7 @@ WebGLContext::ReadPixels(WebGLint x, WebGLint y, WebGLsizei width,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::RenderbufferStorage(WebGLenum target, WebGLenum internalformat, WebGLsizei width, WebGLsizei height)
|
||||
WebGLContext::RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2409,7 +2409,7 @@ WebGLContext::RenderbufferStorage(WebGLenum target, WebGLenum internalformat, We
|
|||
return ErrorInvalidValue("renderbufferStorage: width or height exceeds maximum renderbuffer size");
|
||||
|
||||
// certain OpenGL ES renderbuffer formats may not exist on desktop OpenGL
|
||||
WebGLenum internalformatForGL = internalformat;
|
||||
GLenum internalformatForGL = internalformat;
|
||||
|
||||
switch (internalformat) {
|
||||
case LOCAL_GL_RGBA4:
|
||||
|
@ -2468,7 +2468,7 @@ WebGLContext::RenderbufferStorage(WebGLenum target, WebGLenum internalformat, We
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Scissor(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height)
|
||||
WebGLContext::Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2481,7 +2481,7 @@ WebGLContext::Scissor(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei heigh
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilFunc(WebGLenum func, WebGLint ref, WebGLuint mask)
|
||||
WebGLContext::StencilFunc(GLenum func, GLint ref, GLuint mask)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2499,7 +2499,7 @@ WebGLContext::StencilFunc(WebGLenum func, WebGLint ref, WebGLuint mask)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilFuncSeparate(WebGLenum face, WebGLenum func, WebGLint ref, WebGLuint mask)
|
||||
WebGLContext::StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2530,7 +2530,7 @@ WebGLContext::StencilFuncSeparate(WebGLenum face, WebGLenum func, WebGLint ref,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilOp(WebGLenum sfail, WebGLenum dpfail, WebGLenum dppass)
|
||||
WebGLContext::StencilOp(GLenum sfail, GLenum dpfail, GLenum dppass)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2545,7 +2545,7 @@ WebGLContext::StencilOp(WebGLenum sfail, WebGLenum dpfail, WebGLenum dppass)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::StencilOpSeparate(WebGLenum face, WebGLenum sfail, WebGLenum dpfail, WebGLenum dppass)
|
||||
WebGLContext::StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -2635,7 +2635,7 @@ WebGLContext::SurfaceFromElementResultToImageSurface(nsLayoutUtils::SurfaceFromE
|
|||
|
||||
|
||||
void
|
||||
WebGLContext::Uniform1i(WebGLUniformLocation *location_object, WebGLint a1)
|
||||
WebGLContext::Uniform1i(WebGLUniformLocation *location_object, GLint a1)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform1i", location_object, location))
|
||||
|
@ -2649,8 +2649,8 @@ WebGLContext::Uniform1i(WebGLUniformLocation *location_object, WebGLint a1)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform2i(WebGLUniformLocation *location_object, WebGLint a1,
|
||||
WebGLint a2)
|
||||
WebGLContext::Uniform2i(WebGLUniformLocation *location_object, GLint a1,
|
||||
GLint a2)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform2i", location_object, location))
|
||||
|
@ -2667,8 +2667,8 @@ WebGLContext::Uniform2i(WebGLUniformLocation *location_object, WebGLint a1,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform3i(WebGLUniformLocation *location_object, WebGLint a1,
|
||||
WebGLint a2, WebGLint a3)
|
||||
WebGLContext::Uniform3i(WebGLUniformLocation *location_object, GLint a1,
|
||||
GLint a2, GLint a3)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform3i", location_object, location))
|
||||
|
@ -2686,8 +2686,8 @@ WebGLContext::Uniform3i(WebGLUniformLocation *location_object, WebGLint a1,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform4i(WebGLUniformLocation *location_object, WebGLint a1,
|
||||
WebGLint a2, WebGLint a3, WebGLint a4)
|
||||
WebGLContext::Uniform4i(WebGLUniformLocation *location_object, GLint a1,
|
||||
GLint a2, GLint a3, GLint a4)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform4i", location_object, location))
|
||||
|
@ -2706,7 +2706,7 @@ WebGLContext::Uniform4i(WebGLUniformLocation *location_object, WebGLint a1,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform1f(WebGLUniformLocation *location_object, WebGLfloat a1)
|
||||
WebGLContext::Uniform1f(WebGLUniformLocation *location_object, GLfloat a1)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform1f", location_object, location))
|
||||
|
@ -2716,8 +2716,8 @@ WebGLContext::Uniform1f(WebGLUniformLocation *location_object, WebGLfloat a1)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform2f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
||||
WebGLfloat a2)
|
||||
WebGLContext::Uniform2f(WebGLUniformLocation *location_object, GLfloat a1,
|
||||
GLfloat a2)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform2f", location_object, location))
|
||||
|
@ -2727,8 +2727,8 @@ WebGLContext::Uniform2f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform3f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
||||
WebGLfloat a2, WebGLfloat a3)
|
||||
WebGLContext::Uniform3f(WebGLUniformLocation *location_object, GLfloat a1,
|
||||
GLfloat a2, GLfloat a3)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform3f", location_object, location))
|
||||
|
@ -2738,8 +2738,8 @@ WebGLContext::Uniform3f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Uniform4f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
||||
WebGLfloat a2, WebGLfloat a3, WebGLfloat a4)
|
||||
WebGLContext::Uniform4f(WebGLUniformLocation *location_object, GLfloat a1,
|
||||
GLfloat a2, GLfloat a3, GLfloat a4)
|
||||
{
|
||||
GLint location;
|
||||
if (!ValidateUniformSetter("Uniform4f", location_object, location))
|
||||
|
@ -2750,7 +2750,7 @@ WebGLContext::Uniform4f(WebGLUniformLocation *location_object, WebGLfloat a1,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform1iv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLint* data)
|
||||
uint32_t arrayLength, const GLint* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2768,7 +2768,7 @@ WebGLContext::Uniform1iv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform2iv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLint* data)
|
||||
uint32_t arrayLength, const GLint* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2789,7 +2789,7 @@ WebGLContext::Uniform2iv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform3iv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLint* data)
|
||||
uint32_t arrayLength, const GLint* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2811,7 +2811,7 @@ WebGLContext::Uniform3iv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform4iv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLint* data)
|
||||
uint32_t arrayLength, const GLint* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2834,7 +2834,7 @@ WebGLContext::Uniform4iv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform1fv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLfloat* data)
|
||||
uint32_t arrayLength, const GLfloat* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2848,7 +2848,7 @@ WebGLContext::Uniform1fv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform2fv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLfloat* data)
|
||||
uint32_t arrayLength, const GLfloat* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2862,7 +2862,7 @@ WebGLContext::Uniform2fv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform3fv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLfloat* data)
|
||||
uint32_t arrayLength, const GLfloat* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2876,7 +2876,7 @@ WebGLContext::Uniform3fv_base(WebGLUniformLocation *location_object,
|
|||
|
||||
void
|
||||
WebGLContext::Uniform4fv_base(WebGLUniformLocation *location_object,
|
||||
uint32_t arrayLength, const WebGLfloat* data)
|
||||
uint32_t arrayLength, const GLfloat* data)
|
||||
{
|
||||
uint32_t numElementsToUpload;
|
||||
GLint location;
|
||||
|
@ -2946,7 +2946,7 @@ WebGLContext::UseProgram(WebGLProgram *prog)
|
|||
|
||||
InvalidateBufferFetching();
|
||||
|
||||
WebGLuint progname = prog ? prog->GLName() : 0;
|
||||
GLuint progname = prog ? prog->GLName() : 0;
|
||||
|
||||
if (prog && !prog->LinkStatus())
|
||||
return ErrorInvalidOperation("useProgram: program was not linked successfully");
|
||||
|
@ -2975,7 +2975,7 @@ WebGLContext::ValidateProgram(WebGLProgram *prog)
|
|||
}
|
||||
#endif
|
||||
|
||||
WebGLuint progname = prog->GLName();
|
||||
GLuint progname = prog->GLName();
|
||||
gl->fValidateProgram(progname);
|
||||
}
|
||||
|
||||
|
@ -2998,7 +2998,7 @@ WebGLContext::CreateRenderbuffer()
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Viewport(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height)
|
||||
WebGLContext::Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -3019,7 +3019,7 @@ WebGLContext::CompileShader(WebGLShader *shader)
|
|||
if (!ValidateObject("compileShader", shader))
|
||||
return;
|
||||
|
||||
WebGLuint shadername = shader->GLName();
|
||||
GLuint shadername = shader->GLName();
|
||||
|
||||
shader->SetCompileStatus(false);
|
||||
|
||||
|
@ -3279,8 +3279,8 @@ WebGLContext::CompileShader(WebGLShader *shader)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CompressedTexImage2D(WebGLenum target, WebGLint level, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height, WebGLint border,
|
||||
WebGLContext::CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
const ArrayBufferView& view)
|
||||
{
|
||||
if (!IsContextStable()) {
|
||||
|
@ -3319,9 +3319,9 @@ WebGLContext::CompressedTexImage2D(WebGLenum target, WebGLint level, WebGLenum i
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::CompressedTexSubImage2D(WebGLenum target, WebGLint level, WebGLint xoffset,
|
||||
WebGLint yoffset, WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, const ArrayBufferView& view)
|
||||
WebGLContext::CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width, GLsizei height,
|
||||
GLenum format, const ArrayBufferView& view)
|
||||
{
|
||||
if (!IsContextStable()) {
|
||||
return;
|
||||
|
@ -3419,7 +3419,7 @@ WebGLContext::CompressedTexSubImage2D(WebGLenum target, WebGLint level, WebGLint
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetShaderParameter(WebGLShader *shader, WebGLenum pname)
|
||||
WebGLContext::GetShaderParameter(WebGLShader *shader, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -3427,7 +3427,7 @@ WebGLContext::GetShaderParameter(WebGLShader *shader, WebGLenum pname)
|
|||
if (!ValidateObject("getShaderParameter: shader", shader))
|
||||
return JS::NullValue();
|
||||
|
||||
WebGLuint shadername = shader->GLName();
|
||||
GLuint shadername = shader->GLName();
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
|
@ -3486,7 +3486,7 @@ WebGLContext::GetShaderInfoLog(WebGLShader *shader, nsACString& retval)
|
|||
|
||||
MakeContextCurrent();
|
||||
|
||||
WebGLuint shadername = shader->GLName();
|
||||
GLuint shadername = shader->GLName();
|
||||
GLint k = -1;
|
||||
gl->fGetShaderiv(shadername, LOCAL_GL_INFO_LOG_LENGTH, &k);
|
||||
if (k == -1) {
|
||||
|
@ -3505,7 +3505,7 @@ WebGLContext::GetShaderInfoLog(WebGLShader *shader, nsACString& retval)
|
|||
}
|
||||
|
||||
already_AddRefed<WebGLShaderPrecisionFormat>
|
||||
WebGLContext::GetShaderPrecisionFormat(WebGLenum shadertype, WebGLenum precisiontype)
|
||||
WebGLContext::GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return nullptr;
|
||||
|
@ -3626,10 +3626,10 @@ GLenum WebGLContext::CheckedTexImage2D(GLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height, WebGLsizei srcStrideOrZero,
|
||||
WebGLint border,
|
||||
WebGLenum format, WebGLenum type,
|
||||
WebGLContext::TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei srcStrideOrZero,
|
||||
GLint border,
|
||||
GLenum format, GLenum type,
|
||||
void *data, uint32_t byteLength,
|
||||
int jsArrayType, // a TypedArray format enum, or -1 if not relevant
|
||||
WebGLTexelFormat srcFormat, bool srcPremultiplied)
|
||||
|
@ -3771,10 +3771,10 @@ WebGLContext::TexImage2D_base(WebGLenum target, WebGLint level, WebGLenum intern
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::TexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLsizei width,
|
||||
WebGLsizei height, WebGLint border, WebGLenum format,
|
||||
WebGLenum type, const Nullable<ArrayBufferView> &pixels, ErrorResult& rv)
|
||||
WebGLContext::TexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLint border, GLenum format,
|
||||
GLenum type, const Nullable<ArrayBufferView> &pixels, ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -3787,9 +3787,9 @@ WebGLContext::TexImage2D(WebGLenum target, WebGLint level,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::TexImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLenum internalformat, WebGLenum format,
|
||||
WebGLenum type, ImageData* pixels, ErrorResult& rv)
|
||||
WebGLContext::TexImage2D(GLenum target, GLint level,
|
||||
GLenum internalformat, GLenum format,
|
||||
GLenum type, ImageData* pixels, ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -3808,10 +3808,10 @@ WebGLContext::TexImage2D(WebGLenum target, WebGLint level,
|
|||
|
||||
|
||||
void
|
||||
WebGLContext::TexSubImage2D_base(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height, WebGLsizei srcStrideOrZero,
|
||||
WebGLenum format, WebGLenum type,
|
||||
WebGLContext::TexSubImage2D_base(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLsizei srcStrideOrZero,
|
||||
GLenum format, GLenum type,
|
||||
void *pixels, uint32_t byteLength,
|
||||
int jsArrayType,
|
||||
WebGLTexelFormat srcFormat, bool srcPremultiplied)
|
||||
|
@ -3920,10 +3920,10 @@ WebGLContext::TexSubImage2D_base(WebGLenum target, WebGLint level,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::TexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type,
|
||||
WebGLContext::TexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type,
|
||||
const Nullable<ArrayBufferView> &pixels,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
|
@ -3941,9 +3941,9 @@ WebGLContext::TexSubImage2D(WebGLenum target, WebGLint level,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::TexSubImage2D(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLenum format, WebGLenum type, ImageData* pixels,
|
||||
WebGLContext::TexSubImage2D(GLenum target, GLint level,
|
||||
GLint xoffset, GLint yoffset,
|
||||
GLenum format, GLenum type, ImageData* pixels,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -3985,7 +3985,7 @@ WebGLContext::RestoreContext()
|
|||
}
|
||||
|
||||
bool
|
||||
BaseTypeAndSizeFromUniformType(WebGLenum uType, WebGLenum *baseType, WebGLint *unitSize)
|
||||
BaseTypeAndSizeFromUniformType(GLenum uType, GLenum *baseType, GLint *unitSize)
|
||||
{
|
||||
switch (uType) {
|
||||
case LOCAL_GL_INT:
|
||||
|
@ -4126,8 +4126,8 @@ WebGLTexelFormat mozilla::GetWebGLTexelFormat(GLenum format, GLenum type)
|
|||
}
|
||||
}
|
||||
|
||||
WebGLenum
|
||||
InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2)
|
||||
GLenum
|
||||
InternalFormatForFormatAndType(GLenum format, GLenum type, bool isGLES2)
|
||||
{
|
||||
// ES2 requires that format == internalformat; floating-point is
|
||||
// indicated purely by the type that's loaded. For desktop GL, we
|
||||
|
@ -4179,7 +4179,7 @@ InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2)
|
|||
|
||||
void
|
||||
WebGLContext::ReattachTextureToAnyFramebufferToWorkAroundBugs(WebGLTexture *tex,
|
||||
WebGLint level)
|
||||
GLint level)
|
||||
{
|
||||
MOZ_ASSERT(tex);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ using namespace mozilla;
|
|||
using namespace dom;
|
||||
|
||||
void
|
||||
WebGLContext::Disable(WebGLenum cap)
|
||||
WebGLContext::Disable(GLenum cap)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -37,7 +37,7 @@ WebGLContext::Disable(WebGLenum cap)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::Enable(WebGLenum cap)
|
||||
WebGLContext::Enable(GLenum cap)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -69,7 +69,7 @@ StringValue(JSContext* cx, const char* chars, ErrorResult& rv)
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetParameter(JSContext* cx, WebGLenum pname, ErrorResult& rv)
|
||||
WebGLContext::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -127,7 +127,7 @@ WebGLContext::GetParameter(JSContext* cx, WebGLenum pname, ErrorResult& rv)
|
|||
return JS::Int32Value(mGLMaxDrawBuffers);
|
||||
}
|
||||
else if (pname >= LOCAL_GL_DRAW_BUFFER0 &&
|
||||
pname < WebGLenum(LOCAL_GL_DRAW_BUFFER0 + mGLMaxDrawBuffers))
|
||||
pname < GLenum(LOCAL_GL_DRAW_BUFFER0 + mGLMaxDrawBuffers))
|
||||
{
|
||||
if (mBoundFramebuffer) {
|
||||
GLint iv = 0;
|
||||
|
@ -484,7 +484,7 @@ WebGLContext::GetParameter(JSContext* cx, WebGLenum pname, ErrorResult& rv)
|
|||
}
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetParameterIndexed(JSContext* cx, WebGLenum pname, WebGLuint index)
|
||||
WebGLContext::GetParameterIndexed(JSContext* cx, GLenum pname, GLuint index)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return JS::NullValue();
|
||||
|
@ -510,7 +510,7 @@ WebGLContext::GetParameterIndexed(JSContext* cx, WebGLenum pname, WebGLuint inde
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::IsEnabled(WebGLenum cap)
|
||||
WebGLContext::IsEnabled(GLenum cap)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return false;
|
||||
|
@ -523,7 +523,7 @@ WebGLContext::IsEnabled(WebGLenum cap)
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::ValidateCapabilityEnum(WebGLenum cap, const char* info)
|
||||
WebGLContext::ValidateCapabilityEnum(GLenum cap, const char* info)
|
||||
{
|
||||
switch (cap) {
|
||||
case LOCAL_GL_BLEND:
|
||||
|
@ -545,7 +545,7 @@ WebGLContext::ValidateCapabilityEnum(WebGLenum cap, const char* info)
|
|||
}
|
||||
|
||||
realGLboolean*
|
||||
WebGLContext::GetStateTrackingSlot(WebGLenum cap)
|
||||
WebGLContext::GetStateTrackingSlot(GLenum cap)
|
||||
{
|
||||
switch (cap) {
|
||||
case LOCAL_GL_SCISSOR_TEST:
|
||||
|
|
|
@ -56,8 +56,8 @@ WebGLContext::GenerateWarning(const char *fmt, va_list ap)
|
|||
}
|
||||
|
||||
CheckedUint32
|
||||
WebGLContext::GetImageSize(WebGLsizei height,
|
||||
WebGLsizei width,
|
||||
WebGLContext::GetImageSize(GLsizei height,
|
||||
GLsizei width,
|
||||
uint32_t pixelSize,
|
||||
uint32_t packOrUnpackAlignment)
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ WebGLContext::GetImageSize(WebGLsizei height,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::SynthesizeGLError(WebGLenum err)
|
||||
WebGLContext::SynthesizeGLError(GLenum err)
|
||||
{
|
||||
// If there is already a pending error, don't overwrite it;
|
||||
// but if there isn't, then we need to check for a gl error
|
||||
|
@ -90,7 +90,7 @@ WebGLContext::SynthesizeGLError(WebGLenum err)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::SynthesizeGLError(WebGLenum err, const char *fmt, ...)
|
||||
WebGLContext::SynthesizeGLError(GLenum err, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, fmt);
|
||||
|
|
|
@ -108,7 +108,7 @@ WebGLProgram::UpdateInfo()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateBlendEquationEnum(WebGLenum mode, const char *info)
|
||||
bool WebGLContext::ValidateBlendEquationEnum(GLenum mode, const char *info)
|
||||
{
|
||||
switch (mode) {
|
||||
case LOCAL_GL_FUNC_ADD:
|
||||
|
@ -130,7 +130,7 @@ bool WebGLContext::ValidateBlendEquationEnum(WebGLenum mode, const char *info)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateBlendFuncDstEnum(WebGLenum factor, const char *info)
|
||||
bool WebGLContext::ValidateBlendFuncDstEnum(GLenum factor, const char *info)
|
||||
{
|
||||
switch (factor) {
|
||||
case LOCAL_GL_ZERO:
|
||||
|
@ -154,7 +154,7 @@ bool WebGLContext::ValidateBlendFuncDstEnum(WebGLenum factor, const char *info)
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateBlendFuncSrcEnum(WebGLenum factor, const char *info)
|
||||
bool WebGLContext::ValidateBlendFuncSrcEnum(GLenum factor, const char *info)
|
||||
{
|
||||
if (factor == LOCAL_GL_SRC_ALPHA_SATURATE)
|
||||
return true;
|
||||
|
@ -162,7 +162,7 @@ bool WebGLContext::ValidateBlendFuncSrcEnum(WebGLenum factor, const char *info)
|
|||
return ValidateBlendFuncDstEnum(factor, info);
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateBlendFuncEnumsCompatibility(WebGLenum sfactor, WebGLenum dfactor, const char *info)
|
||||
bool WebGLContext::ValidateBlendFuncEnumsCompatibility(GLenum sfactor, GLenum dfactor, const char *info)
|
||||
{
|
||||
bool sfactorIsConstantColor = sfactor == LOCAL_GL_CONSTANT_COLOR ||
|
||||
sfactor == LOCAL_GL_ONE_MINUS_CONSTANT_COLOR;
|
||||
|
@ -181,7 +181,7 @@ bool WebGLContext::ValidateBlendFuncEnumsCompatibility(WebGLenum sfactor, WebGLe
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateTextureTargetEnum(WebGLenum target, const char *info)
|
||||
bool WebGLContext::ValidateTextureTargetEnum(GLenum target, const char *info)
|
||||
{
|
||||
switch (target) {
|
||||
case LOCAL_GL_TEXTURE_2D:
|
||||
|
@ -193,7 +193,7 @@ bool WebGLContext::ValidateTextureTargetEnum(WebGLenum target, const char *info)
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateComparisonEnum(WebGLenum target, const char *info)
|
||||
bool WebGLContext::ValidateComparisonEnum(GLenum target, const char *info)
|
||||
{
|
||||
switch (target) {
|
||||
case LOCAL_GL_NEVER:
|
||||
|
@ -211,7 +211,7 @@ bool WebGLContext::ValidateComparisonEnum(WebGLenum target, const char *info)
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateStencilOpEnum(WebGLenum action, const char *info)
|
||||
bool WebGLContext::ValidateStencilOpEnum(GLenum action, const char *info)
|
||||
{
|
||||
switch (action) {
|
||||
case LOCAL_GL_KEEP:
|
||||
|
@ -229,7 +229,7 @@ bool WebGLContext::ValidateStencilOpEnum(WebGLenum action, const char *info)
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateFaceEnum(WebGLenum face, const char *info)
|
||||
bool WebGLContext::ValidateFaceEnum(GLenum face, const char *info)
|
||||
{
|
||||
switch (face) {
|
||||
case LOCAL_GL_FRONT:
|
||||
|
@ -242,7 +242,7 @@ bool WebGLContext::ValidateFaceEnum(WebGLenum face, const char *info)
|
|||
}
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateDrawModeEnum(WebGLenum mode, const char *info)
|
||||
bool WebGLContext::ValidateDrawModeEnum(GLenum mode, const char *info)
|
||||
{
|
||||
switch (mode) {
|
||||
case LOCAL_GL_TRIANGLES:
|
||||
|
@ -300,7 +300,7 @@ bool WebGLContext::ValidateGLSLString(const nsAString& string, const char *info)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateTexImage2DTarget(WebGLenum target, WebGLsizei width, WebGLsizei height,
|
||||
bool WebGLContext::ValidateTexImage2DTarget(GLenum target, GLsizei width, GLsizei height,
|
||||
const char* info)
|
||||
{
|
||||
switch (target) {
|
||||
|
@ -325,9 +325,9 @@ bool WebGLContext::ValidateTexImage2DTarget(WebGLenum target, WebGLsizei width,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateCompressedTextureSize(WebGLenum target, WebGLint level,
|
||||
WebGLenum format,
|
||||
WebGLsizei width, WebGLsizei height, uint32_t byteLength, const char* info)
|
||||
bool WebGLContext::ValidateCompressedTextureSize(GLenum target, GLint level,
|
||||
GLenum format,
|
||||
GLsizei width, GLsizei height, uint32_t byteLength, const char* info)
|
||||
{
|
||||
if (!ValidateLevelWidthHeightForTarget(target, level, width, height, info)) {
|
||||
return false;
|
||||
|
@ -408,17 +408,17 @@ bool WebGLContext::ValidateCompressedTextureSize(WebGLenum target, WebGLint leve
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateLevelWidthHeightForTarget(WebGLenum target, WebGLint level, WebGLsizei width,
|
||||
WebGLsizei height, const char* info)
|
||||
bool WebGLContext::ValidateLevelWidthHeightForTarget(GLenum target, GLint level, GLsizei width,
|
||||
GLsizei height, const char* info)
|
||||
{
|
||||
WebGLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
GLsizei maxTextureSize = MaxTextureSizeForTarget(target);
|
||||
|
||||
if (level < 0) {
|
||||
ErrorInvalidValue("%s: level must be >= 0", info);
|
||||
return false;
|
||||
}
|
||||
|
||||
WebGLsizei maxAllowedSize = maxTextureSize >> level;
|
||||
GLsizei maxAllowedSize = maxTextureSize >> level;
|
||||
|
||||
if (!maxAllowedSize) {
|
||||
ErrorInvalidValue("%s: 2^level exceeds maximum texture size", info);
|
||||
|
@ -438,7 +438,7 @@ bool WebGLContext::ValidateLevelWidthHeightForTarget(WebGLenum target, WebGLint
|
|||
return true;
|
||||
}
|
||||
|
||||
uint32_t WebGLContext::GetBitsPerTexel(WebGLenum format, WebGLenum type)
|
||||
uint32_t WebGLContext::GetBitsPerTexel(GLenum format, GLenum type)
|
||||
{
|
||||
// If there is no defined format or type, we're not taking up any memory
|
||||
if (!format || !type) {
|
||||
|
@ -495,7 +495,7 @@ uint32_t WebGLContext::GetBitsPerTexel(WebGLenum format, WebGLenum type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateTexFormatAndType(WebGLenum format, WebGLenum type, int jsArrayType,
|
||||
bool WebGLContext::ValidateTexFormatAndType(GLenum format, GLenum type, int jsArrayType,
|
||||
uint32_t *texelSize, const char *info)
|
||||
{
|
||||
if (IsExtensionEnabled(WEBGL_depth_texture)) {
|
||||
|
@ -635,7 +635,7 @@ WebGLContext::ValidateUniformLocation(const char* info, WebGLUniformLocation *lo
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::ValidateSamplerUniformSetter(const char* info, WebGLUniformLocation *location, WebGLint value)
|
||||
WebGLContext::ValidateSamplerUniformSetter(const char* info, WebGLUniformLocation *location, GLint value)
|
||||
{
|
||||
if (location->Info().type != SH_SAMPLER_2D &&
|
||||
location->Info().type != SH_SAMPLER_CUBE)
|
||||
|
@ -764,7 +764,7 @@ WebGLContext::ValidateUniformSetter(const char* name, WebGLUniformLocation *loca
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateAttribIndex(WebGLuint index, const char *info)
|
||||
bool WebGLContext::ValidateAttribIndex(GLuint index, const char *info)
|
||||
{
|
||||
return mBoundVertexArray->EnsureAttribIndex(index, info);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace dom;
|
|||
static const int MAX_DRAW_CALLS_SINCE_FLUSH = 100;
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib1f(WebGLuint index, WebGLfloat x0)
|
||||
WebGLContext::VertexAttrib1f(GLuint index, GLfloat x0)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -41,7 +41,7 @@ WebGLContext::VertexAttrib1f(WebGLuint index, WebGLfloat x0)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib2f(WebGLuint index, WebGLfloat x0, WebGLfloat x1)
|
||||
WebGLContext::VertexAttrib2f(GLuint index, GLfloat x0, GLfloat x1)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ WebGLContext::VertexAttrib2f(WebGLuint index, WebGLfloat x0, WebGLfloat x1)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib3f(WebGLuint index, WebGLfloat x0, WebGLfloat x1, WebGLfloat x2)
|
||||
WebGLContext::VertexAttrib3f(GLuint index, GLfloat x0, GLfloat x1, GLfloat x2)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -81,8 +81,8 @@ WebGLContext::VertexAttrib3f(WebGLuint index, WebGLfloat x0, WebGLfloat x1, WebG
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib4f(WebGLuint index, WebGLfloat x0, WebGLfloat x1,
|
||||
WebGLfloat x2, WebGLfloat x3)
|
||||
WebGLContext::VertexAttrib4f(GLuint index, GLfloat x0, GLfloat x1,
|
||||
GLfloat x2, GLfloat x3)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -103,8 +103,8 @@ WebGLContext::VertexAttrib4f(WebGLuint index, WebGLfloat x0, WebGLfloat x1,
|
|||
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib1fv_base(WebGLuint idx, uint32_t arrayLength,
|
||||
const WebGLfloat* ptr)
|
||||
WebGLContext::VertexAttrib1fv_base(GLuint idx, uint32_t arrayLength,
|
||||
const GLfloat* ptr)
|
||||
{
|
||||
if (!ValidateAttribArraySetter("VertexAttrib1fv", 1, arrayLength))
|
||||
return;
|
||||
|
@ -114,17 +114,17 @@ WebGLContext::VertexAttrib1fv_base(WebGLuint idx, uint32_t arrayLength,
|
|||
gl->fVertexAttrib1fv(idx, ptr);
|
||||
} else {
|
||||
mVertexAttrib0Vector[0] = ptr[0];
|
||||
mVertexAttrib0Vector[1] = WebGLfloat(0);
|
||||
mVertexAttrib0Vector[2] = WebGLfloat(0);
|
||||
mVertexAttrib0Vector[3] = WebGLfloat(1);
|
||||
mVertexAttrib0Vector[1] = GLfloat(0);
|
||||
mVertexAttrib0Vector[2] = GLfloat(0);
|
||||
mVertexAttrib0Vector[3] = GLfloat(1);
|
||||
if (gl->IsGLES2())
|
||||
gl->fVertexAttrib1fv(idx, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib2fv_base(WebGLuint idx, uint32_t arrayLength,
|
||||
const WebGLfloat* ptr)
|
||||
WebGLContext::VertexAttrib2fv_base(GLuint idx, uint32_t arrayLength,
|
||||
const GLfloat* ptr)
|
||||
{
|
||||
if (!ValidateAttribArraySetter("VertexAttrib2fv", 2, arrayLength))
|
||||
return;
|
||||
|
@ -135,16 +135,16 @@ WebGLContext::VertexAttrib2fv_base(WebGLuint idx, uint32_t arrayLength,
|
|||
} else {
|
||||
mVertexAttrib0Vector[0] = ptr[0];
|
||||
mVertexAttrib0Vector[1] = ptr[1];
|
||||
mVertexAttrib0Vector[2] = WebGLfloat(0);
|
||||
mVertexAttrib0Vector[3] = WebGLfloat(1);
|
||||
mVertexAttrib0Vector[2] = GLfloat(0);
|
||||
mVertexAttrib0Vector[3] = GLfloat(1);
|
||||
if (gl->IsGLES2())
|
||||
gl->fVertexAttrib2fv(idx, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib3fv_base(WebGLuint idx, uint32_t arrayLength,
|
||||
const WebGLfloat* ptr)
|
||||
WebGLContext::VertexAttrib3fv_base(GLuint idx, uint32_t arrayLength,
|
||||
const GLfloat* ptr)
|
||||
{
|
||||
if (!ValidateAttribArraySetter("VertexAttrib3fv", 3, arrayLength))
|
||||
return;
|
||||
|
@ -156,15 +156,15 @@ WebGLContext::VertexAttrib3fv_base(WebGLuint idx, uint32_t arrayLength,
|
|||
mVertexAttrib0Vector[0] = ptr[0];
|
||||
mVertexAttrib0Vector[1] = ptr[1];
|
||||
mVertexAttrib0Vector[2] = ptr[2];
|
||||
mVertexAttrib0Vector[3] = WebGLfloat(1);
|
||||
mVertexAttrib0Vector[3] = GLfloat(1);
|
||||
if (gl->IsGLES2())
|
||||
gl->fVertexAttrib3fv(idx, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttrib4fv_base(WebGLuint idx, uint32_t arrayLength,
|
||||
const WebGLfloat* ptr)
|
||||
WebGLContext::VertexAttrib4fv_base(GLuint idx, uint32_t arrayLength,
|
||||
const GLfloat* ptr)
|
||||
{
|
||||
if (!ValidateAttribArraySetter("VertexAttrib4fv", 4, arrayLength))
|
||||
return;
|
||||
|
@ -183,7 +183,7 @@ WebGLContext::VertexAttrib4fv_base(WebGLuint idx, uint32_t arrayLength,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::EnableVertexAttribArray(WebGLuint index)
|
||||
WebGLContext::EnableVertexAttribArray(GLuint index)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -199,7 +199,7 @@ WebGLContext::EnableVertexAttribArray(WebGLuint index)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DisableVertexAttribArray(WebGLuint index)
|
||||
WebGLContext::DisableVertexAttribArray(GLuint index)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -218,7 +218,7 @@ WebGLContext::DisableVertexAttribArray(WebGLuint index)
|
|||
|
||||
|
||||
JS::Value
|
||||
WebGLContext::GetVertexAttrib(JSContext* cx, WebGLuint index, WebGLenum pname,
|
||||
WebGLContext::GetVertexAttrib(JSContext* cx, GLuint index, GLenum pname,
|
||||
ErrorResult& rv)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -271,7 +271,7 @@ WebGLContext::GetVertexAttrib(JSContext* cx, WebGLuint index, WebGLenum pname,
|
|||
|
||||
case LOCAL_GL_CURRENT_VERTEX_ATTRIB:
|
||||
{
|
||||
WebGLfloat vec[4] = {0, 0, 0, 1};
|
||||
GLfloat vec[4] = {0, 0, 0, 1};
|
||||
if (index) {
|
||||
gl->fGetVertexAttribfv(index, LOCAL_GL_CURRENT_VERTEX_ATTRIB, &vec[0]);
|
||||
} else {
|
||||
|
@ -307,7 +307,7 @@ WebGLContext::GetVertexAttrib(JSContext* cx, WebGLuint index, WebGLenum pname,
|
|||
}
|
||||
|
||||
WebGLsizeiptr
|
||||
WebGLContext::GetVertexAttribOffset(WebGLuint index, WebGLenum pname)
|
||||
WebGLContext::GetVertexAttribOffset(GLuint index, GLenum pname)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return 0;
|
||||
|
@ -324,8 +324,8 @@ WebGLContext::GetVertexAttribOffset(WebGLuint index, WebGLenum pname)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttribPointer(WebGLuint index, WebGLint size, WebGLenum type,
|
||||
WebGLboolean normalized, WebGLsizei stride,
|
||||
WebGLContext::VertexAttribPointer(GLuint index, GLint size, GLenum type,
|
||||
WebGLboolean normalized, GLsizei stride,
|
||||
WebGLintptr byteOffset)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -334,7 +334,7 @@ WebGLContext::VertexAttribPointer(WebGLuint index, WebGLint size, WebGLenum type
|
|||
if (mBoundArrayBuffer == nullptr)
|
||||
return ErrorInvalidOperation("vertexAttribPointer: must have valid GL_ARRAY_BUFFER binding");
|
||||
|
||||
WebGLsizei requiredAlignment = 1;
|
||||
GLsizei requiredAlignment = 1;
|
||||
switch (type) {
|
||||
case LOCAL_GL_BYTE:
|
||||
case LOCAL_GL_UNSIGNED_BYTE:
|
||||
|
@ -353,7 +353,7 @@ WebGLContext::VertexAttribPointer(WebGLuint index, WebGLint size, WebGLenum type
|
|||
}
|
||||
|
||||
// requiredAlignment should always be a power of two.
|
||||
WebGLsizei requiredAlignmentMask = requiredAlignment - 1;
|
||||
GLsizei requiredAlignmentMask = requiredAlignment - 1;
|
||||
|
||||
if ( !mBoundVertexArray->EnsureAttribIndex(index, "vertexAttribPointer") ) {
|
||||
return;
|
||||
|
@ -403,7 +403,7 @@ WebGLContext::VertexAttribPointer(WebGLuint index, WebGLint size, WebGLenum type
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::VertexAttribDivisor(WebGLuint index, WebGLuint divisor)
|
||||
WebGLContext::VertexAttribDivisor(GLuint index, GLuint divisor)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -422,7 +422,7 @@ WebGLContext::VertexAttribDivisor(WebGLuint index, WebGLuint divisor)
|
|||
gl->fVertexAttribDivisor(index, divisor);
|
||||
}
|
||||
|
||||
bool WebGLContext::DrawArrays_check(WebGLint first, WebGLsizei count, WebGLsizei primcount, const char* info)
|
||||
bool WebGLContext::DrawArrays_check(GLint first, GLsizei count, GLsizei primcount, const char* info)
|
||||
{
|
||||
if (first < 0 || count < 0) {
|
||||
ErrorInvalidValue("%s: negative first or count", info);
|
||||
|
@ -498,7 +498,7 @@ bool WebGLContext::DrawArrays_check(WebGLint first, WebGLsizei count, WebGLsizei
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DrawArrays(GLenum mode, WebGLint first, WebGLsizei count)
|
||||
WebGLContext::DrawArrays(GLenum mode, GLint first, GLsizei count)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -516,7 +516,7 @@ WebGLContext::DrawArrays(GLenum mode, WebGLint first, WebGLsizei count)
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DrawArraysInstanced(GLenum mode, WebGLint first, WebGLsizei count, WebGLsizei primcount)
|
||||
WebGLContext::DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
@ -534,7 +534,7 @@ WebGLContext::DrawArraysInstanced(GLenum mode, WebGLint first, WebGLsizei count,
|
|||
}
|
||||
|
||||
bool
|
||||
WebGLContext::DrawElements_check(WebGLsizei count, WebGLenum type, WebGLintptr byteOffset, WebGLsizei primcount, const char* info)
|
||||
WebGLContext::DrawElements_check(GLsizei count, GLenum type, WebGLintptr byteOffset, GLsizei primcount, const char* info)
|
||||
{
|
||||
if (count < 0 || byteOffset < 0) {
|
||||
ErrorInvalidValue("%s: negative count or offset", info);
|
||||
|
@ -557,7 +557,7 @@ WebGLContext::DrawElements_check(WebGLsizei count, WebGLenum type, WebGLintptr b
|
|||
|
||||
CheckedUint32 checked_byteCount;
|
||||
|
||||
WebGLsizei first = 0;
|
||||
GLsizei first = 0;
|
||||
|
||||
if (type == LOCAL_GL_UNSIGNED_SHORT) {
|
||||
checked_byteCount = 2 * CheckedUint32(count);
|
||||
|
@ -662,7 +662,7 @@ WebGLContext::DrawElements_check(WebGLsizei count, WebGLenum type, WebGLintptr b
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DrawElements(WebGLenum mode, WebGLsizei count, WebGLenum type,
|
||||
WebGLContext::DrawElements(GLenum mode, GLsizei count, GLenum type,
|
||||
WebGLintptr byteOffset)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
|
@ -681,8 +681,8 @@ WebGLContext::DrawElements(WebGLenum mode, WebGLsizei count, WebGLenum type,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLContext::DrawElementsInstanced(WebGLenum mode, WebGLsizei count, WebGLenum type,
|
||||
WebGLintptr byteOffset, WebGLsizei primcount)
|
||||
WebGLContext::DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
||||
WebGLintptr byteOffset, GLsizei primcount)
|
||||
{
|
||||
if (!IsContextStable())
|
||||
return;
|
||||
|
|
|
@ -21,22 +21,22 @@ WebGLExtensionInstancedArrays::~WebGLExtensionInstancedArrays()
|
|||
}
|
||||
|
||||
void
|
||||
WebGLExtensionInstancedArrays::DrawArraysInstancedANGLE(WebGLenum mode, WebGLint first,
|
||||
WebGLsizei count, WebGLsizei primcount)
|
||||
WebGLExtensionInstancedArrays::DrawArraysInstancedANGLE(GLenum mode, GLint first,
|
||||
GLsizei count, GLsizei primcount)
|
||||
{
|
||||
mContext->DrawArraysInstanced(mode, first, count, primcount);
|
||||
}
|
||||
|
||||
void
|
||||
WebGLExtensionInstancedArrays::DrawElementsInstancedANGLE(WebGLenum mode, WebGLsizei count,
|
||||
WebGLenum type, WebGLintptr offset,
|
||||
WebGLsizei primcount)
|
||||
WebGLExtensionInstancedArrays::DrawElementsInstancedANGLE(GLenum mode, GLsizei count,
|
||||
GLenum type, WebGLintptr offset,
|
||||
GLsizei primcount)
|
||||
{
|
||||
mContext->DrawElementsInstanced(mode, count, type, offset, primcount);
|
||||
}
|
||||
|
||||
void
|
||||
WebGLExtensionInstancedArrays::VertexAttribDivisorANGLE(WebGLuint index, WebGLuint divisor)
|
||||
WebGLExtensionInstancedArrays::VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
|
||||
{
|
||||
mContext->VertexAttribDivisor(index, divisor);
|
||||
}
|
||||
|
|
|
@ -196,12 +196,12 @@ public:
|
|||
WebGLExtensionInstancedArrays(WebGLContext* context);
|
||||
virtual ~WebGLExtensionInstancedArrays();
|
||||
|
||||
void DrawArraysInstancedANGLE(WebGLenum mode, WebGLint first,
|
||||
WebGLsizei count, WebGLsizei primcount);
|
||||
void DrawElementsInstancedANGLE(WebGLenum mode, WebGLsizei count,
|
||||
WebGLenum type, WebGLintptr offset,
|
||||
WebGLsizei primcount);
|
||||
void VertexAttribDivisorANGLE(WebGLuint index, WebGLuint divisor);
|
||||
void DrawArraysInstancedANGLE(GLenum mode, GLint first,
|
||||
GLsizei count, GLsizei primcount);
|
||||
void DrawElementsInstancedANGLE(GLenum mode, GLsizei count,
|
||||
GLenum type, WebGLintptr offset,
|
||||
GLsizei primcount);
|
||||
void VertexAttribDivisorANGLE(GLuint index, GLuint divisor);
|
||||
|
||||
static bool IsSupported(const WebGLContext* context);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ WebGLFramebuffer::Attachment::IsDeleteRequested() const {
|
|||
|
||||
bool
|
||||
WebGLFramebuffer::Attachment::HasAlpha() const {
|
||||
WebGLenum format = 0;
|
||||
GLenum format = 0;
|
||||
if (Texture() && Texture()->HasImageInfoAt(mTextureLevel, mTextureCubeMapFace))
|
||||
format = Texture()->ImageInfoAt(mTextureLevel, mTextureCubeMapFace).Format();
|
||||
else if (Renderbuffer())
|
||||
|
@ -57,7 +57,7 @@ WebGLFramebuffer::Attachment::HasAlpha() const {
|
|||
}
|
||||
|
||||
void
|
||||
WebGLFramebuffer::Attachment::SetTexture(WebGLTexture *tex, WebGLint level, WebGLenum face) {
|
||||
WebGLFramebuffer::Attachment::SetTexture(WebGLTexture *tex, GLint level, GLenum face) {
|
||||
mTexturePtr = tex;
|
||||
mRenderbufferPtr = nullptr;
|
||||
mTextureLevel = level;
|
||||
|
@ -101,7 +101,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
|
|||
if (!mTexturePtr->HasImageInfoAt(0, 0))
|
||||
return false;
|
||||
|
||||
WebGLenum format = mTexturePtr->ImageInfoAt(0).Format();
|
||||
GLenum format = mTexturePtr->ImageInfoAt(0).Format();
|
||||
|
||||
if (mAttachmentPoint == LOCAL_GL_DEPTH_ATTACHMENT) {
|
||||
return format == LOCAL_GL_DEPTH_COMPONENT;
|
||||
|
@ -110,7 +110,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
|
|||
return format == LOCAL_GL_DEPTH_STENCIL;
|
||||
}
|
||||
else if (mAttachmentPoint >= LOCAL_GL_COLOR_ATTACHMENT0 &&
|
||||
mAttachmentPoint < WebGLenum(LOCAL_GL_COLOR_ATTACHMENT0 + WebGLContext::sMaxColorAttachments)) {
|
||||
mAttachmentPoint < GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + WebGLContext::sMaxColorAttachments)) {
|
||||
return (format == LOCAL_GL_ALPHA ||
|
||||
format == LOCAL_GL_LUMINANCE ||
|
||||
format == LOCAL_GL_LUMINANCE_ALPHA ||
|
||||
|
@ -121,7 +121,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
|
|||
}
|
||||
|
||||
if (mRenderbufferPtr) {
|
||||
WebGLenum format = mRenderbufferPtr->InternalFormat();
|
||||
GLenum format = mRenderbufferPtr->InternalFormat();
|
||||
|
||||
if (mAttachmentPoint == LOCAL_GL_DEPTH_ATTACHMENT) {
|
||||
return format == LOCAL_GL_DEPTH_COMPONENT16;
|
||||
|
@ -133,7 +133,7 @@ WebGLFramebuffer::Attachment::IsComplete() const {
|
|||
return format == LOCAL_GL_DEPTH_STENCIL;
|
||||
}
|
||||
else if (mAttachmentPoint >= LOCAL_GL_COLOR_ATTACHMENT0 &&
|
||||
mAttachmentPoint < WebGLenum(LOCAL_GL_COLOR_ATTACHMENT0 + WebGLContext::sMaxColorAttachments)) {
|
||||
mAttachmentPoint < GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + WebGLContext::sMaxColorAttachments)) {
|
||||
return (format == LOCAL_GL_RGB565 ||
|
||||
format == LOCAL_GL_RGB5_A1 ||
|
||||
format == LOCAL_GL_RGBA4);
|
||||
|
@ -157,9 +157,9 @@ WebGLFramebuffer::Delete() {
|
|||
}
|
||||
|
||||
void
|
||||
WebGLFramebuffer::FramebufferRenderbuffer(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum rbtarget,
|
||||
WebGLFramebuffer::FramebufferRenderbuffer(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum rbtarget,
|
||||
WebGLRenderbuffer *wrb)
|
||||
{
|
||||
MOZ_ASSERT(mContext->mBoundFramebuffer == this);
|
||||
|
@ -197,10 +197,10 @@ WebGLFramebuffer::FramebufferRenderbuffer(WebGLenum target,
|
|||
}
|
||||
|
||||
mContext->MakeContextCurrent();
|
||||
WebGLuint parambuffername = wrb ? wrb->GLName() : 0;
|
||||
GLuint parambuffername = wrb ? wrb->GLName() : 0;
|
||||
if (attachment == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) {
|
||||
WebGLuint depthbuffername = parambuffername;
|
||||
WebGLuint stencilbuffername = parambuffername;
|
||||
GLuint depthbuffername = parambuffername;
|
||||
GLuint stencilbuffername = parambuffername;
|
||||
if (!parambuffername){
|
||||
depthbuffername = mDepthAttachment.Renderbuffer() ? mDepthAttachment.Renderbuffer()->GLName() : 0;
|
||||
stencilbuffername = mStencilAttachment.Renderbuffer() ? mStencilAttachment.Renderbuffer()->GLName() : 0;
|
||||
|
@ -208,7 +208,7 @@ WebGLFramebuffer::FramebufferRenderbuffer(WebGLenum target,
|
|||
mContext->gl->fFramebufferRenderbuffer(target, LOCAL_GL_DEPTH_ATTACHMENT, rbtarget, depthbuffername);
|
||||
mContext->gl->fFramebufferRenderbuffer(target, LOCAL_GL_STENCIL_ATTACHMENT, rbtarget, stencilbuffername);
|
||||
} else {
|
||||
WebGLuint renderbuffername = parambuffername;
|
||||
GLuint renderbuffername = parambuffername;
|
||||
if(!parambuffername && (attachment == LOCAL_GL_DEPTH_ATTACHMENT || attachment == LOCAL_GL_STENCIL_ATTACHMENT)){
|
||||
renderbuffername = mDepthStencilAttachment.Renderbuffer() ? mDepthStencilAttachment.Renderbuffer()->GLName() : 0;
|
||||
}
|
||||
|
@ -217,11 +217,11 @@ WebGLFramebuffer::FramebufferRenderbuffer(WebGLenum target,
|
|||
}
|
||||
|
||||
void
|
||||
WebGLFramebuffer::FramebufferTexture2D(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum textarget,
|
||||
WebGLFramebuffer::FramebufferTexture2D(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum textarget,
|
||||
WebGLTexture *wtex,
|
||||
WebGLint level)
|
||||
GLint level)
|
||||
{
|
||||
MOZ_ASSERT(mContext->mBoundFramebuffer == this);
|
||||
if (!mContext->ValidateObjectAllowNull("framebufferTexture2D: texture",
|
||||
|
@ -264,10 +264,10 @@ WebGLFramebuffer::FramebufferTexture2D(WebGLenum target,
|
|||
}
|
||||
|
||||
mContext->MakeContextCurrent();
|
||||
WebGLuint paramtexturename = wtex ? wtex->GLName() : 0;
|
||||
GLuint paramtexturename = wtex ? wtex->GLName() : 0;
|
||||
if (attachment == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) {
|
||||
WebGLuint depthtexturename = paramtexturename;
|
||||
WebGLuint stenciltexturename = paramtexturename;
|
||||
GLuint depthtexturename = paramtexturename;
|
||||
GLuint stenciltexturename = paramtexturename;
|
||||
if(!paramtexturename){
|
||||
depthtexturename = mDepthAttachment.Texture() ? mDepthAttachment.Texture()->GLName() : 0;
|
||||
stenciltexturename = mStencilAttachment.Texture() ? mStencilAttachment.Texture()->GLName() : 0;
|
||||
|
@ -275,7 +275,7 @@ WebGLFramebuffer::FramebufferTexture2D(WebGLenum target,
|
|||
mContext->gl->fFramebufferTexture2D(target, LOCAL_GL_DEPTH_ATTACHMENT, textarget, depthtexturename, level);
|
||||
mContext->gl->fFramebufferTexture2D(target, LOCAL_GL_STENCIL_ATTACHMENT, textarget, stenciltexturename, level);
|
||||
} else {
|
||||
WebGLuint texturename = paramtexturename;
|
||||
GLuint texturename = paramtexturename;
|
||||
if(!paramtexturename && (attachment == LOCAL_GL_DEPTH_ATTACHMENT || attachment == LOCAL_GL_STENCIL_ATTACHMENT)){
|
||||
texturename = mDepthStencilAttachment.Texture() ? mDepthStencilAttachment.Texture()->GLName() : 0;
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ WebGLFramebuffer::HasAttachmentsOfMismatchedDimensions() const {
|
|||
}
|
||||
|
||||
const WebGLFramebuffer::Attachment&
|
||||
WebGLFramebuffer::GetAttachment(WebGLenum attachment) const {
|
||||
WebGLFramebuffer::GetAttachment(GLenum attachment) const {
|
||||
if (attachment == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT)
|
||||
return mDepthStencilAttachment;
|
||||
if (attachment == LOCAL_GL_DEPTH_ATTACHMENT)
|
||||
|
@ -420,7 +420,7 @@ WebGLFramebuffer::CheckAndInitializeRenderbuffers()
|
|||
|
||||
mContext->MakeContextCurrent();
|
||||
|
||||
WebGLenum status = mContext->CheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
GLenum status = mContext->CheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE)
|
||||
return false;
|
||||
|
||||
|
@ -471,14 +471,14 @@ WebGLFramebuffer::CheckAndInitializeRenderbuffers()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WebGLFramebuffer::CheckColorAttachementNumber(WebGLenum attachment, const char * functionName) const
|
||||
bool WebGLFramebuffer::CheckColorAttachementNumber(GLenum attachment, const char * functionName) const
|
||||
{
|
||||
const char* const errorFormating = "%s: attachment: invalid enum value 0x%x";
|
||||
|
||||
if (mContext->IsExtensionEnabled(WebGLContext::WEBGL_draw_buffers))
|
||||
{
|
||||
if (attachment < LOCAL_GL_COLOR_ATTACHMENT0 ||
|
||||
attachment > WebGLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mGLMaxColorAttachments))
|
||||
attachment > GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mGLMaxColorAttachments))
|
||||
{
|
||||
mContext->ErrorInvalidEnum(errorFormating, functionName, attachment);
|
||||
return false;
|
||||
|
|
|
@ -35,11 +35,11 @@ public:
|
|||
// deleting a texture or renderbuffer immediately detaches it
|
||||
WebGLRefPtr<WebGLTexture> mTexturePtr;
|
||||
WebGLRefPtr<WebGLRenderbuffer> mRenderbufferPtr;
|
||||
WebGLenum mAttachmentPoint;
|
||||
WebGLint mTextureLevel;
|
||||
WebGLenum mTextureCubeMapFace;
|
||||
GLenum mAttachmentPoint;
|
||||
GLint mTextureLevel;
|
||||
GLenum mTextureCubeMapFace;
|
||||
|
||||
Attachment(WebGLenum aAttachmentPoint = LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
Attachment(GLenum aAttachmentPoint = LOCAL_GL_COLOR_ATTACHMENT0)
|
||||
: mAttachmentPoint(aAttachmentPoint)
|
||||
{}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
bool HasAlpha() const;
|
||||
|
||||
void SetTexture(WebGLTexture *tex, WebGLint level, WebGLenum face);
|
||||
void SetTexture(WebGLTexture *tex, GLint level, GLenum face);
|
||||
void SetRenderbuffer(WebGLRenderbuffer *rb) {
|
||||
mTexturePtr = nullptr;
|
||||
mRenderbufferPtr = rb;
|
||||
|
@ -68,10 +68,10 @@ public:
|
|||
WebGLRenderbuffer *Renderbuffer() {
|
||||
return mRenderbufferPtr;
|
||||
}
|
||||
WebGLint TextureLevel() const {
|
||||
GLint TextureLevel() const {
|
||||
return mTextureLevel;
|
||||
}
|
||||
WebGLenum TextureCubeMapFace() const {
|
||||
GLenum TextureCubeMapFace() const {
|
||||
return mTextureCubeMapFace;
|
||||
}
|
||||
|
||||
|
@ -92,18 +92,18 @@ public:
|
|||
|
||||
bool HasEverBeenBound() { return mHasEverBeenBound; }
|
||||
void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
GLuint GLName() { return mGLName; }
|
||||
|
||||
void FramebufferRenderbuffer(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum rbtarget,
|
||||
void FramebufferRenderbuffer(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum rbtarget,
|
||||
WebGLRenderbuffer *wrb);
|
||||
|
||||
void FramebufferTexture2D(WebGLenum target,
|
||||
WebGLenum attachment,
|
||||
WebGLenum textarget,
|
||||
void FramebufferTexture2D(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum textarget,
|
||||
WebGLTexture *wtex,
|
||||
WebGLint level);
|
||||
GLint level);
|
||||
|
||||
bool HasIncompleteAttachment() const;
|
||||
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
return mDepthStencilAttachment;
|
||||
}
|
||||
|
||||
const Attachment& GetAttachment(WebGLenum attachment) const;
|
||||
const Attachment& GetAttachment(GLenum attachment) const;
|
||||
|
||||
void DetachTexture(const WebGLTexture *tex);
|
||||
|
||||
|
@ -153,9 +153,9 @@ public:
|
|||
|
||||
bool CheckAndInitializeRenderbuffers();
|
||||
|
||||
bool CheckColorAttachementNumber(WebGLenum attachment, const char * functionName) const;
|
||||
bool CheckColorAttachementNumber(GLenum attachment, const char * functionName) const;
|
||||
|
||||
WebGLuint mGLName;
|
||||
GLuint mGLName;
|
||||
bool mHasEverBeenBound;
|
||||
|
||||
void EnsureColorAttachments(size_t colorAttachmentId);
|
||||
|
|
|
@ -280,16 +280,16 @@ public:
|
|||
WebGLRectangleObject()
|
||||
: mWidth(0), mHeight(0) { }
|
||||
|
||||
WebGLRectangleObject(WebGLsizei width, WebGLsizei height)
|
||||
WebGLRectangleObject(GLsizei width, GLsizei height)
|
||||
: mWidth(width), mHeight(height) { }
|
||||
|
||||
WebGLsizei Width() const { return mWidth; }
|
||||
void width(WebGLsizei value) { mWidth = value; }
|
||||
GLsizei Width() const { return mWidth; }
|
||||
void width(GLsizei value) { mWidth = value; }
|
||||
|
||||
WebGLsizei Height() const { return mHeight; }
|
||||
void height(WebGLsizei value) { mHeight = value; }
|
||||
GLsizei Height() const { return mHeight; }
|
||||
void height(GLsizei value) { mHeight = value; }
|
||||
|
||||
void setDimensions(WebGLsizei width, WebGLsizei height) {
|
||||
void setDimensions(GLsizei width, GLsizei height) {
|
||||
mWidth = width;
|
||||
mHeight = height;
|
||||
}
|
||||
|
@ -309,8 +309,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
WebGLsizei mWidth;
|
||||
WebGLsizei mHeight;
|
||||
GLsizei mWidth;
|
||||
GLsizei mHeight;
|
||||
};
|
||||
|
||||
}// namespace mozilla
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
mAttachedShaders.Clear();
|
||||
}
|
||||
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
GLuint GLName() { return mGLName; }
|
||||
const nsTArray<WebGLRefPtr<WebGLShader> >& AttachedShaders() const { return mAttachedShaders; }
|
||||
bool LinkStatus() { return mLinkStatus; }
|
||||
uint32_t Generation() const { return mGeneration.value(); }
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
WebGLuint mGLName;
|
||||
GLuint mGLName;
|
||||
bool mLinkStatus;
|
||||
// attached shaders of the program object
|
||||
nsTArray<WebGLRefPtr<WebGLShader> > mAttachedShaders;
|
||||
|
|
|
@ -80,8 +80,8 @@ private:
|
|||
|
||||
// -------------------------------------------------------------------------
|
||||
// MEMBERS
|
||||
WebGLuint mGLName;
|
||||
WebGLenum mType;
|
||||
GLuint mGLName;
|
||||
GLenum mType;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// FRIENDSHIPS
|
||||
|
|
|
@ -32,16 +32,16 @@ public:
|
|||
|
||||
bool HasEverBeenBound() { return mHasEverBeenBound; }
|
||||
void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
|
||||
WebGLuint GLName() const { return mGLName; }
|
||||
GLuint GLName() const { return mGLName; }
|
||||
|
||||
bool Initialized() const { return mInitialized; }
|
||||
void SetInitialized(bool aInitialized) { mInitialized = aInitialized; }
|
||||
|
||||
WebGLenum InternalFormat() const { return mInternalFormat; }
|
||||
void SetInternalFormat(WebGLenum aInternalFormat) { mInternalFormat = aInternalFormat; }
|
||||
GLenum InternalFormat() const { return mInternalFormat; }
|
||||
void SetInternalFormat(GLenum aInternalFormat) { mInternalFormat = aInternalFormat; }
|
||||
|
||||
WebGLenum InternalFormatForGL() const { return mInternalFormatForGL; }
|
||||
void SetInternalFormatForGL(WebGLenum aInternalFormatForGL) { mInternalFormatForGL = aInternalFormatForGL; }
|
||||
GLenum InternalFormatForGL() const { return mInternalFormatForGL; }
|
||||
void SetInternalFormatForGL(GLenum aInternalFormatForGL) { mInternalFormatForGL = aInternalFormatForGL; }
|
||||
|
||||
int64_t MemoryUsage() const;
|
||||
|
||||
|
@ -57,9 +57,9 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
WebGLuint mGLName;
|
||||
WebGLenum mInternalFormat;
|
||||
WebGLenum mInternalFormatForGL;
|
||||
GLuint mGLName;
|
||||
GLenum mInternalFormat;
|
||||
GLenum mInternalFormatForGL;
|
||||
bool mHasEverBeenBound;
|
||||
bool mInitialized;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ WebGLShader::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope) {
|
|||
return dom::WebGLShaderBinding::Wrap(cx, scope, this);
|
||||
}
|
||||
|
||||
WebGLShader::WebGLShader(WebGLContext *context, WebGLenum stype)
|
||||
WebGLShader::WebGLShader(WebGLContext *context, GLenum stype)
|
||||
: WebGLContextBoundObject(context)
|
||||
, mType(stype)
|
||||
, mNeedsTranslation(true)
|
||||
|
|
|
@ -33,7 +33,7 @@ class WebGLShader MOZ_FINAL
|
|||
friend class WebGLProgram;
|
||||
|
||||
public:
|
||||
WebGLShader(WebGLContext *context, WebGLenum stype);
|
||||
WebGLShader(WebGLContext *context, GLenum stype);
|
||||
|
||||
~WebGLShader() {
|
||||
DeleteOnce();
|
||||
|
@ -41,8 +41,8 @@ public:
|
|||
|
||||
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
WebGLenum ShaderType() { return mType; }
|
||||
GLuint GLName() { return mGLName; }
|
||||
GLenum ShaderType() { return mType; }
|
||||
|
||||
void SetSource(const nsAString& src) {
|
||||
// XXX do some quick gzip here maybe -- getting this will be very rare
|
||||
|
@ -84,8 +84,8 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
WebGLuint mGLName;
|
||||
WebGLenum mType;
|
||||
GLuint mGLName;
|
||||
GLenum mType;
|
||||
nsString mSource;
|
||||
nsCString mTranslationLog; // The translation log should contain only ASCII characters
|
||||
bool mNeedsTranslation;
|
||||
|
|
|
@ -16,7 +16,7 @@ class WebGLShaderPrecisionFormat MOZ_FINAL
|
|||
: public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
WebGLShaderPrecisionFormat(WebGLContext *context, WebGLint rangeMin, WebGLint rangeMax, WebGLint precision) :
|
||||
WebGLShaderPrecisionFormat(WebGLContext *context, GLint rangeMin, GLint rangeMax, GLint precision) :
|
||||
WebGLContextBoundObject(context),
|
||||
mRangeMin(rangeMin),
|
||||
mRangeMax(rangeMax),
|
||||
|
@ -27,22 +27,22 @@ public:
|
|||
JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> scope);
|
||||
|
||||
// WebIDL WebGLShaderPrecisionFormat API
|
||||
WebGLint RangeMin() const {
|
||||
GLint RangeMin() const {
|
||||
return mRangeMin;
|
||||
}
|
||||
WebGLint RangeMax() const {
|
||||
GLint RangeMax() const {
|
||||
return mRangeMax;
|
||||
}
|
||||
WebGLint Precision() const {
|
||||
GLint Precision() const {
|
||||
return mPrecision;
|
||||
}
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(WebGLShaderPrecisionFormat)
|
||||
|
||||
protected:
|
||||
WebGLint mRangeMin;
|
||||
WebGLint mRangeMax;
|
||||
WebGLint mPrecision;
|
||||
GLint mRangeMin;
|
||||
GLint mRangeMax;
|
||||
GLint mPrecision;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -102,7 +102,7 @@ WebGLTexture::SetDontKnowIfNeedFakeBlack() {
|
|||
}
|
||||
|
||||
void
|
||||
WebGLTexture::Bind(WebGLenum aTarget) {
|
||||
WebGLTexture::Bind(GLenum aTarget) {
|
||||
// this function should only be called by bindTexture().
|
||||
// it assumes that the GL context is already current.
|
||||
|
||||
|
@ -135,9 +135,9 @@ WebGLTexture::Bind(WebGLenum aTarget) {
|
|||
}
|
||||
|
||||
void
|
||||
WebGLTexture::SetImageInfo(WebGLenum aTarget, WebGLint aLevel,
|
||||
WebGLsizei aWidth, WebGLsizei aHeight,
|
||||
WebGLenum aFormat, WebGLenum aType)
|
||||
WebGLTexture::SetImageInfo(GLenum aTarget, GLint aLevel,
|
||||
GLsizei aWidth, GLsizei aHeight,
|
||||
GLenum aFormat, GLenum aType)
|
||||
{
|
||||
if ( (aTarget == LOCAL_GL_TEXTURE_2D) != (mTarget == LOCAL_GL_TEXTURE_2D) )
|
||||
return;
|
||||
|
@ -173,11 +173,11 @@ WebGLTexture::SetCustomMipmap() {
|
|||
ImageInfo imageInfo = ImageInfoAt(0, 0);
|
||||
NS_ASSERTION(imageInfo.IsPowerOfTwo(), "this texture is NPOT, so how could GenerateMipmap() ever accept it?");
|
||||
|
||||
WebGLsizei size = std::max(imageInfo.mWidth, imageInfo.mHeight);
|
||||
GLsizei size = std::max(imageInfo.mWidth, imageInfo.mHeight);
|
||||
|
||||
// so, the size is a power of two, let's find its log in base 2.
|
||||
size_t maxLevel = 0;
|
||||
for (WebGLsizei n = size; n > 1; n >>= 1)
|
||||
for (GLsizei n = size; n > 1; n >>= 1)
|
||||
++maxLevel;
|
||||
|
||||
EnsureMaxLevelWithCustomImagesAtLeast(maxLevel);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
namespace mozilla {
|
||||
|
||||
// Zero is not an integer power of two.
|
||||
inline bool is_pot_assuming_nonnegative(WebGLsizei x)
|
||||
inline bool is_pot_assuming_nonnegative(GLsizei x)
|
||||
{
|
||||
return x && (x & (x-1)) == 0;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
bool HasEverBeenBound() { return mHasEverBeenBound; }
|
||||
void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
|
||||
WebGLuint GLName() { return mGLName; }
|
||||
GLuint GLName() { return mGLName; }
|
||||
GLenum Target() const { return mTarget; }
|
||||
|
||||
WebGLContext *GetParentObject() const {
|
||||
|
@ -59,7 +59,7 @@ protected:
|
|||
friend class WebGLFramebuffer;
|
||||
|
||||
bool mHasEverBeenBound;
|
||||
WebGLuint mGLName;
|
||||
GLuint mGLName;
|
||||
|
||||
// we store information about the various images that are part of
|
||||
// this texture (cubemap faces, mipmap levels)
|
||||
|
@ -74,8 +74,8 @@ public:
|
|||
, mIsDefined(false)
|
||||
{}
|
||||
|
||||
ImageInfo(WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type)
|
||||
ImageInfo(GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type)
|
||||
: WebGLRectangleObject(width, height)
|
||||
, mFormat(format)
|
||||
, mType(type)
|
||||
|
@ -103,10 +103,10 @@ public:
|
|||
is_pot_assuming_nonnegative(mHeight); // negative sizes should never happen (caught in texImage2D...)
|
||||
}
|
||||
int64_t MemoryUsage() const;
|
||||
WebGLenum Format() const { return mFormat; }
|
||||
WebGLenum Type() const { return mType; }
|
||||
GLenum Format() const { return mFormat; }
|
||||
GLenum Type() const { return mType; }
|
||||
protected:
|
||||
WebGLenum mFormat, mType;
|
||||
GLenum mFormat, mType;
|
||||
bool mIsDefined;
|
||||
|
||||
friend class WebGLTexture;
|
||||
|
@ -132,7 +132,7 @@ public:
|
|||
ImageInfoAt(level, face).mIsDefined;
|
||||
}
|
||||
|
||||
static size_t FaceForTarget(WebGLenum target) {
|
||||
static size_t FaceForTarget(GLenum target) {
|
||||
return target == LOCAL_GL_TEXTURE_2D ? 0 : target - LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X;
|
||||
}
|
||||
|
||||
|
@ -140,8 +140,8 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
WebGLenum mTarget;
|
||||
WebGLenum mMinFilter, mMagFilter, mWrapS, mWrapT;
|
||||
GLenum mTarget;
|
||||
GLenum mMinFilter, mMagFilter, mWrapS, mWrapT;
|
||||
|
||||
size_t mFacesCount, mMaxLevelWithCustomImages;
|
||||
nsTArray<ImageInfo> mImageInfos;
|
||||
|
@ -170,29 +170,29 @@ public:
|
|||
|
||||
void SetDontKnowIfNeedFakeBlack();
|
||||
|
||||
void Bind(WebGLenum aTarget);
|
||||
void Bind(GLenum aTarget);
|
||||
|
||||
void SetImageInfo(WebGLenum aTarget, WebGLint aLevel,
|
||||
WebGLsizei aWidth, WebGLsizei aHeight,
|
||||
WebGLenum aFormat, WebGLenum aType);
|
||||
void SetImageInfo(GLenum aTarget, GLint aLevel,
|
||||
GLsizei aWidth, GLsizei aHeight,
|
||||
GLenum aFormat, GLenum aType);
|
||||
|
||||
void SetMinFilter(WebGLenum aMinFilter) {
|
||||
void SetMinFilter(GLenum aMinFilter) {
|
||||
mMinFilter = aMinFilter;
|
||||
SetDontKnowIfNeedFakeBlack();
|
||||
}
|
||||
void SetMagFilter(WebGLenum aMagFilter) {
|
||||
void SetMagFilter(GLenum aMagFilter) {
|
||||
mMagFilter = aMagFilter;
|
||||
SetDontKnowIfNeedFakeBlack();
|
||||
}
|
||||
void SetWrapS(WebGLenum aWrapS) {
|
||||
void SetWrapS(GLenum aWrapS) {
|
||||
mWrapS = aWrapS;
|
||||
SetDontKnowIfNeedFakeBlack();
|
||||
}
|
||||
void SetWrapT(WebGLenum aWrapT) {
|
||||
void SetWrapT(GLenum aWrapT) {
|
||||
mWrapT = aWrapT;
|
||||
SetDontKnowIfNeedFakeBlack();
|
||||
}
|
||||
WebGLenum MinFilter() const { return mMinFilter; }
|
||||
GLenum MinFilter() const { return mMinFilter; }
|
||||
|
||||
bool DoesMinFilterRequireMipmap() const {
|
||||
return !(mMinFilter == LOCAL_GL_NEAREST || mMinFilter == LOCAL_GL_LINEAR);
|
||||
|
|
|
@ -6,16 +6,10 @@
|
|||
#ifndef WEBGLTYPES_H_
|
||||
#define WEBGLTYPES_H_
|
||||
|
||||
// Manual reflection of WebIDL typedefs
|
||||
typedef uint32_t WebGLenum;
|
||||
typedef uint32_t WebGLbitfield;
|
||||
typedef int32_t WebGLint;
|
||||
typedef int32_t WebGLsizei;
|
||||
// Manual reflection of WebIDL typedefs that are different from the
|
||||
// corresponding OpenGL typedefs.
|
||||
typedef int64_t WebGLsizeiptr;
|
||||
typedef int64_t WebGLintptr;
|
||||
typedef uint32_t WebGLuint;
|
||||
typedef float WebGLfloat;
|
||||
typedef float WebGLclampf;
|
||||
typedef bool WebGLboolean;
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -36,10 +36,10 @@ void WebGLVertexArray::Delete() {
|
|||
mAttribBuffers.Clear();
|
||||
}
|
||||
|
||||
bool WebGLVertexArray::EnsureAttribIndex(WebGLuint index, const char *info)
|
||||
bool WebGLVertexArray::EnsureAttribIndex(GLuint index, const char *info)
|
||||
{
|
||||
if (index >= WebGLuint(mContext->mGLMaxVertexAttribs)) {
|
||||
if (index == WebGLuint(-1)) {
|
||||
if (index >= GLuint(mContext->mGLMaxVertexAttribs)) {
|
||||
if (index == GLuint(-1)) {
|
||||
mContext->ErrorInvalidValue("%s: index -1 is invalid. That probably comes from a getAttribLocation() call, "
|
||||
"where this return value -1 means that the passed name didn't correspond to an active attribute in "
|
||||
"the specified program.", info);
|
||||
|
|
|
@ -58,9 +58,9 @@ public:
|
|||
|
||||
bool HasEverBeenBound() { return mHasEverBeenBound; }
|
||||
void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
|
||||
WebGLuint GLName() const { return mGLName; }
|
||||
GLuint GLName() const { return mGLName; }
|
||||
|
||||
bool EnsureAttribIndex(WebGLuint index, const char *info);
|
||||
bool EnsureAttribIndex(GLuint index, const char *info);
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -70,7 +70,7 @@ private:
|
|||
// -------------------------------------------------------------------------
|
||||
// MEMBERS
|
||||
|
||||
WebGLuint mGLName;
|
||||
GLuint mGLName;
|
||||
bool mHasEverBeenBound;
|
||||
nsTArray<WebGLVertexAttribData> mAttribBuffers;
|
||||
WebGLRefPtr<WebGLBuffer> mBoundElementArrayBuffer;
|
||||
|
|
|
@ -24,9 +24,9 @@ struct WebGLVertexAttribData {
|
|||
{ }
|
||||
|
||||
WebGLRefPtr<WebGLBuffer> buf;
|
||||
WebGLuint stride;
|
||||
WebGLuint size;
|
||||
WebGLuint divisor;
|
||||
GLuint stride;
|
||||
GLuint size;
|
||||
GLuint divisor;
|
||||
GLuint byteOffset;
|
||||
GLenum type;
|
||||
bool enabled;
|
||||
|
|
Загрузка…
Ссылка в новой задаче