Bug 728524 - Minor rework for TexImage filter setup. r=bgirard

This commit is contained in:
Oleg Romashin 2012-07-15 11:11:05 -04:00
parent 319610caaa
commit e6fc0043e3

View File

@ -376,8 +376,8 @@ ShadowCanvasLayerOGL::RenderLayer(int aPreviousFrameBuffer,
mOGLManager->GetProgram(mTexImage->GetShaderProgramType(),
GetMaskLayer());
gfx3DMatrix effectiveTransform = GetEffectiveTransform();
gfxPattern::GraphicsFilter filter = mFilter;
#ifdef ANDROID
// Bug 691354
// Using the LINEAR filter we get unexplained artifacts.
@ -385,15 +385,10 @@ ShadowCanvasLayerOGL::RenderLayer(int aPreviousFrameBuffer,
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());
@ -401,6 +396,7 @@ ShadowCanvasLayerOGL::RenderLayer(int aPreviousFrameBuffer,
program->SetTextureUnit(0);
program->LoadMask(GetMaskLayer());
mTexImage->SetFilter(filter);
mTexImage->BeginTileIteration();
if (gl()->CanUploadNonPowerOfTwo()) {
do {