mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
style: Use union to wrap different shape-like types. r=xidorn
1. We will add more shape-like types in the future, so it's better to use union to reduce the memory usage. 2. Those shape-like types are mutual exclusive, so we could use union to wrap them. Differential Revision: https://phabricator.services.mozilla.com/D2746
This commit is contained in:
parent
ad83faa745
commit
c87668fcd5
2 changed files with 5 additions and 5 deletions
|
@ -4960,7 +4960,7 @@ fn static_assert() {
|
|||
ShapeSource::ImageOrUrl(image) => {
|
||||
unsafe {
|
||||
bindings::Gecko_NewShapeImage(${ident});
|
||||
let style_image = &mut *${ident}.mShapeImage.mPtr;
|
||||
let style_image = &mut *${ident}.__bindgen_anon_1.mShapeImage.as_mut().mPtr;
|
||||
style_image.set(image);
|
||||
}
|
||||
}
|
||||
|
@ -4980,7 +4980,7 @@ fn static_assert() {
|
|||
// Create StyleBasicShape in StyleShapeSource. mReferenceBox and mType
|
||||
// will be set manually later.
|
||||
Gecko_NewBasicShape(${ident}, basic_shape_type);
|
||||
&mut *${ident}.mBasicShape.mPtr
|
||||
&mut *${ident}.__bindgen_anon_1.mBasicShape.as_mut().mPtr
|
||||
}
|
||||
}
|
||||
match servo_shape {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue