Bug 1280499 - Add stubs and forwards. - r=ethlin

MozReview-Commit-ID: BZUAGCjnINM
This commit is contained in:
Jeff Gilbert 2016-07-07 13:02:00 -07:00
Родитель 4d20164c66
Коммит 3b7adaea8f
2 изменённых файлов: 170 добавлений и 2 удалений

Просмотреть файл

@ -122,10 +122,10 @@ public:
template<class T>
inline void
TexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset, GLint zOffset,
GLenum unpackFormat, GLenum unpackType, T& elem, ErrorResult& out_rv)
GLenum unpackFormat, GLenum unpackType, T& any, ErrorResult& out_rv)
{
TexSubImage3D(target, level, xOffset, yOffset, zOffset, unpackFormat, unpackType,
&elem, &out_rv);
&any, &out_rv);
}
void CopyTexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset,
@ -140,6 +140,64 @@ public:
GLsizei depth, GLenum sizedUnpackFormat,
const dom::ArrayBufferView& data);
////////////////
// Texture PBOs
void TexImage2D(GLenum texImageTarget, GLint level, GLenum internalFormat,
GLsizei width, GLsizei height, GLint border, GLenum unpackFormat,
GLenum unpackType, WebGLsizeiptr offset, ErrorResult&);
void TexSubImage2D(GLenum texImageTarget, GLint level, GLint xOffset, GLint yOffset,
GLsizei width, GLsizei height, GLenum unpackFormat,
GLenum unpackType, WebGLsizeiptr offset, ErrorResult&);
void TexImage3D(GLenum target, GLint level, GLenum internalFormat, GLsizei width,
GLsizei height, GLsizei depth, GLint border, GLenum unpackFormat,
GLenum unpackType, WebGLsizeiptr offset);
void TexSubImage3D(GLenum target, GLint level, GLint xOffset, GLint yOffset,
GLint zOffset, GLsizei width, GLsizei height, GLsizei depth,
GLenum unpackFormat, GLenum unpackType, WebGLsizeiptr offset,
ErrorResult&);
////////////////
// WebGL1 overloads
void
TexImage2D(GLenum texImageTarget, GLint level, GLenum internalFormat, GLsizei width,
GLsizei height, GLint border, GLenum unpackFormat, GLenum unpackType,
const dom::Nullable<dom::ArrayBufferView>& pixels, ErrorResult& out_rv)
{
WebGLContext::TexImage2D(texImageTarget, level, internalFormat, width, height,
border, unpackFormat, unpackType, pixels, out_rv);
}
template<typename T>
void
TexImage2D(GLenum texImageTarget, GLint level, GLenum internalFormat,
GLenum unpackFormat, GLenum unpackType, T& any, ErrorResult& out_rv)
{
WebGLContext::TexImage2D(texImageTarget, level, internalFormat, unpackFormat,
unpackType, any, out_rv);
}
void
TexSubImage2D(GLenum texImageTarget, GLint level, GLint xOffset, GLint yOffset,
GLsizei width, GLsizei height, GLenum unpackFormat, GLenum unpackType,
const dom::Nullable<dom::ArrayBufferView>& pixels, ErrorResult& out_rv)
{
WebGLContext::TexSubImage2D(texImageTarget, level, xOffset, yOffset, width,
height, unpackFormat, unpackType, pixels, out_rv);
}
template<typename T>
inline void
TexSubImage2D(GLenum texImageTarget, GLint level, GLint xOffset, GLint yOffset,
GLenum unpackFormat, GLenum unpackType, T& any, ErrorResult& out_rv)
{
WebGLContext::TexSubImage2D(texImageTarget, level, xOffset, yOffset, unpackFormat,
unpackType, any, out_rv);
}
// -------------------------------------------------------------------------
// Programs and shaders - WebGL2ContextPrograms.cpp

Просмотреть файл

@ -202,6 +202,116 @@ WebGL2Context::CopyTexSubImage3D(GLenum rawTexImageTarget, GLint level, GLint xO
height);
}
////////////////////
void
WebGL2Context::TexImage2D(GLenum rawTexImageTarget, GLint level, GLenum internalFormat,
GLsizei width, GLsizei height, GLint border,
GLenum unpackFormat, GLenum unpackType, WebGLsizeiptr offset,
ErrorResult&)
{
const char funcName[] = "texImage2D";
const uint8_t funcDims = 2;
TexImageTarget target;
WebGLTexture* tex;
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTexImageTarget, &target,
&tex))
{
return;
}
const bool isSubImage = false;
const GLint xOffset = 0;
const GLint yOffset = 0;
const GLint zOffset = 0;
const GLsizei depth = 1;
tex->TexOrSubImage(isSubImage, funcName, target, level, internalFormat, xOffset,
yOffset, zOffset, width, height, depth, border, unpackFormat,
unpackType, offset);
}
void
WebGL2Context::TexSubImage2D(GLenum rawTexImageTarget, GLint level, GLint xOffset,
GLint yOffset, GLsizei width, GLsizei height,
GLenum unpackFormat, GLenum unpackType, WebGLsizeiptr offset,
ErrorResult&)
{
const char funcName[] = "texSubImage2D";
const uint8_t funcDims = 2;
TexImageTarget target;
WebGLTexture* tex;
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTexImageTarget, &target,
&tex))
{
return;
}
const bool isSubImage = true;
const GLenum internalFormat = 0;
const GLint zOffset = 0;
const GLsizei depth = 1;
const GLint border = 0;
tex->TexOrSubImage(isSubImage, funcName, target, level, internalFormat, xOffset,
yOffset, zOffset, width, height, depth, border, unpackFormat,
unpackType, offset);
}
//////////
void
WebGL2Context::TexImage3D(GLenum rawTexImageTarget, GLint level, GLenum internalFormat,
GLsizei width, GLsizei height, GLsizei depth, GLint border,
GLenum unpackFormat, GLenum unpackType, WebGLsizeiptr offset)
{
const char funcName[] = "texImage3D";
const uint8_t funcDims = 3;
TexImageTarget target;
WebGLTexture* tex;
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTexImageTarget, &target,
&tex))
{
return;
}
const bool isSubImage = false;
const GLint xOffset = 0;
const GLint yOffset = 0;
const GLint zOffset = 0;
tex->TexOrSubImage(isSubImage, funcName, target, level, internalFormat, xOffset,
yOffset, zOffset, width, height, depth, border, unpackFormat,
unpackType, offset);
}
void
WebGL2Context::TexSubImage3D(GLenum rawTexImageTarget, GLint level, GLint xOffset,
GLint yOffset, GLint zOffset, GLsizei width, GLsizei height,
GLsizei depth, GLenum unpackFormat, GLenum unpackType,
WebGLsizeiptr offset, ErrorResult&)
{
const char funcName[] = "texSubImage3D";
const uint8_t funcDims = 3;
TexImageTarget target;
WebGLTexture* tex;
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTexImageTarget, &target,
&tex))
{
return;
}
const bool isSubImage = true;
const GLenum internalFormat = 0;
const GLint border = 0;
tex->TexOrSubImage(isSubImage, funcName, target, level, internalFormat, xOffset,
yOffset, zOffset, width, height, depth, border, unpackFormat,
unpackType, offset);
}
////////////////////
/*virtual*/ bool
WebGL2Context::IsTexParamValid(GLenum pname) const
{