зеркало из 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();
|
||||
}
|
||||
|
||||
ApplyFilter(mFilter);
|
||||
|
||||
program->Activate();
|
||||
program->SetLayerQuadRect(mBounds);
|
||||
program->SetLayerTransform(mTransform);
|
||||
|
|
|
@ -392,10 +392,13 @@ ImageLayerOGL::RenderLayer(int,
|
|||
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
|
||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[0].GetTextureID());
|
||||
ApplyFilter(mFilter);
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE1);
|
||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[1].GetTextureID());
|
||||
ApplyFilter(mFilter);
|
||||
gl()->fActiveTexture(LOCAL_GL_TEXTURE2);
|
||||
gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, yuvImage->mTextures[2].GetTextureID());
|
||||
ApplyFilter(mFilter);
|
||||
|
||||
YCbCrTextureLayerProgram *program = mOGLManager->GetYCbCrLayerProgram();
|
||||
|
||||
|
@ -428,6 +431,8 @@ ImageLayerOGL::RenderLayer(int,
|
|||
else
|
||||
program = mOGLManager->GetBGRALayerProgram();
|
||||
|
||||
ApplyFilter(mFilter);
|
||||
|
||||
program->Activate();
|
||||
program->SetLayerQuadRect(nsIntRect(0, 0,
|
||||
cairoImage->mSize.width,
|
||||
|
|
|
@ -872,5 +872,19 @@ LayerManagerOGL::CreateFBOWithTexture(int aWidth, int aHeight,
|
|||
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 */
|
||||
} /* mozilla */
|
||||
|
|
|
@ -439,6 +439,8 @@ public:
|
|||
typedef mozilla::gl::GLContext GLContext;
|
||||
|
||||
GLContext *gl() const { return mOGLManager->gl(); }
|
||||
|
||||
void ApplyFilter(gfxPattern::GraphicsFilter aFilter);
|
||||
protected:
|
||||
LayerManagerOGL *mOGLManager;
|
||||
PRPackedBool mDestroyed;
|
||||
|
|
Загрузка…
Ссылка в новой задаче