Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs
- index 1747b57e08dd..1708aa539065 100644
- --- a/gfx/webrender_bindings/src/bindings.rs
- +++ b/gfx/webrender_bindings/src/bindings.rs
- @@ -1419,6 +1419,12 @@ pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
- image_rendering);
- }
- +#[repr(C)]
- +struct GeckoGlyph {
- + mIndex: u32,
- + mPosition: LayoutPoint, // Absolute space, need to apply element's origin offset
- +}
- +
- #[no_mangle]
- pub extern "C" fn wr_dp_push_text(state: &mut WrState,
- bounds: LayoutRect,
- @@ -1426,19 +1432,28 @@ pub extern "C" fn wr_dp_push_text(state: &mut WrState,
- is_backface_visible: bool,
- color: ColorF,
- font_key: WrFontInstanceKey,
- - glyphs: *const GlyphInstance,
- + origin_offset: LayoutVector2D,
- + glyphs: *const GeckoGlyph,
- glyph_count: u32,
- glyph_options: *const GlyphOptions) {
- debug_assert!(unsafe { is_in_main_thread() });
- let glyph_slice = make_slice(glyphs, glyph_count as usize);
- + // Need to map gecko glyphs into element-relative space for wr
- + let glyph_iter = glyph_slice.iter().map(|src| {
- + GlyphInstance {
- + index: src.mIndex,
- + point: src.mPosition - origin_offset,
- + }
- + });
- +
- let mut prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
- prim_info.is_backface_visible = is_backface_visible;
- state.frame_builder
- .dl_builder
- .push_text(&prim_info,
- - &glyph_slice,
- + glyph_iter,
- font_key,
- color,
- unsafe { glyph_options.as_ref().cloned() });
Add Comment
Please, Sign In to add comment