Revert "Fix glActiveTexture invalid parameter bug"

This reverts commit ac3f6d133db03e03dbbd15754d0d342748a81967.

Because somehow, the init is not called and the check failed
everytime.
bug: 27324004

Change-Id: Id667926cf40e94ea666fbec534a4b54277657aea
diff --git a/opengl/shared/OpenglCodecCommon/GLClientState.cpp b/opengl/shared/OpenglCodecCommon/GLClientState.cpp
index c824396..57637ae 100644
--- a/opengl/shared/OpenglCodecCommon/GLClientState.cpp
+++ b/opengl/shared/OpenglCodecCommon/GLClientState.cpp
@@ -65,8 +65,6 @@
     m_tex.textures = NULL;
     m_tex.numTextures = 0;
     m_tex.allocTextures = 0;
-
-    m_num_texture_units = 0;
 }
 
 GLClientState::~GLClientState()
@@ -245,15 +243,10 @@
     return aligned_linesize * height;
 }
 
-void GLClientState::setNumTexture(GLint num)
-{
-    m_num_texture_units = (num>MAX_TEXTURE_UNITS) ? MAX_TEXTURE_UNITS : num;
-}
-
 GLenum GLClientState::setActiveTextureUnit(GLenum texture)
 {
     GLuint unit = texture - GL_TEXTURE0;
-    if (unit >= m_num_texture_units) {
+    if (unit >= MAX_TEXTURE_UNITS) {
         return GL_INVALID_ENUM;
     }
     m_tex.activeUnit = &m_tex.unit[unit];
diff --git a/opengl/shared/OpenglCodecCommon/GLClientState.h b/opengl/shared/OpenglCodecCommon/GLClientState.h
index 9c7cd21..09ee571 100644
--- a/opengl/shared/OpenglCodecCommon/GLClientState.h
+++ b/opengl/shared/OpenglCodecCommon/GLClientState.h
@@ -181,8 +181,6 @@
     // Remove references to the to-be-deleted textures.
     void deleteTextures(GLsizei n, const GLuint* textures);
 
-    void setNumTexture(GLint num);
-
 private:
     PixelStoreState m_pixelStore;
     VertexAttribState *m_states;
@@ -191,7 +189,6 @@
     GLuint m_currentIndexVbo;
     int m_activeTexture;
     GLint m_currentProgram;
-    GLint m_num_texture_units;
 
     bool validLocation(int location) { return (location >= 0 && location < m_nLocations); }
 
diff --git a/opengl/system/GLESv1/gl.cpp b/opengl/system/GLESv1/gl.cpp
index e8524ec..8aaf347 100644
--- a/opengl/system/GLESv1/gl.cpp
+++ b/opengl/system/GLESv1/gl.cpp
@@ -144,7 +144,6 @@
     ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
     ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
     ctx->glGetString = &my_glGetString;
-    ctx->init(ctx);
 }
 
 extern "C" {
diff --git a/opengl/system/GLESv1_enc/GLEncoder.cpp b/opengl/system/GLESv1_enc/GLEncoder.cpp
index 6e6583b..ec00fff 100644
--- a/opengl/system/GLESv1_enc/GLEncoder.cpp
+++ b/opengl/system/GLESv1_enc/GLEncoder.cpp
@@ -1015,15 +1015,6 @@
     delete [] m_compressedTextureFormats;
 }
 
-void GLEncoder::init(void *self)
-{
-    GLEncoder* ctx = (GLEncoder*)self;
-    GLClientState* state = ctx->m_state;
-    GLint num;
-    ctx->m_glGetIntegerv_enc(self, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num);
-    state->setNumTexture(num);
-}
-
 size_t GLEncoder::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
 {
     assert(m_state != NULL);
diff --git a/opengl/system/GLESv1_enc/GLEncoder.h b/opengl/system/GLESv1_enc/GLEncoder.h
index b763630..6db318f 100644
--- a/opengl/system/GLESv1_enc/GLEncoder.h
+++ b/opengl/system/GLESv1_enc/GLEncoder.h
@@ -41,7 +41,6 @@
 
     void override2DTextureTarget(GLenum target);
     void restore2DTextureTarget();
-    void init(void *self);
 
 private:
 
diff --git a/opengl/system/GLESv2/gl2.cpp b/opengl/system/GLESv2/gl2.cpp
index abbaaa0..5aaac5f 100644
--- a/opengl/system/GLESv2/gl2.cpp
+++ b/opengl/system/GLESv2/gl2.cpp
@@ -156,7 +156,6 @@
     ctx->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES;
     ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
     ctx->glGetString = &my_glGetString;
-    ctx->init(ctx);
 }
 
 extern "C" {
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp
index 3acd8b8..c367385 100755
--- a/opengl/system/GLESv2_enc/GL2Encoder.cpp
+++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp
@@ -135,15 +135,6 @@
     delete m_compressedTextureFormats;
 }
 
-void GL2Encoder::init(void *self)
-{
-    GL2Encoder* ctx = (GL2Encoder*)self;
-    GLClientState* state = ctx->m_state;
-    GLint num;
-    ctx->m_glGetIntegerv_enc(self, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num);
-    state->setNumTexture(num);
-}
-
 GLenum GL2Encoder::s_glGetError(void * self)
 {
     GL2Encoder *ctx = (GL2Encoder *)self;
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.h b/opengl/system/GLESv2_enc/GL2Encoder.h
index 765ec10..e37eef3 100644
--- a/opengl/system/GLESv2_enc/GL2Encoder.h
+++ b/opengl/system/GLESv2_enc/GL2Encoder.h
@@ -43,7 +43,6 @@
     void override2DTextureTarget(GLenum target);
     void restore2DTextureTarget();
 
-    void init(void *self);
 private:
 
     bool    m_initialized;