Bug 728524 - Minor rework for TexImage filter setup. r=bgirard
authorOleg Romashin <romaxa@gmail.com>
Mon, 09 Jul 2012 21:30:14 -0400
changeset 98782 255445a0a851bd6313eae7e96d3b0e9dc3591a2b
parent 98781 552418e64261a15c9c51d691d1306ca61ffe2413
child 98783 153e82923805f4b6e5b48376ca35f656b8d2fe20
push id11644
push userromaxa@gmail.com
push dateTue, 10 Jul 2012 04:41:20 +0000
treeherdermozilla-inbound@6087689a0745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs728524
milestone16.0a1
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 728524 - Minor rework for TexImage filter setup. r=bgirard
gfx/layers/opengl/CanvasLayerOGL.cpp
--- a/gfx/layers/opengl/CanvasLayerOGL.cpp
+++ b/gfx/layers/opengl/CanvasLayerOGL.cpp
@@ -366,41 +366,37 @@ ShadowCanvasLayerOGL::RenderLayer(int aP
                                   const nsIntPoint& aOffset)
 {
   mOGLManager->MakeCurrent();
 
   ShaderProgramOGL *program =
     mOGLManager->GetProgram(mTexImage->GetShaderProgramType(),
                             GetMaskLayer());
 
-
   gfx3DMatrix effectiveTransform = GetEffectiveTransform();
+  gfxPattern::GraphicsFilter filter = mFilter;
 #ifdef ANDROID
   // Bug 691354
   // Using the LINEAR filter we get unexplained artifacts.
   // Use NEAREST when no scaling is required.
   gfxMatrix matrix;
   bool is2D = GetEffectiveTransform().Is2D(&matrix);
   if (is2D && !matrix.HasNonTranslationOrFlip()) {
-    mTexImage->SetFilter(gfxPattern::FILTER_NEAREST);
-  } else {
-    mTexImage->SetFilter(mFilter);
+    filter = gfxPattern::FILTER_NEAREST;
   }
-#else
-  mTexImage->SetFilter(mFilter);
 #endif
 
-
   program->Activate();
   program->SetLayerTransform(effectiveTransform);
   program->SetLayerOpacity(GetEffectiveOpacity());
   program->SetRenderOffset(aOffset);
   program->SetTextureUnit(0);
   program->LoadMask(GetMaskLayer());
 
+  mTexImage->SetFilter(filter);
   mTexImage->BeginTileIteration();
   if (gl()->CanUploadNonPowerOfTwo()) {
     do {
       TextureImage::ScopedBindTextureAndApplyFilter texBind(mTexImage, LOCAL_GL_TEXTURE0);
       program->SetLayerQuadRect(mTexImage->GetTileRect());
       mOGLManager->BindAndDrawQuad(program, mNeedsYFlip); // FIXME flip order of tiles?
     } while (mTexImage->NextTile());
   } else {