style: Change nscolor to StyleComplexColor.

Bug: 1467622
Reviewed-by: xidorn
MozReview-Commit-ID: 1bbQzOoOuBe
This commit is contained in:
Dan Glastonbury 2018-06-27 17:07:37 +10:00 committed by Emilio Cobos Álvarez
parent 6f9b47be25
commit a76f5393d4
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 15 additions and 13 deletions

View file

@ -667,14 +667,14 @@ def set_gecko_property(ffi_name, expr):
SVGPaintKind::Color(color) => {
paint.mType = nsStyleSVGPaintType::eStyleSVGPaintType_Color;
unsafe {
*paint.mPaint.mColor.as_mut() = convert_rgba_to_nscolor(&color);
*paint.mPaint.mColor.as_mut() = color.into();
}
}
}
paint.mFallbackType = match fallback {
Some(Either::First(color)) => {
paint.mFallbackColor = convert_rgba_to_nscolor(&color);
paint.mFallbackColor = color.into();
nsStyleSVGFallbackType::eStyleSVGFallbackType_Color
},
Some(Either::Second(_)) => {
@ -709,7 +709,7 @@ def set_gecko_property(ffi_name, expr):
let fallback = match paint.mFallbackType {
nsStyleSVGFallbackType::eStyleSVGFallbackType_Color => {
Some(Either::First(convert_nscolor_to_rgba(paint.mFallbackColor)))
Some(Either::First(paint.mFallbackColor.into()))
},
nsStyleSVGFallbackType::eStyleSVGFallbackType_None => {
Some(Either::Second(None_))
@ -728,7 +728,8 @@ def set_gecko_property(ffi_name, expr):
})
}
nsStyleSVGPaintType::eStyleSVGPaintType_Color => {
unsafe { SVGPaintKind::Color(convert_nscolor_to_rgba(*paint.mPaint.mColor.as_ref())) }
let col = unsafe { *paint.mPaint.mColor.as_ref() };
SVGPaintKind::Color(col.into())
}
};
SVGPaint {