Use rust types for basic shapes.
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(2 files)
This is the first step to use more complex rust types in cbindgen.
For now, we'll use just a replacement for a boxed slice.
Afterwards, we should be able to do Atom
, Arc
and Box
, and I think that's all we need to remove all the custom glue code and have something sane :)
Assignee | ||
Comment 1•5 years ago
|
||
Passing these by value won't be ok of course, but that's fine.
I plan to combine this with https://github.com/eqrion/cbindgen/pull/333 to
actually be able to share representation for ~all the things, this is just the
first bit. Box<T>, Atom and Arc<T> will be much easier since those have defined
memory layouts.
It's boxed slices the only ones I should need something like this. I could avoid
it if I rely on Rust's internal representation, but I'd rather not, it didn't
end up being as much work to do it right.
Assignee | ||
Comment 2•5 years ago
|
||
This enables destructors for tagged unions in cbindgen, implemented in:
Which allow us to properly generate a destructor for the cbindgen-generated
StyleBasicShape (which now contains an OwnedSlice).
For now, we still use the glue code to go from Box<BasicShape> to
UniquePtr<BasicShape>. But that will change in the future when we generate even
more stuff and remove all the glue.
I could add support for copy-constructor generation to cbindgen for tagged
enums, but I'm not sure if it'll end up being needed, and copy-constructing
unions in C++ is always very tricky.
Depends on D29768
Updated•5 years ago
|
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41acb048244d Add an owned slice type which cbindgen can understand. r=heycam https://hg.mozilla.org/integration/autoland/rev/fe11fc11ec5b Use the owned slice type for basic shape polygon coordinates. r=TYLin,heycam
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/41acb048244d
https://hg.mozilla.org/mozilla-central/rev/fe11fc11ec5b
Description
•