зеркало из https://github.com/mozilla/pjs.git
Bug 596050 - Set the correct GL minification/magnification filter based on the GraphicsFilter set by content. r=joe a=b
This commit is contained in:
Родитель
b92a9be691
Коммит
26e97d8399
|
@ -254,6 +254,8 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
|
||||||
program = mOGLManager->GetBGRALayerProgram();
|
program = mOGLManager->GetBGRALayerProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApplyFilter(mFilter);
|
||||||
|
|
||||||
program->Activate();
|
program->Activate();
|
||||||
program->SetLayerQuadRect(mBounds);
|
program->SetLayerQuadRect(mBounds);
|
||||||
program->SetLayerTransform(mTransform);
|
program->SetLayerTransform(mTransform);
|
||||||
|
|
|
@ -392,10 +392,13 @@ ImageLayerOGL::RenderLayer(int,
|
||||||
|
|
||||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[0].GetTextureID());
|
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[0].GetTextureID());
|
||||||
|
ApplyFilter(mFilter);
|
||||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE1);
|
gl()->fActiveTexture(LOCAL_GL_TEXTURE1);
|
||||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[1].GetTextureID());
|
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[1].GetTextureID());
|
||||||
|
ApplyFilter(mFilter);
|
||||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE2);
|
gl()->fActiveTexture(LOCAL_GL_TEXTURE2);
|
||||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[2].GetTextureID());
|
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[2].GetTextureID());
|
||||||
|
ApplyFilter(mFilter);
|
||||||
|
|
||||||
YCbCrTextureLayerProgram *program = mOGLManager->GetYCbCrLayerProgram();
|
YCbCrTextureLayerProgram *program = mOGLManager->GetYCbCrLayerProgram();
|
||||||
|
|
||||||
|
@ -428,6 +431,8 @@ ImageLayerOGL::RenderLayer(int,
|
||||||
else
|
else
|
||||||
program = mOGLManager->GetBGRALayerProgram();
|
program = mOGLManager->GetBGRALayerProgram();
|
||||||
|
|
||||||
|
ApplyFilter(mFilter);
|
||||||
|
|
||||||
program->Activate();
|
program->Activate();
|
||||||
program->SetLayerQuadRect(nsIntRect(0, 0,
|
program->SetLayerQuadRect(nsIntRect(0, 0,
|
||||||
cairoImage->mSize.width,
|
cairoImage->mSize.width,
|
||||||
|
|
|
@ -872,5 +872,19 @@ LayerManagerOGL::CreateFBOWithTexture(int aWidth, int aHeight,
|
||||||
DEBUG_GL_ERROR_CHECK(gl());
|
DEBUG_GL_ERROR_CHECK(gl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LayerOGL::ApplyFilter(gfxPattern::GraphicsFilter aFilter)
|
||||||
|
{
|
||||||
|
if (aFilter == gfxPattern::FILTER_NEAREST) {
|
||||||
|
gl()->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_NEAREST);
|
||||||
|
gl()->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_NEAREST);
|
||||||
|
} else {
|
||||||
|
if (aFilter != gfxPattern::FILTER_GOOD) {
|
||||||
|
NS_WARNING("Unsupported filter type!");
|
||||||
|
}
|
||||||
|
gl()->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR);
|
||||||
|
gl()->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} /* layers */
|
} /* layers */
|
||||||
} /* mozilla */
|
} /* mozilla */
|
||||||
|
|
|
@ -439,6 +439,8 @@ public:
|
||||||
typedef mozilla::gl::GLContext GLContext;
|
typedef mozilla::gl::GLContext GLContext;
|
||||||
|
|
||||||
GLContext *gl() const { return mOGLManager->gl(); }
|
GLContext *gl() const { return mOGLManager->gl(); }
|
||||||
|
|
||||||
|
void ApplyFilter(gfxPattern::GraphicsFilter aFilter);
|
||||||
protected:
|
protected:
|
||||||
LayerManagerOGL *mOGLManager;
|
LayerManagerOGL *mOGLManager;
|
||||||
PRPackedBool mDestroyed;
|
PRPackedBool mDestroyed;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче