commit 566ab8382ecdfa664704eabb8afbde00ea8e6166
parent c173299a7684d6ae937f895d55b014523d067c64
Author: Nicolas Silva <nical@fastmail.com>
Date: Fri, 14 Nov 2025 16:55:37 +0000
Bug 1999839 - Disable repeated quad gradients. r=gfx-reviewers,bradwerth
There are a couple of recent regressions (bug 1999839 and bug 1999849) from this so let's disable this path until they are figured out.
- One is a correctness issue that needs investigation.
- One is a performance issue when the primitive generates a very large number of repetitions. The hope was that it wouldn't happen much in practice but hope did not survive contact with reality. This one will require an intermediate pass to generate the repetition via a shader instead of duplication the primitives on the CPU.
Differential Revision: https://phabricator.services.mozilla.com/D272641
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/gfx/wr/webrender/src/prepare.rs b/gfx/wr/webrender/src/prepare.rs
@@ -241,6 +241,10 @@ fn prepare_prim_for_render(
let prim_instance = &mut prim_instances[prim_instance_index];
if !is_passthrough {
+ fn may_need_repetition(stretch_size: LayoutSize, prim_rect: LayoutRect) -> bool {
+ stretch_size.width < prim_rect.width() ||
+ stretch_size.height < prim_rect.height()
+ }
// Bug 1887841: At the moment the quad shader does not support repetitions.
// Bug 1888349: Some primitives have brush segments that aren't handled by
// the quad infrastructure yet.
@@ -249,16 +253,19 @@ fn prepare_prim_for_render(
PrimitiveInstanceKind::LinearGradient { data_handle, .. } => {
let prim_data = &data_stores.linear_grad[*data_handle];
!prim_data.brush_segments.is_empty()
+ || may_need_repetition(prim_data.stretch_size, prim_data.common.prim_rect)
|| !frame_context.fb_config.precise_linear_gradients
}
PrimitiveInstanceKind::RadialGradient { data_handle, .. } => {
let prim_data = &data_stores.radial_grad[*data_handle];
!prim_data.brush_segments.is_empty()
+ || may_need_repetition(prim_data.stretch_size, prim_data.common.prim_rect)
}
// TODO(bug 1899546) Enable quad conic gradients with SWGL.
PrimitiveInstanceKind::ConicGradient { data_handle, .. } if !frame_context.fb_config.is_software => {
let prim_data = &data_stores.conic_grad[*data_handle];
!prim_data.brush_segments.is_empty()
+ || may_need_repetition(prim_data.stretch_size, prim_data.common.prim_rect)
}
_ => true,
};