diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-31 17:59:23 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-05-31 17:59:23 +0000 |
commit | 4d063dea5ee9d5a62e3566a07cb8386cb1a59585 (patch) | |
tree | 162f32b90dedc12b0e2cbb8e5554c9711576e789 /src | |
parent | d4144060731a94a5b057dfad407e6e3c294435cf (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/android/GrGLCreateNativeInterface_android.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCreateNullInterface.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLInterface.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 16 | ||||
-rw-r--r-- | src/gpu/gl/debug/GrGLCreateDebugInterface.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp | 1 | ||||
-rw-r--r-- | src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp | 1 | ||||
-rw-r--r-- | src/gpu/ios/GrGLDefaultInterface_iOS.cpp | 1 |
9 files changed, 13 insertions, 13 deletions
diff --git a/src/gpu/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/android/GrGLCreateNativeInterface_android.cpp index 41bcab8325..327e56d828 100644 --- a/src/gpu/android/GrGLCreateNativeInterface_android.cpp +++ b/src/gpu/android/GrGLCreateNativeInterface_android.cpp @@ -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; diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index d790e06d87..57b7851722 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -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; diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp index a86c143b17..a0078b0ba8 100644 --- a/src/gpu/gl/GrGLInterface.cpp +++ b/src/gpu/gl/GrGLInterface.cpp @@ -88,6 +88,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const { NULL == fStencilOp || NULL == fTexImage2D || NULL == fTexParameteri || + NULL == fTexParameteriv || NULL == fTexSubImage2D || NULL == fUniform1f || NULL == fUniform1i || diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index b465a883f5..8b28c9fb9f 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -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))); } } diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp index 5419bff8d4..4a04a385c9 100644 --- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp +++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp @@ -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; diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp index f05a6efa1f..f34d1ba8f8 100644 --- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp @@ -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 diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp index ddac1593be..28c2931d10 100644 --- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp +++ b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp @@ -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); diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp index d16cb1dc6a..e41edc2653 100644 --- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp @@ -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); diff --git a/src/gpu/ios/GrGLDefaultInterface_iOS.cpp b/src/gpu/ios/GrGLDefaultInterface_iOS.cpp index 8923f6e7fd..19d7ae0726 100644 --- a/src/gpu/ios/GrGLDefaultInterface_iOS.cpp +++ b/src/gpu/ios/GrGLDefaultInterface_iOS.cpp @@ -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; |