Open Bug 1428301 Opened 7 years ago Updated 11 months ago

Put the generated webrender bindings into a wr_ffi namespace

Categories

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

enhancement

Tracking

()

People

(Reporter: nical, Unassigned)

References

(Blocks 1 open bug)

Details

Every time I add a wrapper for a WebRender type (let's call it Foo), there is a head scratching phase where I have to figure out a new name for the wrapper type because the "mozilla::wr::Foo" names is already used by the generated bindings. It'd be nice if the generated binding would be "mozilla::wr_ffi::Foo" so that the wrapper can be written like this: > namespace wr ( > class Foo { > // ... > wr_ffi::Foo* mFoo; > }; > } A few examples of types tha we had to rename (rust -> c++) - Api -> WebRenderAPI - Renderer -> RendererOGL - ResourceUpdates -> ResourceUpdateQueue - Vec_u8 -> ByteBuffer - Transaction -> ? (not quite sure yet) The ffi types that we want to use as is (typically enums) can be reexported in the wr namespace. Objections?
Alternative solution, Ryan is adding a feature in cbindgen to generate the types with a different name. > |15:05 rhunt| nical: so I added a feature last night to cbindgen that may do what you were asking > |15:06 rhunt| nical: [export.rename] "Foo" = "WrFoo" will rename all references to Foo in the generated bindings
Severity: normal → S3
Blocks: wr-todos
No longer blocks: stage-wr-year
You need to log in before you can comment on or make changes to this bug.