Bug 1605687 - Don't skip the filter noop path when running into invalid color matrices. r=cbrewster

The noop path lets us detect some unnecessary color space conversion passes.

Differential Revision: https://phabricator.services.mozilla.com/D58921

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Silva 2020-01-08 08:21:55 +00:00
Родитель d16b0d8318
Коммит b0c1a73996
1 изменённых файлов: 10 добавлений и 11 удалений

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

@ -204,19 +204,18 @@ bool nsFilterInstance::BuildWebRenderFilters(nsIFrame* aFilteredFrame,
attr.as<ColorMatrixAttributes>();
float transposed[20];
if (!gfx::ComputeColorMatrix(attributes, transposed)) {
if (gfx::ComputeColorMatrix(attributes, transposed)) {
float matrix[20] = {
transposed[0], transposed[5], transposed[10], transposed[15],
transposed[1], transposed[6], transposed[11], transposed[16],
transposed[2], transposed[7], transposed[12], transposed[17],
transposed[3], transposed[8], transposed[13], transposed[18],
transposed[4], transposed[9], transposed[14], transposed[19]};
aWrFilters.filters.AppendElement(wr::FilterOp::ColorMatrix(matrix));
} else {
filterIsNoop = true;
continue;
}
float matrix[20] = {
transposed[0], transposed[5], transposed[10], transposed[15],
transposed[1], transposed[6], transposed[11], transposed[16],
transposed[2], transposed[7], transposed[12], transposed[17],
transposed[3], transposed[8], transposed[13], transposed[18],
transposed[4], transposed[9], transposed[14], transposed[19]};
aWrFilters.filters.AppendElement(wr::FilterOp::ColorMatrix(matrix));
} else if (attr.is<GaussianBlurAttributes>()) {
if (finalClip) {
// There's a clip that needs to apply before the blur filter, but