Closed
Bug 1354946
Opened 8 years ago
Closed 8 years ago
Fix passing Matrix4x4 across the FFI boundary
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
5.60 KB,
patch
|
Details | Diff | Splinter Review | |
59 bytes,
text/x-review-board-request
|
rhunt
:
review+
|
Details |
Right now the FFI signature for wr_push_stacking_context takes a float* on the C++ side and accepts a LayoutTransform on the Rust side. However, LayoutTransform is not repr(C) which means there is no guarantee that it's layout is the same as a float array. This is potential bug, and something we need to fix for the binding generator to work properly.
I'm working on a patch for this right now. It adds a WrMatrix type that stores a float[16] and otherwise behaves much like the WrRect type.
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Comment 2•8 years ago
|
||
Green try push including this patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e0b9d1573a96eb4e5a60a05cf95c46085d5f0cde
Assignee | ||
Updated•8 years ago
|
Attachment #8856298 -
Flags: review?(rhunt)
Comment 3•8 years ago
|
||
Comment on attachment 8856298 [details] [diff] [review]
Patch
Review of attachment 8856298 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/webrender_bindings/WebRenderAPI.cpp
@@ +534,5 @@
> {
> + WrMatrix transform;
> + static_assert(sizeof(aTransform.components) == sizeof(transform.values),
> + "Matrix components size mismatch!");
> + memcpy(transform.values, aTransform.components, sizeof(transform.values));
Can we have a wr::ToWrMatrix function for this?
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
Updated patch to have a ToWrMatrix function. This try push has the updated patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f73793aad289b511b84c5a57832b909b519fe0b7
Comment 6•8 years ago
|
||
Comment on attachment 8856736 [details]
Bug 1354946 - Add an explicit WrMatrix type for passing 4x4 matrices across the FFI boundary.
Thanks!
Attachment #8856736 -
Flags: review?(rhunt) → review+
Updated•8 years ago
|
Attachment #8856298 -
Flags: review?(rhunt)
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/projects/graphics/rev/1bfa30d18fef
Add an explicit WrMatrix type for passing 4x4 matrices across the FFI boundary. r=rhunt
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•8 years ago
|
||
bugherder |
Assignee | ||
Updated•8 years ago
|
status-firefox55:
--- → fixed
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•