Bug 1012407 - Part 3: Eliminate DrawQuadInternal since we no longer need it (r=Bas)

This commit is contained in:
Andreas Gal 2014-05-21 23:26:38 +02:00
Родитель 013ca12b06
Коммит bab0b9f3d2
2 изменённых файлов: 20 добавлений и 35 удалений

Просмотреть файл

@ -911,7 +911,7 @@ static bool SetBlendMode(GLContext* aGL, gfx::CompositionOp aBlendMode, bool aIs
}
void
CompositorOGL::DrawQuadInternal(const Rect& aRect,
CompositorOGL::DrawQuad(const Rect& aRect,
const Rect& aClipRect,
const EffectChain &aEffectChain,
Float aOpacity,
@ -1461,28 +1461,24 @@ CompositorOGL::QuadVBOTexCoordsAttrib(GLuint aAttribIndex) {
(GLvoid*) QuadVBOTexCoordOffset());
}
void
CompositorOGL::BindAndDrawQuad(GLuint aVertAttribIndex,
GLuint aTexCoordAttribIndex)
{
BindQuadVBO();
QuadVBOVerticesAttrib(aVertAttribIndex);
if (aTexCoordAttribIndex != GLuint(-1)) {
QuadVBOTexCoordsAttrib(aTexCoordAttribIndex);
mGLContext->fEnableVertexAttribArray(aTexCoordAttribIndex);
}
mGLContext->fEnableVertexAttribArray(aVertAttribIndex);
mGLContext->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
}
void
CompositorOGL::BindAndDrawQuad(ShaderProgramOGL *aProg)
{
NS_ASSERTION(aProg->HasInitialized(), "Shader program not correctly initialized");
BindAndDrawQuad(aProg->AttribLocation(ShaderProgramOGL::VertexCoordAttrib),
aProg->AttribLocation(ShaderProgramOGL::TexCoordAttrib));
GLuint vertAttribIndex = aProg->AttribLocation(ShaderProgramOGL::VertexCoordAttrib);
GLuint texCoordAttribIndex = aProg->AttribLocation(ShaderProgramOGL::TexCoordAttrib);
BindQuadVBO();
QuadVBOVerticesAttrib(vertAttribIndex);
if (texCoordAttribIndex != GLuint(-1)) {
QuadVBOTexCoordsAttrib(texCoordAttribIndex);
mGLContext->fEnableVertexAttribArray(texCoordAttribIndex);
}
mGLContext->fEnableVertexAttribArray(vertAttribIndex);
mGLContext->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
}
GLuint

Просмотреть файл

@ -204,10 +204,7 @@ public:
const gfx::Rect& aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE
{
DrawQuadInternal(aRect, aClipRect, aEffectChain, aOpacity, aTransform);
}
const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE;
virtual void EndFrame() MOZ_OVERRIDE;
virtual void SetFBAcquireFence(Layer* aLayer) MOZ_OVERRIDE;
@ -277,12 +274,6 @@ public:
return mProjMatrix;
}
private:
virtual void DrawQuadInternal(const gfx::Rect& aRect,
const gfx::Rect& aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform);
virtual gfx::IntSize GetWidgetSize() const MOZ_OVERRIDE
{
return gfx::ToIntSize(mWidgetSize);
@ -377,8 +368,6 @@ private:
void BindQuadVBO();
void QuadVBOVerticesAttrib(GLuint aAttribIndex);
void QuadVBOTexCoordsAttrib(GLuint aAttribIndex);
void BindAndDrawQuad(GLuint aVertAttribIndex,
GLuint aTexCoordAttribIndex);
void BindAndDrawQuad(ShaderProgramOGL *aProg);
void BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
const gfx3DMatrix& aTextureTransform,