зеркало из https://github.com/mozilla/gecko-dev.git
Backing out changeset 1ff04cca465b (bug 956266) due to compilation failures on Android.
This commit is contained in:
Родитель
731751c24b
Коммит
4379a54037
|
@ -5,7 +5,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DecomposeIntoNoRepeatTriangles.h"
|
||||
#include "gfxMatrix.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
@ -15,19 +14,6 @@ RectTriangles::addRect(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
|
|||
GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1,
|
||||
bool flip_y /* = false */)
|
||||
{
|
||||
if (vertexCoords.IsEmpty() &&
|
||||
x0 == 0.0f && y0 == 0.0f && x1 == 1.0f && y1 == 1.0f) {
|
||||
mIsSimpleQuad = true;
|
||||
if (flip_y) {
|
||||
mTextureTransform = gfx3DMatrix::From2D(gfxMatrix(tx1 - tx0, 0, 0, ty0 - ty1, tx0, ty1));
|
||||
} else {
|
||||
mTextureTransform = gfx3DMatrix::From2D(gfxMatrix(tx1 - tx0, 0, 0, ty1 - ty0, tx0, ty0));
|
||||
}
|
||||
} else if (mIsSimpleQuad) {
|
||||
mIsSimpleQuad = false;
|
||||
mTextureTransform = gfx3DMatrix();
|
||||
}
|
||||
|
||||
vert_coord v;
|
||||
v.x = x0; v.y = y0;
|
||||
vertexCoords.AppendElement(v);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "GLTypes.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsTArray.h"
|
||||
#include "gfx3DMatrix.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
@ -19,7 +18,7 @@ namespace gl {
|
|||
*/
|
||||
class RectTriangles {
|
||||
public:
|
||||
RectTriangles() : mIsSimpleQuad(false) { }
|
||||
RectTriangles() { }
|
||||
|
||||
// Always pass texture coordinates upright. If you want to flip the
|
||||
// texture coordinates emitted to the tex_coords array, set flip_y to
|
||||
|
@ -28,16 +27,6 @@ public:
|
|||
GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1,
|
||||
bool flip_y = false);
|
||||
|
||||
// Returns whether this object is made of only one rect that can be drawn
|
||||
// with a pre-buffered unity quad which has 0,0,1,1 as both vertex
|
||||
// positions and texture coordinates.
|
||||
// aOutTextureTransform returns the transform that maps 0,0,1,1 texture
|
||||
// coordinates to the correct ones.
|
||||
bool IsSimpleQuad(gfx3DMatrix& aOutTextureTransform) const {
|
||||
aOutTextureTransform = mTextureTransform;
|
||||
return mIsSimpleQuad;
|
||||
}
|
||||
|
||||
/**
|
||||
* these return a float pointer to the start of each array respectively.
|
||||
* Use it for glVertexAttribPointer calls.
|
||||
|
@ -61,8 +50,6 @@ private:
|
|||
// default is 4 rectangles, each made up of 2 triangles (3 coord vertices each)
|
||||
nsAutoTArray<vert_coord, 6> vertexCoords;
|
||||
nsAutoTArray<tex_coord, 6> texCoords;
|
||||
gfx3DMatrix mTextureTransform;
|
||||
bool mIsSimpleQuad;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -557,9 +557,6 @@ CompositorOGL::Initialize()
|
|||
return true;
|
||||
}
|
||||
|
||||
// |aTextureTransform| is the texture transform that will be set on
|
||||
// aProg, possibly multiplied with another texture transform of our
|
||||
// own.
|
||||
// |aTexCoordRect| is the rectangle from the texture that we want to
|
||||
// draw using the given program. The program already has a necessary
|
||||
// offset and scale, so the geometry that needs to be drawn is a unit
|
||||
|
@ -569,7 +566,6 @@ CompositorOGL::Initialize()
|
|||
// larger than the rectangle given by |aTexCoordRect|.
|
||||
void
|
||||
CompositorOGL::BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
||||
const gfx3DMatrix& aTextureTransform,
|
||||
const Rect& aTexCoordRect,
|
||||
TextureSource *aTexture)
|
||||
{
|
||||
|
@ -626,14 +622,7 @@ CompositorOGL::BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
|||
rects, flipped);
|
||||
}
|
||||
|
||||
gfx3DMatrix textureTransform;
|
||||
if (rects.IsSimpleQuad(textureTransform)) {
|
||||
aProg->SetTextureTransform(aTextureTransform * textureTransform);
|
||||
BindAndDrawQuad(aProg, false);
|
||||
} else {
|
||||
aProg->SetTextureTransform(aTextureTransform);
|
||||
DrawQuads(mGLContext, mVBOs, aProg, rects);
|
||||
}
|
||||
DrawQuads(mGLContext, mVBOs, aProg, rects);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1202,6 +1191,9 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
|
|||
|
||||
AutoBindTexture bindSource(mGLContext, source->AsSourceOGL(), LOCAL_GL_TEXTURE0);
|
||||
|
||||
gfx3DMatrix textureTransform = source->AsSourceOGL()->GetTextureTransform();
|
||||
program->SetTextureTransform(textureTransform);
|
||||
|
||||
GraphicsFilter filter = ThebesFilter(texturedEffect->mFilter);
|
||||
gfxMatrix textureTransform2D;
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
@ -1226,8 +1218,7 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
|
|||
BindMaskForProgram(program, sourceMask, LOCAL_GL_TEXTURE1, maskQuadTransform);
|
||||
}
|
||||
|
||||
BindAndDrawQuadWithTextureRect(program, source->AsSourceOGL()->GetTextureTransform(),
|
||||
texturedEffect->mTextureCoords, source);
|
||||
BindAndDrawQuadWithTextureRect(program, texturedEffect->mTextureCoords, source);
|
||||
|
||||
if (!texturedEffect->mPremultiplied) {
|
||||
mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
|
||||
|
@ -1260,15 +1251,13 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
|
|||
|
||||
program->SetYCbCrTextureUnits(Y, Cb, Cr);
|
||||
program->SetLayerOpacity(aOpacity);
|
||||
program->SetTextureTransform(gfx3DMatrix());
|
||||
|
||||
AutoSaveTexture bindMask(mGLContext, LOCAL_GL_TEXTURE3);
|
||||
if (maskType != MaskNone) {
|
||||
BindMaskForProgram(program, sourceMask, LOCAL_GL_TEXTURE3, maskQuadTransform);
|
||||
}
|
||||
BindAndDrawQuadWithTextureRect(program,
|
||||
gfx3DMatrix(),
|
||||
effectYCbCr->mTextureCoords,
|
||||
sourceYCbCr->GetSubSource(Y));
|
||||
BindAndDrawQuadWithTextureRect(program, effectYCbCr->mTextureCoords, sourceYCbCr->GetSubSource(Y));
|
||||
}
|
||||
break;
|
||||
case EFFECT_RENDER_TARGET: {
|
||||
|
@ -1343,6 +1332,7 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
|
|||
program->SetWhiteTextureUnit(1);
|
||||
program->SetLayerOpacity(aOpacity);
|
||||
program->SetLayerTransform(aTransform);
|
||||
program->SetTextureTransform(gfx3DMatrix());
|
||||
program->SetRenderOffset(offset.x, offset.y);
|
||||
program->SetLayerQuadRect(aRect);
|
||||
AutoSaveTexture bindMask(mGLContext, LOCAL_GL_TEXTURE2);
|
||||
|
@ -1350,10 +1340,7 @@ CompositorOGL::DrawQuadInternal(const Rect& aRect,
|
|||
BindMaskForProgram(program, sourceMask, LOCAL_GL_TEXTURE2, maskQuadTransform);
|
||||
}
|
||||
|
||||
BindAndDrawQuadWithTextureRect(program,
|
||||
gfx3DMatrix(),
|
||||
effectComponentAlpha->mTextureCoords,
|
||||
effectComponentAlpha->mOnBlack);
|
||||
BindAndDrawQuadWithTextureRect(program, effectComponentAlpha->mTextureCoords, effectComponentAlpha->mOnBlack);
|
||||
|
||||
mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
|
||||
LOCAL_GL_ONE, LOCAL_GL_ONE);
|
||||
|
|
|
@ -309,7 +309,6 @@ private:
|
|||
bool aFlipped = false,
|
||||
GLuint aDrawMode = LOCAL_GL_TRIANGLE_STRIP);
|
||||
void BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
||||
const gfx3DMatrix& aTextureTransform,
|
||||
const gfx::Rect& aTexCoordRect,
|
||||
TextureSource *aTexture);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче