style: Simplify parsing and storage of SVG paint server fallback. r=boris

Differential Revision: https://phabricator.services.mozilla.com/D36806
This commit is contained in:
Emilio Cobos Álvarez 2019-07-06 08:24:39 +00:00
parent f0b5d02901
commit 83da7c1535
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
5 changed files with 71 additions and 99 deletions

View file

@ -20,22 +20,13 @@ pub type SVGPaint = generic::SVGPaint<Color, ComputedUrl>;
/// Computed SVG Paint Kind value
pub type SVGPaintKind = generic::SVGPaintKind<Color, ComputedUrl>;
impl Default for SVGPaint {
fn default() -> Self {
SVGPaint {
kind: generic::SVGPaintKind::None,
fallback: None,
}
}
}
impl SVGPaint {
/// Opaque black color
pub fn black() -> Self {
let rgba = RGBA::from_floats(0., 0., 0., 1.).into();
SVGPaint {
kind: generic::SVGPaintKind::Color(rgba),
fallback: None,
fallback: generic::SVGPaintFallback::Unset,
}
}
}