Add glTexParameteriv to GL interface
Comitted on behalf of jin.a.yang@intel.com Review URL: http://codereview.appspot.com/6213069/ git-svn-id: http://skia.googlecode.com/svn/trunk@4099 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
d414406073
commit
4d063dea5e
@ -133,6 +133,7 @@ extern "C" {
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTexParameterivProc)(GrGLenum target, GrGLenum pname, const GrGLint* params);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTexStorage2DProc)(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
|
||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLUniform1fProc)(GrGLint location, GrGLfloat v0);
|
||||
|
@ -224,6 +224,7 @@ public:
|
||||
GLPtr<GrGLStencilOpSeparateProc> fStencilOpSeparate;
|
||||
GLPtr<GrGLTexImage2DProc> fTexImage2D;
|
||||
GLPtr<GrGLTexParameteriProc> fTexParameteri;
|
||||
GLPtr<GrGLTexParameterivProc> fTexParameteriv;
|
||||
GLPtr<GrGLTexSubImage2DProc> fTexSubImage2D;
|
||||
GLPtr<GrGLTexStorage2DProc> fTexStorage2D;
|
||||
GLPtr<GrGLUniform1fProc> fUniform1f;
|
||||
|
@ -77,6 +77,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
interface->fStencilOpSeparate = glStencilOpSeparate;
|
||||
interface->fTexImage2D = glTexImage2D;
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
interface->fTexSubImage2D = glTexSubImage2D;
|
||||
#if GL_ARB_texture_storage
|
||||
interface->fTexStorage2D = glTexStorage2D;
|
||||
|
@ -57,6 +57,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE nullGLStencilOp(GrGLenum fail, GrGLenum zfail, GrGL
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLStencilOpSeparate(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLTexImage2D(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLTexParameteri(GrGLenum target, GrGLenum pname, GrGLint param) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLTexParameteriv(GrGLenum target, GrGLenum pname, const GrGLint* params) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLTexStorage2D(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLTexSubImage2D(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE nullGLUniform1f(GrGLint location, GrGLfloat v0) {}
|
||||
@ -456,6 +457,7 @@ const GrGLInterface* GrGLCreateNullInterface() {
|
||||
interface->fStencilOpSeparate = nullGLStencilOpSeparate;
|
||||
interface->fTexImage2D = nullGLTexImage2D;
|
||||
interface->fTexParameteri = nullGLTexParameteri;
|
||||
interface->fTexParameteriv = nullGLTexParameteriv;
|
||||
interface->fTexSubImage2D = nullGLTexSubImage2D;
|
||||
interface->fTexStorage2D = nullGLTexStorage2D;
|
||||
interface->fUniform1f = nullGLUniform1f;
|
||||
|
@ -88,6 +88,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
|
||||
NULL == fStencilOp ||
|
||||
NULL == fTexImage2D ||
|
||||
NULL == fTexParameteri ||
|
||||
NULL == fTexParameteriv ||
|
||||
NULL == fTexSubImage2D ||
|
||||
NULL == fUniform1f ||
|
||||
NULL == fUniform1i ||
|
||||
|
@ -2138,19 +2138,9 @@ inline const GrGLenum* get_swizzle(GrPixelConfig config,
|
||||
}
|
||||
|
||||
void set_tex_swizzle(GrGLenum swizzle[4], const GrGLInterface* gl) {
|
||||
// should add texparameteri to interface to make 1 instead of 4 calls here
|
||||
GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D,
|
||||
GR_GL_TEXTURE_SWIZZLE_R,
|
||||
swizzle[0]));
|
||||
GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D,
|
||||
GR_GL_TEXTURE_SWIZZLE_G,
|
||||
swizzle[1]));
|
||||
GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D,
|
||||
GR_GL_TEXTURE_SWIZZLE_B,
|
||||
swizzle[2]));
|
||||
GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D,
|
||||
GR_GL_TEXTURE_SWIZZLE_A,
|
||||
swizzle[3]));
|
||||
GR_GL_CALL(gl, TexParameteriv(GR_GL_TEXTURE_2D,
|
||||
GR_GL_TEXTURE_SWIZZLE_RGBA,
|
||||
reinterpret_cast<const GrGLint*>(swizzle)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,6 +211,7 @@ GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOp(GrGLenum fail, GrGLenum zfail, GrG
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLStencilOpSeparate(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexImage2D(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteri(GrGLenum target, GrGLenum pname, GrGLint param) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexParameteriv(GrGLenum target, GrGLenum pname, const GrGLint* params) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexStorage2D(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLTexSubImage2D(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels) {}
|
||||
GrGLvoid GR_GL_FUNCTION_TYPE debugGLUniform1f(GrGLint location, GrGLfloat v0) {}
|
||||
@ -989,6 +990,7 @@ const GrGLInterface* GrGLCreateDebugInterface() {
|
||||
interface->fStencilOpSeparate = debugGLStencilOpSeparate;
|
||||
interface->fTexImage2D = debugGLTexImage2D;
|
||||
interface->fTexParameteri = debugGLTexParameteri;
|
||||
interface->fTexParameteriv = debugGLTexParameteriv;
|
||||
interface->fTexSubImage2D = debugGLTexSubImage2D;
|
||||
interface->fTexStorage2D = debugGLTexStorage2D;
|
||||
interface->fUniform1f = debugGLUniform1f;
|
||||
|
@ -136,6 +136,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
// amounts to int vs. uint.
|
||||
interface->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D;
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
#if GL_ARB_texture_storage || GL_VERSION_4_2
|
||||
interface->fTexStorage2D = glTexStorage2D
|
||||
#elif GL_EXT_texture_storage
|
||||
|
@ -131,6 +131,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
GR_GL_GET_PROC(StencilOpSeparate);
|
||||
interface->fTexImage2D = glTexImage2D;
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
if (glVer >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", extString)) {
|
||||
GR_GL_GET_PROC(TexStorage2D);
|
||||
|
@ -88,6 +88,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
||||
interface->fStencilOp = glStencilOp;
|
||||
interface->fTexImage2D = glTexImage2D;
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
if (glVer >= GR_GL_VER(4,2) ||
|
||||
GrGLHasExtensionFromString("GL_ARB_texture_storage", extString)) {
|
||||
GR_GL_GET_PROC(TexStorage2D);
|
||||
|
@ -85,6 +85,7 @@ const GrGLInterface* GrGLDefaultInterface() {
|
||||
interface->fTexStorage2D = glTexStorage2DEXT;
|
||||
#endif
|
||||
interface->fTexParameteri = glTexParameteri;
|
||||
interface->fTexParameteriv = glTexParameteriv;
|
||||
interface->fTexSubImage2D = glTexSubImage2D;
|
||||
interface->fUniform1f = glUniform1f;
|
||||
interface->fUniform1i = glUniform1i;
|
||||
|
Loading…
Reference in New Issue
Block a user