mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Change 'image_rendering' enum variants to snake cases
This commit is contained in:
parent
34a23b343c
commit
5fd398ec06
4 changed files with 19 additions and 18 deletions
|
@ -222,8 +222,8 @@ impl<'a> PaintContext<'a> {
|
|||
// conforming implementation of `crisp-edges`, but it is not the best we could do.
|
||||
// Something like Scale2x would be ideal.
|
||||
let draw_surface_filter = match image_rendering {
|
||||
image_rendering::T::Auto => Filter::Linear,
|
||||
image_rendering::T::CrispEdges | image_rendering::T::Pixelated => Filter::Point,
|
||||
image_rendering::T::auto => Filter::Linear,
|
||||
image_rendering::T::crispedges | image_rendering::T::pixelated => Filter::Point,
|
||||
};
|
||||
|
||||
let draw_surface_options = DrawSurfaceOptions::new(draw_surface_filter, true);
|
||||
|
|
|
@ -1331,7 +1331,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
},
|
||||
stretch_size: stacking_relative_content_box.size,
|
||||
tile_spacing: Size2D::zero(),
|
||||
image_rendering: image_rendering::T::Auto,
|
||||
image_rendering: image_rendering::T::auto,
|
||||
})
|
||||
}
|
||||
CanvasData::WebGL(context_id) => {
|
||||
|
|
|
@ -218,9 +218,9 @@ trait ToImageRendering {
|
|||
impl ToImageRendering for image_rendering::T {
|
||||
fn to_image_rendering(&self) -> webrender_traits::ImageRendering {
|
||||
match *self {
|
||||
image_rendering::T::CrispEdges => webrender_traits::ImageRendering::CrispEdges,
|
||||
image_rendering::T::Auto => webrender_traits::ImageRendering::Auto,
|
||||
image_rendering::T::Pixelated => webrender_traits::ImageRendering::Pixelated,
|
||||
image_rendering::T::crispedges => webrender_traits::ImageRendering::CrispEdges,
|
||||
image_rendering::T::auto => webrender_traits::ImageRendering::Auto,
|
||||
image_rendering::T::pixelated => webrender_traits::ImageRendering::Pixelated,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,20 +45,21 @@ ${helpers.single_keyword("color-adjust",
|
|||
use cssparser::ToCss;
|
||||
use std::fmt;
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
|
||||
pub enum T {
|
||||
Auto,
|
||||
CrispEdges,
|
||||
Pixelated,
|
||||
auto,
|
||||
crispedges,
|
||||
pixelated,
|
||||
}
|
||||
|
||||
impl ToCss for T {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
T::Auto => dest.write_str("auto"),
|
||||
T::CrispEdges => dest.write_str("crisp-edges"),
|
||||
T::Pixelated => dest.write_str("pixelated"),
|
||||
T::auto => dest.write_str("auto"),
|
||||
T::crispedges => dest.write_str("crisp-edges"),
|
||||
T::pixelated => dest.write_str("pixelated"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +72,7 @@ ${helpers.single_keyword("color-adjust",
|
|||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
computed_value::T::Auto
|
||||
computed_value::T::auto
|
||||
}
|
||||
|
||||
pub fn parse(_: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue,()> {
|
||||
|
@ -79,11 +80,11 @@ ${helpers.single_keyword("color-adjust",
|
|||
// `auto`.
|
||||
match_ignore_ascii_case! {
|
||||
try!(input.expect_ident()),
|
||||
"auto" => Ok(computed_value::T::Auto),
|
||||
"optimizespeed" => Ok(computed_value::T::Auto),
|
||||
"optimizequality" => Ok(computed_value::T::Auto),
|
||||
"crisp-edges" => Ok(computed_value::T::CrispEdges),
|
||||
"pixelated" => Ok(computed_value::T::Pixelated),
|
||||
"auto" => Ok(computed_value::T::auto),
|
||||
"optimizespeed" => Ok(computed_value::T::auto),
|
||||
"optimizequality" => Ok(computed_value::T::auto),
|
||||
"crisp-edges" => Ok(computed_value::T::crispedges),
|
||||
"pixelated" => Ok(computed_value::T::pixelated),
|
||||
_ => Err(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue