Bug 1210357 - Handle VP9 colorspace BT.709 r=mattwoodrow,bas.schouten

This commit is contained in:
Sotaro Ikeda
2016-10-18 10:09:00 -07:00
parent 46805b751d
commit 1e67b0bbc2
23 changed files with 9930 additions and 9810 deletions

View File

@@ -8,6 +8,7 @@
#include "GLContext.h" // for fast inlines of glUniform*
#include "gfxTypes.h"
#include "ImageTypes.h"
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Pair.h" // for Pair
#include "mozilla/RefPtr.h" // for RefPtr
@@ -81,6 +82,7 @@ public:
SSEdges,
ViewportSize,
VisibleCenter,
YuvColorMatrix,
KnownUniformCount
};
@@ -146,6 +148,7 @@ public:
case 2:
case 3:
case 4:
case 9:
case 16:
if (memcmp(mValue.f16v, fp, sizeof(float) * cnt) != 0) {
memcpy(mValue.f16v, fp, sizeof(float) * cnt);
@@ -154,7 +157,7 @@ public:
return false;
}
NS_NOTREACHED("cnt must be 1 2 3 4 or 16");
NS_NOTREACHED("cnt must be 1 2 3 4 9 or 16");
return false;
}
@@ -476,6 +479,8 @@ public:
SetUniform(KnownUniform::CbCrTexCoordMultiplier, 2, f);
}
void SetYUVColorSpace(YUVColorSpace aYUVColorSpace);
// Set whether we want the component alpha shader to return the color
// vector (pass 1, false) or the alpha vector (pass2, true). With support
// for multiple render targets we wouldn't need two passes here.
@@ -595,6 +600,16 @@ protected:
}
}
void SetMatrix3fvUniform(KnownUniform::KnownUniformName aKnownUniform, const float *aFloatValues) {
ASSERT_THIS_PROGRAM;
NS_ASSERTION(aKnownUniform >= 0 && aKnownUniform < KnownUniform::KnownUniformCount, "Invalid known uniform");
KnownUniform& ku(mProfile.mUniforms[aKnownUniform]);
if (ku.UpdateUniform(9, aFloatValues)) {
mGL->fUniformMatrix3fv(ku.mLocation, 1, false, ku.mValue.f16v);
}
}
void SetMatrixUniform(KnownUniform::KnownUniformName aKnownUniform, const gfx::Matrix4x4& aMatrix) {
SetMatrixUniform(aKnownUniform, &aMatrix._11);
}