Closed Bug 1877047 Opened 8 months ago Closed 2 months ago

Text shadow ignores spread_radius in WebRender GitHub example code

Categories

(Core :: Graphics: WebRender, enhancement)

enhancement

Tracking

()

RESOLVED INACTIVE

People

(Reporter: felix.schuett, Unassigned)

References

(Blocks 2 open bugs)

Details

Steps to reproduce:

Right now I am trying to implement simple text-shadow rendering for Azul (https://azulrs/). I have problems with rendering the spread_radius correctly, because the display_list::Shadow item does not have any field for it.

https://github.com/fschutt/azul/blob/8923defd80d047c704e65bcca6c4b70a7f6fe9f4/azul-desktop/src/wr_translate.rs#L1541

if let Some(azul_css::StyleBoxShadow { offset, color, blur_radius, spread_radius, clip_mode }) = text_shadow.as_ref() {

    use webrender::api::{
        FilterOp as WrFilterOp,
        RasterSpace as WrRasterSpace,
        StackingContextFlags as WrStackingContextFlags,
        Shadow as WrShadow,
    };

    builder.push_stacking_context(
        WrLayoutPoint::zero(),
        normal_info.spatial_id,
        WrPrimitiveFlags::empty(),
        None,
        WrTransformStyle::Flat,
        WrMixBlendMode::Normal,
        &[WrFilterOp::DropShadow(WrShadow {
            offset: WrLayoutVector2D::new(offset[0].to_pixels(), offset[1].to_pixels()),
            color: wr_translate_color_f(color.clone().into()),
            blur_radius: blur_radius.to_pixels(),
        })],
        &[],
        &[],
        WrRasterSpace::Screen,
        WrStackingContextFlags::empty(),
    );
}

text::push_text(builder, &text_info, glyphs, *font_instance_key, *color, *glyph_options);

if text_shadow.is_some() {
    builder.pop_stacking_context();
}

How am I supposed to implement the spread_radius of the text-shadow property? The "box shadow" has this property, however, that just renders a box, not an outline around the text.

Actual results:

Text shadow shows, but I can't set the spread radius.

Expected results:

The official WebRender repo has no documentation or hints on how to set the spread for a text shadow.

Hi Felix

Is there a reduced standalone testcase you can attach to this bug?

Flags: needinfo?(felix.schuett)
Blocks: wr-todos

Redirect a needinfo that is pending on an inactive user to the triage owner.
:gw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(felix.schuett) → needinfo?(gwatson)
Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Flags: needinfo?(gwatson)
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.