Open Bug 1889073 Opened 8 months ago Updated 8 months ago

The gradient stop quantization step can cause artifacts

Categories

(Core :: Graphics: WebRender, defect, P3)

defect

Tracking

()

People

(Reporter: nical, Unassigned)

References

(Depends on 5 open bugs, Blocks 1 open bug)

Details

Some pages have very large gradients that are constant for most of their range and only some variation on a small part of the gradient. The way we currently quantized stops into 128 pairs loses too much information.

For example the test case from bug 885021 has on a very large radial gradient:

[
  GradientStop { offset: 0.0, color: ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 } },
  GradientStop { offset: 0.99749994, color: ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.0 } },
  GradientStop { offset: 1.0, color: ColorF { r: 0.0, g: 0.0, b: 0.0, a: 0.6 } }
]

We could mitigate that to some extent by excluding the constant ranges at the start and end of the gradient and re-map the gradient offset in the shader accordingly.

Depends on: 1869248
Depends on: 1791628
Depends on: 1809095
No longer blocks: 885021
Depends on: 885021
Depends on: 1680882
Depends on: 1881921
Severity: -- → S3
Priority: -- → P3

Glenn suggested trying to add a separate gradient shader which doe snot use the gradient lookup table and evaluates the gradient directly from the stops when the number of stop is smaller than some value like 8.

You need to log in before you can comment on or make changes to this bug.