Index: frameworks/av/libvideoeditor/lvpp/NativeWindowRenderer.cpp =================================================================== --- frameworks.orig/av/libvideoeditor/lvpp/NativeWindowRenderer.cpp 2015-05-26 18:02:30.000000000 +1200 +++ frameworks/av/libvideoeditor/lvpp/NativeWindowRenderer.cpp 2015-07-03 14:37:44.000000000 +1200 @@ -165,7 +165,7 @@ render(mThreadRenderInput); break; case CMD_RESERVE_TEXTURE: - glBindTexture(GL_TEXTURE_EXTERNAL_OES, mThreadTextureId); + glBindTexture(GL_TEXTURE_2D, mThreadTextureId); CHECK_GL_ERROR; break; case CMD_DELETE_TEXTURE: @@ -360,15 +360,15 @@ glUniformMatrix4fv(mTexMatrixHandle, 1, GL_FALSE, texMatrix); CHECK_GL_ERROR; - glBindTexture(GL_TEXTURE_EXTERNAL_OES, input->mTextureId); + glBindTexture(GL_TEXTURE_2D, input->mTextureId); CHECK_GL_ERROR; - glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri( - GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri( - GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); CHECK_GL_ERROR; glDrawArrays(GL_TRIANGLE_FAN, 0, 4); Index: frameworks/native/cmds/flatland/Composers.cpp =================================================================== --- frameworks.orig/native/cmds/flatland/Composers.cpp 2015-05-26 18:03:41.000000000 +1200 +++ frameworks/native/cmds/flatland/Composers.cpp 2015-07-03 14:39:08.000000000 +1200 @@ -81,7 +81,7 @@ glUniform4fv(mModColorUniformLoc, 1, modColor); glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, texName); + glBindTexture(GL_TEXTURE_2D, texName); glUniform1i(mBlitSrcSamplerLoc, 0); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); Index: frameworks/native/cmds/flatland/GLHelper.cpp =================================================================== --- frameworks.orig/native/cmds/flatland/GLHelper.cpp 2015-05-26 18:03:41.000000000 +1200 +++ frameworks/native/cmds/flatland/GLHelper.cpp 2015-07-03 14:39:23.000000000 +1200 @@ -200,7 +200,7 @@ sp* glConsumer, EGLSurface* surface) { sp bq = new BufferQueue(true, mGraphicBufferAlloc); sp glc = new GLConsumer(name, true, - GL_TEXTURE_EXTERNAL_OES, false, bq); + GL_TEXTURE_2D, false, bq); glc->setDefaultBufferSize(w, h); glc->setDefaultMaxBufferCount(3); glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER); Index: frameworks/native/services/surfaceflinger/Layer.cpp =================================================================== --- frameworks.orig/native/services/surfaceflinger/Layer.cpp 2015-06-30 18:03:55.000000000 +1200 +++ frameworks/native/services/surfaceflinger/Layer.cpp 2015-07-03 14:41:16.000000000 +1200 @@ -110,7 +110,7 @@ // Creates a custom BufferQueue for SurfaceFlingerConsumer to use sp bq = new SurfaceTextureLayer(mFlinger); mSurfaceFlingerConsumer = new SurfaceFlingerConsumer(mTextureName, true, - GL_TEXTURE_EXTERNAL_OES, false, bq); + GL_TEXTURE_2D, false, bq); mSurfaceFlingerConsumer->setConsumerUsageBits(getEffectiveUsage(0)); mSurfaceFlingerConsumer->setFrameAvailableListener(this); @@ -494,30 +494,27 @@ mSurfaceFlingerConsumer->getTransformMatrix(textureMatrix); // Set things up for texturing. - glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName); + glBindTexture(GL_TEXTURE_2D, mTextureName); GLenum filter = GL_NEAREST; if (useFiltering) { filter = GL_LINEAR; } - glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, filter); - glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, filter); + glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); glMatrixMode(GL_TEXTURE); glLoadMatrixf(textureMatrix); glMatrixMode(GL_MODELVIEW); - glDisable(GL_TEXTURE_2D); - glEnable(GL_TEXTURE_EXTERNAL_OES); + glEnable(GL_TEXTURE_2D); } else { glBindTexture(GL_TEXTURE_2D, mFlinger->getProtectedTexName()); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); - glDisable(GL_TEXTURE_EXTERNAL_OES); glEnable(GL_TEXTURE_2D); } drawWithOpenGL(hw, clip); - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); } @@ -528,7 +525,6 @@ const uint32_t fbHeight = hw->getHeight(); glColor4f(red,green,blue,alpha); - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); @@ -1135,8 +1131,8 @@ recomputeVisibleRegions = true; } - glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // FIXME: postedRegion should be dirty & bounds const Layer::State& front(drawingState()); Index: frameworks/native/services/surfaceflinger/LayerDim.cpp =================================================================== --- frameworks.orig/native/services/surfaceflinger/LayerDim.cpp 2015-05-26 18:03:41.000000000 +1200 +++ frameworks/native/services/surfaceflinger/LayerDim.cpp 2015-07-03 14:40:35.000000000 +1200 @@ -47,7 +47,6 @@ if (s.alpha>0) { const GLfloat alpha = s.alpha/255.0f; const uint32_t fbHeight = hw->getHeight(); - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); if (s.alpha == 0xFF) { Index: frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp =================================================================== --- frameworks.orig/native/services/surfaceflinger/SurfaceFlinger.cpp 2015-06-29 13:58:39.000000000 +1200 +++ frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp 2015-07-03 14:40:12.000000000 +1200 @@ -803,7 +803,6 @@ doComposeSurfaces(hw, Region(hw->bounds())); // and draw the dirty region - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glColor4f(1, 0, 1, 1); @@ -1658,7 +1657,6 @@ void SurfaceFlinger::drawWormhole(const sp& hw, const Region& region) const { - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glColor4f(0,0,0,0); @@ -2781,7 +2779,6 @@ glDisable(GL_SCISSOR_TEST); glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); - glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); const LayerVector& layers( mDrawingState.layersSortedByZ ); Index: frameworks/native/services/surfaceflinger/SurfaceFlingerConsumer.h =================================================================== --- frameworks.orig/native/services/surfaceflinger/SurfaceFlingerConsumer.h 2015-05-26 18:03:42.000000000 +1200 +++ frameworks/native/services/surfaceflinger/SurfaceFlingerConsumer.h 2015-07-03 14:39:38.000000000 +1200 @@ -28,7 +28,7 @@ class SurfaceFlingerConsumer : public GLConsumer { public: SurfaceFlingerConsumer(GLuint tex, bool allowSynchronousMode = true, - GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true, + GLenum texTarget = GL_TEXTURE_2D, bool useFenceSync = true, const sp &bufferQueue = 0) : GLConsumer(tex, allowSynchronousMode, texTarget, useFenceSync, bufferQueue) Index: frameworks/rs/driver/rsdShader.cpp =================================================================== --- frameworks.orig/rs/driver/rsdShader.cpp 2015-05-26 18:03:47.000000000 +1200 +++ frameworks/rs/driver/rsdShader.cpp 2015-07-03 14:38:40.000000000 +1200 @@ -81,12 +81,7 @@ for (uint32_t ct = 0; ct < mRSProgram->mHal.state.texturesCount; ct ++) { uint32_t texType = 0; if (mRSProgram->mHal.state.textureTargets[ct] == RS_TEXTURE_2D) { - Allocation *a = mRSProgram->mHal.state.textures[ct]; - if (a && a->mHal.state.surfaceTextureID) { - texType = GL_TEXTURE_EXTERNAL_OES; - } else { - texType = GL_TEXTURE_2D; - } + texType = GL_TEXTURE_2D; } else { texType = GL_TEXTURE_CUBE_MAP; } Index: frameworks/base/libs/hwui/OpenGLRenderer.h =================================================================== --- frameworks.orig/base/libs/hwui/OpenGLRenderer.h 2015-05-26 18:03:12.000000000 +1200 +++ frameworks/base/libs/hwui/OpenGLRenderer.h 2015-07-03 14:47:10.000000000 +1200 @@ -876,7 +876,7 @@ * prior to calling this method. */ inline void bindExternalTexture(GLuint texture) { - glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture); + glBindTexture(GL_TEXTURE_2D, texture); } /** Index: frameworks/base/media/mca/filterfw/native/core/gl_frame.cpp =================================================================== --- frameworks.orig/base/media/mca/filterfw/native/core/gl_frame.cpp 2015-05-26 18:03:12.000000000 +1200 +++ frameworks/base/media/mca/filterfw/native/core/gl_frame.cpp 2015-07-03 14:43:40.000000000 +1200 @@ -78,7 +78,7 @@ } bool GLFrame::InitWithExternalTexture() { - texture_target_ = GL_TEXTURE_EXTERNAL_OES; + texture_target_ = GL_TEXTURE_2D; width_ = 0; height_ = 0; return GenerateTextureName(); Index: frameworks/base/media/tests/MediaDump/src/com/android/mediadump/VideoDumpView.java =================================================================== --- frameworks.orig/base/media/tests/MediaDump/src/com/android/mediadump/VideoDumpView.java 2015-05-26 18:03:13.000000000 +1200 +++ frameworks/base/media/tests/MediaDump/src/com/android/mediadump/VideoDumpView.java 2015-07-03 14:44:54.000000000 +1200 @@ -393,7 +393,7 @@ // Activate the texture. GLES20.glActiveTexture(GLES20.GL_TEXTURE0); - GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureID); // Load the vertexes coordinates. Simple here since it only draw a rectangle // that fits the whole screen. @@ -553,18 +553,18 @@ GLES20.glGenTextures(1, textures, 0); mTextureID = textures[0]; - GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureID); checkGlError("glBindTexture mTextureID"); // Can't do mipmapping with mediaplayer source - GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); - GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); // Clamp to edge is the only option - GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); - GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); checkGlError("glTexParameteri mTextureID"); Index: frameworks/base/services/java/com/android/server/power/ElectronBeam.java =================================================================== --- frameworks.orig/base/services/java/com/android/server/power/ElectronBeam.java 2015-05-26 18:03:30.000000000 +1200 +++ frameworks/base/services/java/com/android/server/power/ElectronBeam.java 2015-07-03 14:46:42.000000000 +1200 @@ -267,22 +267,20 @@ GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY); // set-up texturing - GLES10.glDisable(GLES10.GL_TEXTURE_2D); - GLES10.glEnable(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); + GLES10.glEnable(GLES10.GL_TEXTURE_2D); // bind texture and set blending for drawing planes - GLES10.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTexNames[0]); + GLES10.glBindTexture(GLES10.GL_TEXTURE_2D, mTexNames[0]); GLES10.glTexEnvx(GLES10.GL_TEXTURE_ENV, GLES10.GL_TEXTURE_ENV_MODE, mMode == MODE_WARM_UP ? GLES10.GL_MODULATE : GLES10.GL_REPLACE); - GLES10.glTexParameterx(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MAG_FILTER, GLES10.GL_LINEAR); - GLES10.glTexParameterx(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_MIN_FILTER, GLES10.GL_LINEAR); - GLES10.glTexParameterx(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_WRAP_S, GLES10.GL_CLAMP_TO_EDGE); - GLES10.glTexParameterx(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, + GLES10.glTexParameterx(GLES10.GL_TEXTURE_2D, GLES10.GL_TEXTURE_WRAP_T, GLES10.GL_CLAMP_TO_EDGE); - GLES10.glEnable(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); GLES10.glTexCoordPointer(2, GLES10.GL_FLOAT, 0, mTexCoordBuffer); GLES10.glEnableClientState(GLES10.GL_TEXTURE_COORD_ARRAY); @@ -302,7 +300,7 @@ GLES10.glDrawArrays(GLES10.GL_TRIANGLE_FAN, 0, 4); // clean up after drawing planes - GLES10.glDisable(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); + GLES10.glDisable(GLES10.GL_TEXTURE_2D); GLES10.glDisableClientState(GLES10.GL_TEXTURE_COORD_ARRAY); GLES10.glColorMask(true, true, true, true); Index: frameworks/native/include/gui/GLConsumer.h =================================================================== --- frameworks.orig/native/include/gui/GLConsumer.h 2015-05-26 18:03:41.000000000 +1200 +++ frameworks/native/include/gui/GLConsumer.h 2015-07-03 14:43:21.000000000 +1200 @@ -86,7 +86,7 @@ // context to another. If such a transfer is not needed there is no // requirement that either of these methods be called. GLConsumer(GLuint tex, bool allowSynchronousMode = true, - GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true, + GLenum texTarget = GL_TEXTURE_2D, bool useFenceSync = true, const sp &bufferQueue = 0); // updateTexImage acquires the most recently queued buffer, and sets the