Closed
Bug 1452620
Opened 6 years ago
Closed 6 years ago
Make reading from WrPipelineInfo more ergonomic
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(3 files)
Right now reading a WrPipelineInfo in C++ code means using wr_pipeline_info_next_epoch and wr_pipeline_info_next_removed_pipeline to iterate through the items, which is kinda clunky. We should just copy the structure over and expose it in c++ as an equivalent struct or something. This will also remove the awkward lifetime management where C++ code has to call wr_pipeline_info_delete to free the pointer when it's done with it.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → bugmail
Assignee | ||
Comment 1•6 years ago
|
||
This also needs documentation to indicate what exactly is being produced in the structure. (See halfway down bug 1449982 comment 30)
Updated•6 years ago
|
Priority: -- → P3
Assignee | ||
Comment 2•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4a1a12840fd3711055af1314083d3e170e1e2608
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 6•6 years ago
|
||
mozreview-review |
Comment on attachment 8966676 [details] Bug 1452620 - Add an FfiVec structure. https://reviewboard.mozilla.org/r/235372/#review241090 just a code-style nit ::: gfx/webrender_bindings/src/bindings.rs:188 (Diff revision 1) > +impl<T> Drop for FfiVec<T> { > + fn drop(&mut self) { > + // turn the stuff back into a Vec and let it be freed normally > + let _ = unsafe { > + Vec::from_raw_parts( > + mem::transmute::<*const T, *mut T>(self.data), transmute is an overpowered laser cannon that should be avoided, use `self.data as *mut T`
Attachment #8966676 -
Flags: review?(a.beingessner) → review+
Comment 7•6 years ago
|
||
mozreview-review |
Comment on attachment 8966677 [details] Bug 1452620 - Use FfiVec to clean up WrPipelineInfo usage in C++. https://reviewboard.mozilla.org/r/235374/#review241118 one style nit ::: gfx/webrender_bindings/src/bindings.rs:659 (Diff revision 1) > } > > -#[no_mangle] > -pub unsafe extern "C" fn wr_pipeline_info_next_epoch( > - info: &mut WrPipelineInfo, > - out_pipeline: &mut WrPipelineId, > +impl WrPipelineInfo { > + fn new(info: PipelineInfo) -> Self { > + WrPipelineInfo { > + epochs: FfiVec::from_vec(info.epochs.into_iter().map(|x| x.into()).collect()), minor style/clarity nit: this *I think* could be .map(WrPipelineEpoch::from)
Attachment #8966677 -
Flags: review?(a.beingessner) → review+
Updated•6 years ago
|
Blocks: stage-wr-trains
Assignee | ||
Comment 8•6 years ago
|
||
(In reply to Alexis Beingessner [:Gankro] from comment #7) > > + epochs: FfiVec::from_vec(info.epochs.into_iter().map(|x| x.into()).collect()), > > minor style/clarity nit: this *I think* could be .map(WrPipelineEpoch::from) For some reason this didn't work with my Into impl. I had to replace the Into impl with the corresponding From impl and then it worked. I thought there was Magic that automatically converted between the two but maybe not?
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 12•6 years ago
|
||
mozreview-review |
Comment on attachment 8966677 [details] Bug 1452620 - Use FfiVec to clean up WrPipelineInfo usage in C++. https://reviewboard.mozilla.org/r/235374/#review241300
Attachment #8966677 -
Flags: review?(nical.bugzilla) → review+
Comment 13•6 years ago
|
||
mozreview-review |
Comment on attachment 8966678 [details] Bug 1452620 - Document the WrPipelineInfo structure. https://reviewboard.mozilla.org/r/235376/#review241304
Attachment #8966678 -
Flags: review?(nical.bugzilla) → review+
Comment 14•6 years ago
|
||
mozreview-review |
Comment on attachment 8966678 [details] Bug 1452620 - Document the WrPipelineInfo structure. https://reviewboard.mozilla.org/r/235376/#review241566 Thanks!
Attachment #8966678 -
Flags: review?(botond) → review+
Comment 15•6 years ago
|
||
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/62c96f73b6c3 Add an FfiVec structure. r=Gankro https://hg.mozilla.org/integration/autoland/rev/fc3122cb0725 Use FfiVec to clean up WrPipelineInfo usage in C++. r=Gankro,nical https://hg.mozilla.org/integration/autoland/rev/cfc40d3357e1 Document the WrPipelineInfo structure. r=botond,nical
Comment 16•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/62c96f73b6c3 https://hg.mozilla.org/mozilla-central/rev/fc3122cb0725 https://hg.mozilla.org/mozilla-central/rev/cfc40d3357e1
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•