diff --git a/gfx/wr/webrender/src/prim_store/mod.rs b/gfx/wr/webrender/src/prim_store/mod.rs index b7bd5d1b27e3..0f5d45a773b5 100644 --- a/gfx/wr/webrender/src/prim_store/mod.rs +++ b/gfx/wr/webrender/src/prim_store/mod.rs @@ -2037,12 +2037,13 @@ impl PrimitiveStore { } // Inflate the local rect for this primitive by the inflation factor of - // the picture context. This ensures that even if the primitive itself - // is not visible, any effects from the blur radius will be correctly - // taken into account. + // the picture context and include the shadow offset. This ensures that + // even if the primitive itself is not visible, any effects from the + // blur radius or shadow will be correctly taken into account. let inflation_factor = surface.inflation_factor; let local_rect = prim_local_rect .inflate(inflation_factor, inflation_factor) + .union(&prim_shadow_rect) .intersection(&prim_instance.local_clip_rect); let local_rect = match local_rect { Some(local_rect) => local_rect, diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png new file mode 100644 index 000000000000..f58e15c5fccb Binary files /dev/null and b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.png differ diff --git a/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml new file mode 100644 index 000000000000..232700c555ba --- /dev/null +++ b/gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip-2.yaml @@ -0,0 +1,17 @@ +# Bug 1561447: If a clip task is created for a picture, it should take into account the rect of the drop shadow +--- +root: + items: + - type: clip + id: 2 + bounds: 10 0 300 300 + clip-rect: 10 0 300 300 + - type: stacking-context + bounds: 30 30 0 0 + transform: rotate-z(45) + filters: drop-shadow([15, 0], 0, red) + clip-node: 2 + items: + - type: rect + bounds: 0 0 100 100 + color: blue diff --git a/gfx/wr/wrench/reftests/filters/reftest.list b/gfx/wr/wrench/reftests/filters/reftest.list index 6a77c494aba1..539f5fcbfa86 100644 --- a/gfx/wr/wrench/reftests/filters/reftest.list +++ b/gfx/wr/wrench/reftests/filters/reftest.list @@ -35,6 +35,7 @@ platform(linux,mac) == filter-drop-shadow.yaml filter-drop-shadow.png platform(linux,mac) == filter-drop-shadow-on-viewport-edge.yaml filter-drop-shadow-on-viewport-edge.png platform(linux,mac) == blend-clipped.yaml blend-clipped.png platform(linux,mac) == filter-drop-shadow-clip.yaml filter-drop-shadow-clip.png +platform(linux,mac) == filter-drop-shadow-clip-2.yaml filter-drop-shadow-clip-2.png == filter-segments.yaml filter-segments-ref.yaml == iframe-dropshadow.yaml iframe-dropshadow-ref.yaml skip_on(android) == filter-mix-blend-mode.yaml filter-mix-blend-mode-ref.yaml # Android debug: GL error 502 at blit_framebuffer (emulator) or draw_elements_instanced (Pixel2); Android opt: fails