Closed Bug 1355612 Opened 7 years ago Closed 7 years ago

Make WrGlyphInstance more wr-binding friendly

Categories

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

Other Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

On the Rust side, GlyphInstance [1] has a u32 and a Point2D<f32>. The Point2D comes from some complicated macro expansion in euclid [2][3]. It's repr(C) [4] so that's good, but it's a little more than our little binding generator can easily handle.

On the C++ side we map it to WrGlyphInstance [5] which is equivalent, except the Point2D has been inlined. I'd like to un-inline it with a typedef so that the binding generator can just pretend like there's a Point2D and everything works normally.

[1] http://searchfox.org/mozilla-central/rev/2fc8c8d483d9ec9fd0ec319c6c53807f7fa8e8a2/gfx/webrender_traits/src/font.rs#149
[2] http://searchfox.org/mozilla-central/rev/2fc8c8d483d9ec9fd0ec319c6c53807f7fa8e8a2/third_party/rust/euclid/src/point.rs#33
[3] http://searchfox.org/mozilla-central/rev/2fc8c8d483d9ec9fd0ec319c6c53807f7fa8e8a2/third_party/rust/euclid/src/point.rs#24
[4] http://searchfox.org/mozilla-central/rev/2fc8c8d483d9ec9fd0ec319c6c53807f7fa8e8a2/third_party/rust/euclid/src/macros.rs#17
[5] http://searchfox.org/mozilla-central/rev/624d25b2980cf5f83452b040e6d664460f9b7ec5/gfx/webrender_bindings/webrender_ffi.h#257
Comment on attachment 8857201 [details]
Bug 1355612 - Make WrGlyphInstance hold a Point2D instead of raw x/y to match the Rust side.

https://reviewboard.mozilla.org/r/129130/#review131642
Attachment #8857201 - Flags: review?(jmuizelaar) → review+
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/projects/graphics/rev/abf4d30707ee
Make WrGlyphInstance hold a Point2D instead of raw x/y to match the Rust side. r=jrmuizel
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: