mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 15:27:30 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
4ef2722f89
20 changed files with 194 additions and 130 deletions
|
|
@ -232,6 +232,21 @@ AOMDecoder::DoDecode(MediaRawData* aSample)
|
||||||
RESULT_DETAIL("AOM Unknown image format"));
|
RESULT_DETAIL("AOM Unknown image format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (img->mc) {
|
||||||
|
case AOM_CICP_MC_BT_601:
|
||||||
|
b.mYUVColorSpace = YUVColorSpace::BT601;
|
||||||
|
break;
|
||||||
|
case AOM_CICP_MC_BT_709:
|
||||||
|
b.mYUVColorSpace = YUVColorSpace::BT709;
|
||||||
|
break;
|
||||||
|
case AOM_CICP_MC_IDENTITY:
|
||||||
|
b.mYUVColorSpace = YUVColorSpace::IDENTITY;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LOG("Unhandled colorspace %d", img->mc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
RefPtr<VideoData> v =
|
RefPtr<VideoData> v =
|
||||||
VideoData::CreateAndCopyData(mInfo,
|
VideoData::CreateAndCopyData(mInfo,
|
||||||
mImageContainer,
|
mImageContainer,
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,22 @@ VPXDecoder::DoDecode(MediaRawData* aSample)
|
||||||
RESULT_DETAIL("VPX Unknown image format"));
|
RESULT_DETAIL("VPX Unknown image format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b.mYUVColorSpace = [&]() {
|
||||||
|
switch (img->cs) {
|
||||||
|
case VPX_CS_BT_601:
|
||||||
|
case VPX_CS_SMPTE_170:
|
||||||
|
case VPX_CS_SMPTE_240:
|
||||||
|
return YUVColorSpace::BT601;
|
||||||
|
case VPX_CS_BT_709:
|
||||||
|
return YUVColorSpace::BT709;
|
||||||
|
case VPX_CS_SRGB:
|
||||||
|
return YUVColorSpace::IDENTITY;
|
||||||
|
default:
|
||||||
|
LOG("Unhandled colorspace %d", img->cs);
|
||||||
|
return YUVColorSpace::BT601;
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
||||||
RefPtr<VideoData> v =
|
RefPtr<VideoData> v =
|
||||||
VideoData::CreateAndCopyData(mInfo,
|
VideoData::CreateAndCopyData(mInfo,
|
||||||
mImageContainer,
|
mImageContainer,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
|
#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
|
||||||
#define AV_PIX_FMT_YUVJ420P PIX_FMT_YUVJ420P
|
#define AV_PIX_FMT_YUVJ420P PIX_FMT_YUVJ420P
|
||||||
#define AV_PIX_FMT_YUV444P PIX_FMT_YUV444P
|
#define AV_PIX_FMT_YUV444P PIX_FMT_YUV444P
|
||||||
|
#define AV_PIX_FMT_GBRP PIX_FMT_GBRP
|
||||||
#define AV_PIX_FMT_NONE PIX_FMT_NONE
|
#define AV_PIX_FMT_NONE PIX_FMT_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -55,6 +56,9 @@ ChoosePixelFormat(AVCodecContext* aCodecContext, const AVPixelFormat* aFormats)
|
||||||
case AV_PIX_FMT_YUVJ420P:
|
case AV_PIX_FMT_YUVJ420P:
|
||||||
FFMPEG_LOG("Requesting pixel format YUVJ420P.");
|
FFMPEG_LOG("Requesting pixel format YUVJ420P.");
|
||||||
return AV_PIX_FMT_YUVJ420P;
|
return AV_PIX_FMT_YUVJ420P;
|
||||||
|
case AV_PIX_FMT_GBRP:
|
||||||
|
FFMPEG_LOG("Requesting pixel format GBRP.");
|
||||||
|
return AV_PIX_FMT_GBRP;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -360,7 +364,8 @@ FFmpegVideoDecoder<LIBAV_VER>::CreateImage(int64_t aOffset, int64_t aPts,
|
||||||
|
|
||||||
b.mPlanes[0].mWidth = mFrame->width;
|
b.mPlanes[0].mWidth = mFrame->width;
|
||||||
b.mPlanes[0].mHeight = mFrame->height;
|
b.mPlanes[0].mHeight = mFrame->height;
|
||||||
if (mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P) {
|
if (mCodecContext->pix_fmt == AV_PIX_FMT_YUV444P ||
|
||||||
|
mCodecContext->pix_fmt == AV_PIX_FMT_GBRP) {
|
||||||
b.mPlanes[1].mWidth = b.mPlanes[2].mWidth = mFrame->width;
|
b.mPlanes[1].mWidth = b.mPlanes[2].mWidth = mFrame->width;
|
||||||
b.mPlanes[1].mHeight = b.mPlanes[2].mHeight = mFrame->height;
|
b.mPlanes[1].mHeight = b.mPlanes[2].mHeight = mFrame->height;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -376,6 +381,9 @@ FFmpegVideoDecoder<LIBAV_VER>::CreateImage(int64_t aOffset, int64_t aPts,
|
||||||
case AVCOL_SPC_BT470BG:
|
case AVCOL_SPC_BT470BG:
|
||||||
b.mYUVColorSpace = YUVColorSpace::BT601;
|
b.mYUVColorSpace = YUVColorSpace::BT601;
|
||||||
break;
|
break;
|
||||||
|
case AVCOL_SPC_RGB:
|
||||||
|
b.mYUVColorSpace = YUVColorSpace::IDENTITY;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -667,7 +667,7 @@ GLBlitHelper::BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage)
|
||||||
mGL->fUniform2f(mCbCrTexScaleLoc, (float)yuvData->mCbCrSize.width/yuvData->mCbCrStride, 1.0f);
|
mGL->fUniform2f(mCbCrTexScaleLoc, (float)yuvData->mCbCrSize.width/yuvData->mCbCrStride, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float* yuvToRgb = gfxUtils::Get3x3YuvColorMatrix(yuvData->mYUVColorSpace);
|
const float* yuvToRgb = gfxUtils::Get3x3YuvColorMatrix(yuvData->mYUVColorSpace);
|
||||||
mGL->fUniformMatrix3fv(mYuvColorMatrixLoc, 1, 0, yuvToRgb);
|
mGL->fUniformMatrix3fv(mYuvColorMatrixLoc, 1, 0, yuvToRgb);
|
||||||
|
|
||||||
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
|
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ enum class StereoMode {
|
||||||
enum class YUVColorSpace {
|
enum class YUVColorSpace {
|
||||||
BT601,
|
BT601,
|
||||||
BT709,
|
BT709,
|
||||||
|
IDENTITY,
|
||||||
// This represents the unknown format.
|
// This represents the unknown format.
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -886,7 +886,7 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float* yuvToRgb = gfxUtils::Get4x3YuvColorMatrix(ycbcrEffect->mYUVColorSpace);
|
const float* yuvToRgb = gfxUtils::Get4x3YuvColorMatrix(ycbcrEffect->mYUVColorSpace);
|
||||||
memcpy(&mPSConstants.yuvColorMatrix, yuvToRgb, sizeof(mPSConstants.yuvColorMatrix));
|
memcpy(&mPSConstants.yuvColorMatrix, yuvToRgb, sizeof(mPSConstants.yuvColorMatrix));
|
||||||
|
|
||||||
TextureSourceD3D11* sourceY = source->GetSubSource(Y)->AsSourceD3D11();
|
TextureSourceD3D11* sourceY = source->GetSubSource(Y)->AsSourceD3D11();
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ CompositorD3D9::DrawQuad(const gfx::Rect &aRect,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float* yuvToRgb = gfxUtils::Get4x3YuvColorMatrix(ycbcrEffect->mYUVColorSpace);
|
const float* yuvToRgb = gfxUtils::Get4x3YuvColorMatrix(ycbcrEffect->mYUVColorSpace);
|
||||||
d3d9Device->SetPixelShaderConstantF(CBmYuvColorMatrix, yuvToRgb, 3);
|
d3d9Device->SetPixelShaderConstantF(CBmYuvColorMatrix, yuvToRgb, 3);
|
||||||
|
|
||||||
TextureSourceD3D9* sourceY = source->GetSubSource(Y)->AsSourceD3D9();
|
TextureSourceD3D9* sourceY = source->GetSubSource(Y)->AsSourceD3D9();
|
||||||
|
|
|
||||||
|
|
@ -966,7 +966,7 @@ ShaderProgramOGL::SetBlurRadius(float aRX, float aRY)
|
||||||
void
|
void
|
||||||
ShaderProgramOGL::SetYUVColorSpace(YUVColorSpace aYUVColorSpace)
|
ShaderProgramOGL::SetYUVColorSpace(YUVColorSpace aYUVColorSpace)
|
||||||
{
|
{
|
||||||
float* yuvToRgb = gfxUtils::Get3x3YuvColorMatrix(aYUVColorSpace);
|
const float* yuvToRgb = gfxUtils::Get3x3YuvColorMatrix(aYUVColorSpace);
|
||||||
SetMatrix3fvUniform(KnownUniform::YuvColorMatrix, yuvToRgb);
|
SetMatrix3fvUniform(KnownUniform::YuvColorMatrix, yuvToRgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1082,61 +1082,65 @@ gfxUtils::EncodeSourceSurface(SourceSurface* aSurface,
|
||||||
aBinaryOrData, aFile, nullptr);
|
aBinaryOrData, aFile, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* From Rec601:
|
// https://jdashg.github.io/misc/colors/from-coeffs.html
|
||||||
[R] [1.1643835616438356, 0.0, 1.5960267857142858] [ Y - 16]
|
const float kBT601NarrowYCbCrToRGB_RowMajor[16] = {
|
||||||
[G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708] x [Cb - 128]
|
1.16438f, 0.00000f, 1.59603f, -0.87420f, 1.16438f, -0.39176f,
|
||||||
[B] [1.1643835616438356, 2.017232142857143, 8.862867620416422e-17] [Cr - 128]
|
-0.81297f, 0.53167f, 1.16438f, 2.01723f, 0.00000f, -1.08563f,
|
||||||
|
0.00000f, 0.00000f, 0.00000f, 1.00000f};
|
||||||
|
const float kBT709NarrowYCbCrToRGB_RowMajor[16] = {
|
||||||
|
1.16438f, 0.00000f, 1.79274f, -0.97295f, 1.16438f, -0.21325f,
|
||||||
|
-0.53291f, 0.30148f, 1.16438f, 2.11240f, 0.00000f, -1.13340f,
|
||||||
|
0.00000f, 0.00000f, 0.00000f, 1.00000f};
|
||||||
|
const float kIdentityNarrowYCbCrToRGB_RowMajor[16] = {
|
||||||
|
0.00000f, 0.00000f, 1.00000f, 0.00000f, 1.00000f, 0.00000f,
|
||||||
|
0.00000f, 0.00000f, 0.00000f, 1.00000f, 0.00000f, 0.00000f,
|
||||||
|
0.00000f, 0.00000f, 0.00000f, 1.00000f};
|
||||||
|
|
||||||
For [0,1] instead of [0,255], and to 5 places:
|
/* static */ const float*
|
||||||
[R] [1.16438, 0.00000, 1.59603] [ Y - 0.06275]
|
|
||||||
[G] = [1.16438, -0.39176, -0.81297] x [Cb - 0.50196]
|
|
||||||
[B] [1.16438, 2.01723, 0.00000] [Cr - 0.50196]
|
|
||||||
|
|
||||||
From Rec709:
|
|
||||||
[R] [1.1643835616438356, 4.2781193979771426e-17, 1.7927410714285714] [ Y - 16]
|
|
||||||
[G] = [1.1643835616438358, -0.21324861427372963, -0.532909328559444] x [Cb - 128]
|
|
||||||
[B] [1.1643835616438356, 2.1124017857142854, 0.0] [Cr - 128]
|
|
||||||
|
|
||||||
For [0,1] instead of [0,255], and to 5 places:
|
|
||||||
[R] [1.16438, 0.00000, 1.79274] [ Y - 0.06275]
|
|
||||||
[G] = [1.16438, -0.21325, -0.53291] x [Cb - 0.50196]
|
|
||||||
[B] [1.16438, 2.11240, 0.00000] [Cr - 0.50196]
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* static */ float*
|
|
||||||
gfxUtils::Get4x3YuvColorMatrix(YUVColorSpace aYUVColorSpace)
|
gfxUtils::Get4x3YuvColorMatrix(YUVColorSpace aYUVColorSpace)
|
||||||
{
|
{
|
||||||
static const float yuv_to_rgb_rec601[12] = { 1.16438f, 0.0f, 1.59603f, 0.0f,
|
#define X(x) \
|
||||||
1.16438f, -0.39176f, -0.81297f, 0.0f,
|
{ x[0], x[1], x[2], 0.0f, x[4], x[5], x[6], 0.0f, x[8], x[9], x[10], 0.0f }
|
||||||
1.16438f, 2.01723f, 0.0f, 0.0f,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const float yuv_to_rgb_rec709[12] = { 1.16438f, 0.0f, 1.79274f, 0.0f,
|
static const float rec601[12] = X(kBT601NarrowYCbCrToRGB_RowMajor);
|
||||||
1.16438f, -0.21325f, -0.53291f, 0.0f,
|
static const float rec709[12] = X(kBT709NarrowYCbCrToRGB_RowMajor);
|
||||||
1.16438f, 2.11240f, 0.0f, 0.0f,
|
static const float identity[12] = X(kIdentityNarrowYCbCrToRGB_RowMajor);
|
||||||
};
|
|
||||||
|
|
||||||
if (aYUVColorSpace == YUVColorSpace::BT709) {
|
#undef X
|
||||||
return const_cast<float*>(yuv_to_rgb_rec709);
|
|
||||||
} else {
|
switch (aYUVColorSpace) {
|
||||||
return const_cast<float*>(yuv_to_rgb_rec601);
|
case YUVColorSpace::BT601:
|
||||||
|
return rec601;
|
||||||
|
case YUVColorSpace::BT709:
|
||||||
|
return rec709;
|
||||||
|
case YUVColorSpace::IDENTITY:
|
||||||
|
return identity;
|
||||||
|
default:
|
||||||
|
MOZ_CRASH("Bad YUVColorSpace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ float*
|
/* static */ const float*
|
||||||
gfxUtils::Get3x3YuvColorMatrix(YUVColorSpace aYUVColorSpace)
|
gfxUtils::Get3x3YuvColorMatrix(YUVColorSpace aYUVColorSpace)
|
||||||
{
|
{
|
||||||
static const float yuv_to_rgb_rec601[9] = {
|
#define X(x) \
|
||||||
1.16438f, 1.16438f, 1.16438f, 0.0f, -0.39176f, 2.01723f, 1.59603f, -0.81297f, 0.0f,
|
{ x[0], x[4], x[8], x[1], x[5], x[9], x[2], x[6], x[10] }
|
||||||
};
|
|
||||||
static const float yuv_to_rgb_rec709[9] = {
|
|
||||||
1.16438f, 1.16438f, 1.16438f, 0.0f, -0.21325f, 2.11240f, 1.79274f, -0.53291f, 0.0f,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (aYUVColorSpace == YUVColorSpace::BT709) {
|
static const float rec601[9] = X(kBT601NarrowYCbCrToRGB_RowMajor);
|
||||||
return const_cast<float*>(yuv_to_rgb_rec709);
|
static const float rec709[9] = X(kBT709NarrowYCbCrToRGB_RowMajor);
|
||||||
} else {
|
static const float identity[9] = X(kIdentityNarrowYCbCrToRGB_RowMajor);
|
||||||
return const_cast<float*>(yuv_to_rgb_rec601);
|
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
switch (aYUVColorSpace) {
|
||||||
|
case YUVColorSpace::BT601:
|
||||||
|
return rec601;
|
||||||
|
case YUVColorSpace::BT709:
|
||||||
|
return rec709;
|
||||||
|
case YUVColorSpace::IDENTITY:
|
||||||
|
return identity;
|
||||||
|
default:
|
||||||
|
MOZ_CRASH("Bad YUVColorSpace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,9 +139,9 @@ public:
|
||||||
/**
|
/**
|
||||||
* Get array of yuv to rgb conversion matrix.
|
* Get array of yuv to rgb conversion matrix.
|
||||||
*/
|
*/
|
||||||
static float* Get4x3YuvColorMatrix(YUVColorSpace aYUVColorSpace);
|
static const float* Get4x3YuvColorMatrix(YUVColorSpace aYUVColorSpace);
|
||||||
|
|
||||||
static float* Get3x3YuvColorMatrix(YUVColorSpace aYUVColorSpace);
|
static const float* Get3x3YuvColorMatrix(YUVColorSpace aYUVColorSpace);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a copy of aSurface, but having the SurfaceFormat aFormat.
|
* Creates a copy of aSurface, but having the SurfaceFormat aFormat.
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
// Header for low level row functions.
|
// Header for low level row functions.
|
||||||
#include "yuv_row.h"
|
#include "yuv_row.h"
|
||||||
#include "mozilla/SSE.h"
|
#include "mozilla/SSE.h"
|
||||||
|
#include "mozilla/IntegerRange.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
@ -63,6 +64,23 @@ libyuv::FourCC FourCCFromYUVType(YUVType aYUVType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GBRPlanarToARGB(const uint8_t* src_y, int y_pitch,
|
||||||
|
const uint8_t* src_u, int u_pitch,
|
||||||
|
const uint8_t* src_v, int v_pitch,
|
||||||
|
uint8_t* rgb_buf, int rgb_pitch,
|
||||||
|
int pic_width, int pic_height) {
|
||||||
|
// libyuv has no native conversion function for this
|
||||||
|
// fixme: replace with something less awful
|
||||||
|
for (const auto row : MakeRange(pic_height)) {
|
||||||
|
for (const auto col : MakeRange(pic_width)) {
|
||||||
|
rgb_buf[rgb_pitch * row + col * 4 + 0] = src_u[u_pitch * row + col];
|
||||||
|
rgb_buf[rgb_pitch * row + col * 4 + 1] = src_y[y_pitch * row + col];
|
||||||
|
rgb_buf[rgb_pitch * row + col * 4 + 2] = src_v[v_pitch * row + col];
|
||||||
|
rgb_buf[rgb_pitch * row + col * 4 + 3] = 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Convert a frame of YUV to 32 bit ARGB.
|
// Convert a frame of YUV to 32 bit ARGB.
|
||||||
void ConvertYCbCrToRGB32(const uint8* y_buf,
|
void ConvertYCbCrToRGB32(const uint8* y_buf,
|
||||||
const uint8* u_buf,
|
const uint8* u_buf,
|
||||||
|
|
@ -106,12 +124,19 @@ void ConvertYCbCrToRGB32(const uint8* y_buf,
|
||||||
const uint8* src_y = y_buf + y_pitch * pic_y + pic_x;
|
const uint8* src_y = y_buf + y_pitch * pic_y + pic_x;
|
||||||
const uint8* src_u = u_buf + uv_pitch * pic_y + pic_x;
|
const uint8* src_u = u_buf + uv_pitch * pic_y + pic_x;
|
||||||
const uint8* src_v = v_buf + uv_pitch * pic_y + pic_x;
|
const uint8* src_v = v_buf + uv_pitch * pic_y + pic_x;
|
||||||
DebugOnly<int> err = libyuv::I444ToARGB(src_y, y_pitch,
|
if (yuv_color_space == YUVColorSpace::IDENTITY) {
|
||||||
src_u, uv_pitch,
|
// Special case for RGB image
|
||||||
src_v, uv_pitch,
|
GBRPlanarToARGB(src_y, y_pitch, src_u, uv_pitch, src_v, uv_pitch,
|
||||||
rgb_buf, rgb_pitch,
|
rgb_buf, rgb_pitch, pic_width, pic_height);
|
||||||
pic_width, pic_height);
|
return;
|
||||||
MOZ_ASSERT(!err);
|
} else {
|
||||||
|
DebugOnly<int> err = libyuv::I444ToARGB(src_y, y_pitch,
|
||||||
|
src_u, uv_pitch,
|
||||||
|
src_v, uv_pitch,
|
||||||
|
rgb_buf, rgb_pitch,
|
||||||
|
pic_width, pic_height);
|
||||||
|
MOZ_ASSERT(!err);
|
||||||
|
}
|
||||||
} else if (yuv_type == YV16) {
|
} else if (yuv_type == YV16) {
|
||||||
const uint8* src_y = y_buf + y_pitch * pic_y + pic_x;
|
const uint8* src_y = y_buf + y_pitch * pic_y + pic_x;
|
||||||
const uint8* src_u = u_buf + uv_pitch * pic_y + pic_x / 2;
|
const uint8* src_u = u_buf + uv_pitch * pic_y + pic_x / 2;
|
||||||
|
|
@ -301,6 +326,21 @@ void ScaleYCbCrToRGB32(const uint8* y_buf,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (yuv_type == YV24 && yuv_color_space == YUVColorSpace::IDENTITY) {
|
||||||
|
auto buffer = MakeUnique<uint8[]>(source_width * source_height * 4);
|
||||||
|
auto buffer_pitch = source_width * 4;
|
||||||
|
GBRPlanarToARGB(y_buf, y_pitch, u_buf, uv_pitch, v_buf, uv_pitch,
|
||||||
|
buffer.get(), buffer_pitch, source_width, source_height);
|
||||||
|
DebugOnly<int> err =
|
||||||
|
libyuv::ARGBScale(buffer.get(), buffer_pitch,
|
||||||
|
source_width, source_height,
|
||||||
|
rgb_buf, rgb_pitch,
|
||||||
|
width, height,
|
||||||
|
libyuv::kFilterBilinear);
|
||||||
|
MOZ_ASSERT(!err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DebugOnly<int> err =
|
DebugOnly<int> err =
|
||||||
libyuv::YUVToARGBScale(y_buf, y_pitch,
|
libyuv::YUVToARGBScale(y_buf, y_pitch,
|
||||||
u_buf, uv_pitch,
|
u_buf, uv_pitch,
|
||||||
|
|
|
||||||
6
layout/base/crashtests/842114.html
Normal file
6
layout/base/crashtests/842114.html
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<div style="filter: url(#f); display: inline;"><div></div><svg><filter id="f"/></svg></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -438,6 +438,7 @@ load 833604-1.html
|
||||||
load 835056.html
|
load 835056.html
|
||||||
load 836990-1.html
|
load 836990-1.html
|
||||||
load 840480.html
|
load 840480.html
|
||||||
|
load 842114.html
|
||||||
load 847242.html
|
load 847242.html
|
||||||
pref(layers.progressive-paint,false) pref(layers.low-precision-buffer,false) load 852293.html
|
pref(layers.progressive-paint,false) pref(layers.low-precision-buffer,false) load 852293.html
|
||||||
pref(layers.force-active,true) load 859526-1.html
|
pref(layers.force-active,true) load 859526-1.html
|
||||||
|
|
|
||||||
|
|
@ -1378,7 +1378,10 @@ enum class SelectorMatchesFlags : uint8_t {
|
||||||
|
|
||||||
// The selector is part of an argument to a functional pseudo-class or
|
// The selector is part of an argument to a functional pseudo-class or
|
||||||
// pseudo-element.
|
// pseudo-element.
|
||||||
IS_PSEUDO_CLASS_ARGUMENT = 1 << 2
|
IS_PSEUDO_CLASS_ARGUMENT = 1 << 2,
|
||||||
|
|
||||||
|
// The selector should be blocked from matching the :host pseudo-class.
|
||||||
|
IS_HOST_INACCESSIBLE = 1 << 3
|
||||||
};
|
};
|
||||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(SelectorMatchesFlags)
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(SelectorMatchesFlags)
|
||||||
|
|
||||||
|
|
@ -1395,7 +1398,8 @@ static inline bool ActiveHoverQuirkMatches(nsCSSSelector* aSelector,
|
||||||
// flags are unknown).
|
// flags are unknown).
|
||||||
aSelectorFlags & (SelectorMatchesFlags::UNKNOWN |
|
aSelectorFlags & (SelectorMatchesFlags::UNKNOWN |
|
||||||
SelectorMatchesFlags::HAS_PSEUDO_ELEMENT |
|
SelectorMatchesFlags::HAS_PSEUDO_ELEMENT |
|
||||||
SelectorMatchesFlags::IS_PSEUDO_CLASS_ARGUMENT)) {
|
SelectorMatchesFlags::IS_PSEUDO_CLASS_ARGUMENT |
|
||||||
|
SelectorMatchesFlags::IS_HOST_INACCESSIBLE)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1954,17 +1958,17 @@ static bool SelectorMatches(Element* aElement,
|
||||||
// we must be matching only against host pseudo selectors, and the
|
// we must be matching only against host pseudo selectors, and the
|
||||||
// selector's context must be the shadow root (the selector must be
|
// selector's context must be the shadow root (the selector must be
|
||||||
// featureless, the left-most selector, and be in a shadow root
|
// featureless, the left-most selector, and be in a shadow root
|
||||||
// style). The :host selector may also be be functional, with a
|
// style).
|
||||||
// compound selector. If this is the case, then also ensure that the
|
if (!aElement->GetShadowRoot() ||
|
||||||
// host element matches against the compound
|
aSelector->HasFeatureSelectors() ||
|
||||||
// selector.
|
aSelectorFlags & SelectorMatchesFlags::IS_HOST_INACCESSIBLE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// We match automatically if GetParent() and GetShadowRoot() have
|
// The :host selector may also be be functional, with a compound
|
||||||
// the same result iff our selector list is empty. Without special
|
// selector. If this is the case, then also ensure that the host
|
||||||
// casing this ahead of all other selector matching, it fails.
|
// element matches against the compound selector.
|
||||||
// Have not determined the cause.
|
if (!pseudoClass->u.mSelectorList) {
|
||||||
if (!pseudoClass->u.mSelectorList &&
|
|
||||||
aElement->GetParent() == aElement->GetShadowRoot()) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1973,25 +1977,15 @@ static bool SelectorMatches(Element* aElement,
|
||||||
// selector check under SelectorMatches.
|
// selector check under SelectorMatches.
|
||||||
NodeMatchContext nodeContext(EventStates(),
|
NodeMatchContext nodeContext(EventStates(),
|
||||||
aNodeMatchContext.mIsRelevantLink);
|
aNodeMatchContext.mIsRelevantLink);
|
||||||
if (SelectorListMatches(aElement,
|
if (!SelectorListMatches(aElement,
|
||||||
pseudoClass,
|
pseudoClass,
|
||||||
nodeContext,
|
nodeContext,
|
||||||
aTreeMatchContext)) {
|
aTreeMatchContext)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally, with the exception of the two above cases, make sure we
|
|
||||||
// don't match if GetContainingShadow() returns null. For whatever
|
|
||||||
// reason, we can't test for this case first.
|
|
||||||
|
|
||||||
if (aElement->GetContainingShadow() == nullptr) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case CSSPseudoClassType::hostContext:
|
case CSSPseudoClassType::hostContext:
|
||||||
{
|
{
|
||||||
// In order to match host-context, the element must be a
|
// In order to match host-context, the element must be a
|
||||||
|
|
@ -4162,11 +4156,14 @@ nsCSSRuleProcessor::RestrictedSelectorListMatches(Element* aElement,
|
||||||
"SelectorMatchesTree call");
|
"SelectorMatchesTree call");
|
||||||
|
|
||||||
NodeMatchContext nodeContext(EventStates(), false);
|
NodeMatchContext nodeContext(EventStates(), false);
|
||||||
|
SelectorMatchesFlags flags = aElement->IsInShadowTree() ?
|
||||||
|
SelectorMatchesFlags::NONE :
|
||||||
|
SelectorMatchesFlags::IS_HOST_INACCESSIBLE;
|
||||||
return SelectorListMatches(aElement,
|
return SelectorListMatches(aElement,
|
||||||
aSelectorList,
|
aSelectorList,
|
||||||
nodeContext,
|
nodeContext,
|
||||||
aTreeMatchContext,
|
aTreeMatchContext,
|
||||||
SelectorMatchesFlags::NONE);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -79,42 +79,20 @@ private:
|
||||||
if (r) {
|
if (r) {
|
||||||
return *r;
|
return *r;
|
||||||
}
|
}
|
||||||
// Despite the fact that we're invoked for frames with SVG effects applied,
|
#ifdef DEBUG
|
||||||
// we can actually get here. All continuations and IB split siblings of a
|
// Having PreTransformOverflowAreasProperty cached means
|
||||||
// frame with SVG effects applied will have the PreEffectsBBoxProperty
|
// GetVisualOverflowRect() will return post-effect rect, which is not what
|
||||||
// property set on them. Therefore, the frames that are passed to us will
|
// we want. This function intentional reports pre-effect rect. But it does
|
||||||
// always have that property set...well, with one exception. If the frames
|
// not matter if there is no SVG effect on this frame, since no effect
|
||||||
// for an element with SVG effects applied have been subject to an "IB
|
// means post-effect rect matches pre-effect rect.
|
||||||
// split", then the block frame(s) that caused the split will have been
|
if (nsSVGIntegrationUtils::UsingEffectsForFrame(aFrame)) {
|
||||||
// wrapped in anonymous, inline-block, nsBlockFrames of pseudo-type
|
nsOverflowAreas* preTransformOverflows =
|
||||||
// nsCSSAnonBoxes::mozAnonymousBlock. These "IB split sibling" anonymous
|
aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty());
|
||||||
// blocks will have the PreEffectsBBoxProperty property set on them, but
|
|
||||||
// they will never be passed to us. Instead, we'll be passed the block
|
NS_ASSERTION(!preTransformOverflows,
|
||||||
// children that they wrap, which don't have the PreEffectsBBoxProperty
|
"GetVisualOverflowRect() won't return the pre-effects rect!");
|
||||||
// property set on them. This is actually okay. What we care about is
|
}
|
||||||
// collecting the _pre_ effects visual overflow rects of the frames to
|
#endif
|
||||||
// which the SVG effects have been applied. Since the IB split results in
|
|
||||||
// any overflow rect adjustments for transforms, effects, etc. taking
|
|
||||||
// place on the anonymous block wrappers, the wrapped children are left
|
|
||||||
// with their overflow rects unaffected. In other words, calling
|
|
||||||
// GetVisualOverflowRect() on the children will return their pre-effects
|
|
||||||
// visual overflow rects, just as we need.
|
|
||||||
//
|
|
||||||
// A couple of tests that demonstrate the IB split and cause us to get here
|
|
||||||
// are:
|
|
||||||
//
|
|
||||||
// * reftests/svg/svg-integration/clipPath-html-06.xhtml
|
|
||||||
// * reftests/svg/svg-integration/clipPath-html-06-extref.xhtml
|
|
||||||
//
|
|
||||||
// If we ever got passed a frame with the PreTransformOverflowAreasProperty
|
|
||||||
// property set, that would be bad, since then our GetVisualOverflowRect()
|
|
||||||
// call would give us the post-effects, and post-transform, overflow rect.
|
|
||||||
//
|
|
||||||
NS_ASSERTION(aFrame->GetParent()->StyleContext()->GetPseudo() ==
|
|
||||||
nsCSSAnonBoxes::mozAnonymousBlock,
|
|
||||||
"How did we getting here, then?");
|
|
||||||
NS_ASSERTION(!aFrame->GetProperty(aFrame->PreTransformOverflowAreasProperty()),
|
|
||||||
"GetVisualOverflowRect() won't return the pre-effects rect!");
|
|
||||||
return aFrame->GetVisualOverflowRect();
|
return aFrame->GetVisualOverflowRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1784,7 +1784,6 @@ public class Tokenizer implements Locator {
|
||||||
* name.
|
* name.
|
||||||
*/
|
*/
|
||||||
appendStrBuf(c);
|
appendStrBuf(c);
|
||||||
containsHyphen = false;
|
|
||||||
/*
|
/*
|
||||||
* Stay in the tag name state.
|
* Stay in the tag name state.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -598,7 +598,6 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu
|
||||||
containsHyphen = true;
|
containsHyphen = true;
|
||||||
}
|
}
|
||||||
appendStrBuf(c);
|
appendStrBuf(c);
|
||||||
containsHyphen = false;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ ifdef UNIVERSAL_BINARY
|
||||||
MOZ_PKG_PLATFORM := mac
|
MOZ_PKG_PLATFORM := mac
|
||||||
else
|
else
|
||||||
ifeq ($(TARGET_CPU),x86_64)
|
ifeq ($(TARGET_CPU),x86_64)
|
||||||
MOZ_PKG_PLATFORM := mac64
|
MOZ_PKG_PLATFORM := intel64
|
||||||
else
|
else
|
||||||
MOZ_PKG_PLATFORM := mac
|
MOZ_PKG_PLATFORM := arm64
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ ifeq (,$(filter SunOS Linux WINNT,$(OS_ARCH)))
|
||||||
else
|
else
|
||||||
$(MAKE) stage-package make-buildinfo-file
|
$(MAKE) stage-package make-buildinfo-file
|
||||||
@echo 'Compressing...'
|
@echo 'Compressing...'
|
||||||
|
cd $(DIST)/$(MOZ_PKG_DIR); $(CREATE_PRECOMPLETE_CMD)
|
||||||
ifeq (WINNT,$(OS_ARCH))
|
ifeq (WINNT,$(OS_ARCH))
|
||||||
cd $(DIST); $(CYGWIN_WRAPPER) 7z a -t7z -m0=lzma2 -mx=9 -aoa -bb3 $(PKG_BASENAME).7z $(MOZ_PKG_DIR)
|
cd $(DIST); $(CYGWIN_WRAPPER) 7z a -t7z -m0=lzma2 -mx=9 -aoa -bb3 $(PKG_BASENAME).7z $(MOZ_PKG_DIR)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
|
||||||
$(MOZ_PKG_MANIFEST) '$(DIST)' '$(DIST)'/$(STAGEPATH)$(MOZ_PKG_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \
|
$(MOZ_PKG_MANIFEST) '$(DIST)' '$(DIST)'/$(STAGEPATH)$(MOZ_PKG_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \
|
||||||
$(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES)))
|
$(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES)))
|
||||||
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/find-dupes.py $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)
|
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/find-dupes.py $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)
|
||||||
@(cd $(DIST)/$(MOZ_PKG_DIR) && $(CREATE_PRECOMPLETE_CMD))
|
|
||||||
ifdef MOZ_PACKAGE_JSSHELL
|
ifdef MOZ_PACKAGE_JSSHELL
|
||||||
# Package JavaScript Shell
|
# Package JavaScript Shell
|
||||||
@echo 'Packaging JavaScript Shell...'
|
@echo 'Packaging JavaScript Shell...'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue