Bug 895116: Use RGBARectProgram in nsChildView r=mattwoodrow

This commit is contained in:
David Zbarsky 2013-07-17 23:54:09 -07:00
parent 04e2cb2e9e
commit ff2b9a1250

View File

@ -327,8 +327,8 @@ public:
virtual GLContext* gl() const MOZ_OVERRIDE { return mGLContext; }
virtual ShaderProgramOGL* GetProgram(ShaderProgramType aType) MOZ_OVERRIDE
{
MOZ_ASSERT(aType == BGRARectLayerProgramType, "unexpected program type");
return mBGRARectProgram;
MOZ_ASSERT(aType == RGBARectLayerProgramType, "unexpected program type");
return mRGBARectProgram;
}
virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) MOZ_OVERRIDE;
@ -343,7 +343,7 @@ public:
protected:
nsRefPtr<mozilla::gl::GLContext> mGLContext;
nsAutoPtr<mozilla::layers::ShaderProgramOGL> mBGRARectProgram;
nsAutoPtr<mozilla::layers::ShaderProgramOGL> mRGBARectProgram;
GLuint mQuadVBO;
};
@ -2603,8 +2603,8 @@ GLPresenter::GLPresenter(GLContext* aContext)
{
mGLContext->SetFlipped(true);
mGLContext->MakeCurrent();
mBGRARectProgram = new ShaderProgramOGL(mGLContext,
ProgramProfileOGL::GetProfileFor(BGRARectLayerProgramType, MaskNone));
mRGBARectProgram = new ShaderProgramOGL(mGLContext,
ProgramProfileOGL::GetProfileFor(RGBARectLayerProgramType, MaskNone));
// Create mQuadVBO.
mGLContext->fGenBuffers(1, &mQuadVBO);
@ -2668,7 +2668,7 @@ GLPresenter::BeginFrame(nsIntSize aRenderSize)
gfx3DMatrix matrix3d = gfx3DMatrix::From2D(viewMatrix);
matrix3d._33 = 0.0f;
mBGRARectProgram->CheckAndSetProjectionMatrix(matrix3d);
mRGBARectProgram->CheckAndSetProjectionMatrix(matrix3d);
// Default blend function implements "OVER"
mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,