mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 15:27:32 +09:00
Issue #2101 - Part 7: Add color range support on GPUs
This commit is contained in:
parent
2b88f2c9ac
commit
687733f9d1
18 changed files with 106 additions and 74 deletions
|
|
@ -158,14 +158,17 @@ struct EffectRGB : public TexturedEffect
|
|||
|
||||
struct EffectYCbCr : public TexturedEffect
|
||||
{
|
||||
EffectYCbCr(TextureSource *aSource, YUVColorSpace aYUVColorSpace, gfx::SamplingFilter aSamplingFilter)
|
||||
EffectYCbCr(TextureSource *aSource, YUVColorSpace aYUVColorSpace, ColorRange aColorRange,
|
||||
gfx::SamplingFilter aSamplingFilter)
|
||||
: TexturedEffect(EffectTypes::YCBCR, aSource, false, aSamplingFilter)
|
||||
, mYUVColorSpace(aYUVColorSpace)
|
||||
, mColorRange(aColorRange)
|
||||
{}
|
||||
|
||||
virtual const char* Name() { return "EffectYCbCr"; }
|
||||
|
||||
YUVColorSpace mYUVColorSpace;
|
||||
ColorRange mColorRange;
|
||||
};
|
||||
|
||||
struct EffectNV12 : public TexturedEffect
|
||||
|
|
@ -271,7 +274,9 @@ CreateTexturedEffect(TextureHost* aHost,
|
|||
RefPtr<TexturedEffect> result;
|
||||
if (aHost->GetReadFormat() == gfx::SurfaceFormat::YUV) {
|
||||
MOZ_ASSERT(aHost->GetYUVColorSpace() != YUVColorSpace::UNKNOWN);
|
||||
result = new EffectYCbCr(aSource, aHost->GetYUVColorSpace(), aSamplingFilter);
|
||||
MOZ_ASSERT(aHost->GetColorRange() != ColorRange::UNKNOWN);
|
||||
result = new EffectYCbCr(aSource, aHost->GetYUVColorSpace(), aHost->GetColorRange(),
|
||||
aSamplingFilter);
|
||||
} else {
|
||||
result = CreateTexturedEffect(aHost->GetReadFormat(),
|
||||
aSource,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue