Bug 637040 - Set the correct active texture unit for plugin layers. r=roc a=blocking2.0
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 01 Mar 2011 16:05:20 +1300
changeset 63188 65c1d9309c578332074b200e4c4490f4e3b20705
parent 63187 e47efbba2fef05fe9e0d6e6bc2e7d6ae845b4ec7
child 63189 459f9ea753a2a3149b152a5c7142137542b0b48d
push id19067
push usermwoodrow@mozilla.com
push dateTue, 01 Mar 2011 03:09:37 +0000
treeherdermozilla-central@65c1d9309c57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking2.0
bugs637040
milestone2.0b13pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 637040 - Set the correct active texture unit for plugin layers. r=roc a=blocking2.0
gfx/layers/opengl/ImageLayerOGL.cpp
gfx/layers/opengl/ThebesLayerOGL.cpp
--- a/gfx/layers/opengl/ImageLayerOGL.cpp
+++ b/gfx/layers/opengl/ImageLayerOGL.cpp
@@ -469,16 +469,17 @@ ImageLayerOGL::RenderLayer(int,
        // the plugin IO Surface and make sure we grab the
        // new image
        ioImage->Update(GetContainer());
        image = GetContainer()->GetCurrentImage();
        gl()->MakeCurrent();
        ioImage = static_cast<MacIOSurfaceImageOGL*>(image.get());
      }
      
+     gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
      gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, ioImage->mTexture.GetTextureID());
 
      ColorTextureLayerProgram *program = 
        mOGLManager->GetRGBARectLayerProgram();
      
      program->Activate();
      if (program->GetTexCoordMultiplierUniformLocation() != -1) {
        // 2DRect case, get the multiplier right for a sampler2DRect
--- a/gfx/layers/opengl/ThebesLayerOGL.cpp
+++ b/gfx/layers/opengl/ThebesLayerOGL.cpp
@@ -203,16 +203,17 @@ ThebesLayerBufferOGL::RenderTo(const nsI
 
   // Bind textures.
   gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
   gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexImage->Texture());
 
   if (mTexImageOnWhite) {
     gl()->fActiveTexture(LOCAL_GL_TEXTURE1);
     gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexImageOnWhite->Texture());
+    gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
   }
 
   float xres = mLayer->GetXResolution();
   float yres = mLayer->GetYResolution();
 
   PRInt32 passes = mTexImageOnWhite ? 2 : 1;
   for (PRInt32 pass = 1; pass <= passes; ++pass) {
     LayerProgram *program;