forked from mirrors/gecko-dev
Bug 1485823 - Use cbindgen for basic_shape::FillRule. r=xidorn
Just a minor fix to use cbindgen to avoid the conversion between basic_shape::FillRule and mozilla::StyleFillRule. Differential Revision: https://phabricator.services.mozilla.com/D4171 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
231e09d925
commit
c1a2d39873
4 changed files with 12 additions and 14 deletions
|
|
@ -145,12 +145,6 @@ enum class StyleGeometryBox : uint8_t {
|
||||||
// background-clip only.
|
// background-clip only.
|
||||||
};
|
};
|
||||||
|
|
||||||
// fill-rule
|
|
||||||
enum class StyleFillRule : uint8_t {
|
|
||||||
Nonzero,
|
|
||||||
Evenodd,
|
|
||||||
};
|
|
||||||
|
|
||||||
// float
|
// float
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/float
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/float
|
||||||
enum class StyleFloat : uint8_t {
|
enum class StyleFloat : uint8_t {
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,11 @@ derive_helper_methods = true
|
||||||
|
|
||||||
[export]
|
[export]
|
||||||
prefix = "Style"
|
prefix = "Style"
|
||||||
include = ["StyleDisplay", "StyleAppearance", "StyleDisplayMode", "StylePathCommand"]
|
include = [
|
||||||
|
"StyleAppearance",
|
||||||
|
"StyleDisplay",
|
||||||
|
"StyleDisplayMode",
|
||||||
|
"StyleFillRule",
|
||||||
|
"StylePathCommand"
|
||||||
|
]
|
||||||
item_types = ["enums", "structs", "typedefs"]
|
item_types = ["enums", "structs", "typedefs"]
|
||||||
|
|
|
||||||
|
|
@ -4986,10 +4986,10 @@ fn static_assert() {
|
||||||
pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) {
|
pub fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) {
|
||||||
use gecko_bindings::bindings::{Gecko_NewBasicShape, Gecko_DestroyShapeSource};
|
use gecko_bindings::bindings::{Gecko_NewBasicShape, Gecko_DestroyShapeSource};
|
||||||
use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleShapeSourceType};
|
use gecko_bindings::structs::{StyleBasicShape, StyleBasicShapeType, StyleShapeSourceType};
|
||||||
use gecko_bindings::structs::{StyleFillRule, StyleGeometryBox, StyleShapeSource};
|
use gecko_bindings::structs::{StyleGeometryBox, StyleShapeSource};
|
||||||
use gecko::conversions::basic_shape::set_corners_from_radius;
|
use gecko::conversions::basic_shape::set_corners_from_radius;
|
||||||
use gecko::values::GeckoStyleCoordConvertible;
|
use gecko::values::GeckoStyleCoordConvertible;
|
||||||
use values::generics::basic_shape::{BasicShape, FillRule, ShapeSource};
|
use values::generics::basic_shape::{BasicShape, ShapeSource};
|
||||||
|
|
||||||
let ref mut ${ident} = self.gecko.${gecko_ffi_name};
|
let ref mut ${ident} = self.gecko.${gecko_ffi_name};
|
||||||
|
|
||||||
|
|
@ -5083,11 +5083,8 @@ fn static_assert() {
|
||||||
coord.0.to_gecko_style_coord(&mut shape.mCoordinates[2 * i]);
|
coord.0.to_gecko_style_coord(&mut shape.mCoordinates[2 * i]);
|
||||||
coord.1.to_gecko_style_coord(&mut shape.mCoordinates[2 * i + 1]);
|
coord.1.to_gecko_style_coord(&mut shape.mCoordinates[2 * i + 1]);
|
||||||
}
|
}
|
||||||
shape.mFillRule = if poly.fill == FillRule::Evenodd {
|
// unsafe: cbindgen ensures the representation is the same.
|
||||||
StyleFillRule::Evenodd
|
shape.mFillRule = unsafe { transmute(poly.fill) };
|
||||||
} else {
|
|
||||||
StyleFillRule::Nonzero
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ pub struct PolygonCoord<LengthOrPercentage>(pub LengthOrPercentage, pub LengthOr
|
||||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
|
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
|
||||||
SpecifiedValueInfo, ToComputedValue, ToCss)]
|
SpecifiedValueInfo, ToComputedValue, ToCss)]
|
||||||
|
#[repr(u8)]
|
||||||
pub enum FillRule {
|
pub enum FillRule {
|
||||||
Nonzero,
|
Nonzero,
|
||||||
Evenodd,
|
Evenodd,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue