mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Implement image-rendering: smooth and image-rendering: pixelated
Also, more directly go from StyleImageRendering to wr::ImageRendering. * image-rendering: smooth the non-deprecated version of OptimizeQuality, which maps to SamplingFilter::LINEAR / wr::ImageRendering::Auto (which uses gl::LINEAR). * image-rendering: pixelated maps to wr::ImageRendering::Pixelated / SamplingFilter::POINT which is the same crisp-edges does. Note that this uncovers that we were mapping image-rendering: crisp-edges to wr::ImageRendering::Pixelated. I'm going to preserve behavior on this patch but we should consider switching that to map to wr::ImageRendering::CrispEdges on a follow-up (filed bug 1728831 for this). Differential Revision: https://phabricator.services.mozilla.com/D124378
This commit is contained in:
parent
212733900e
commit
693806b853
1 changed files with 3 additions and 2 deletions
|
@ -1247,8 +1247,10 @@ impl MozImageRect {
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
pub enum ImageRendering {
|
pub enum ImageRendering {
|
||||||
Auto,
|
Auto,
|
||||||
|
Smooth,
|
||||||
#[parse(aliases = "-moz-crisp-edges")]
|
#[parse(aliases = "-moz-crisp-edges")]
|
||||||
CrispEdges,
|
CrispEdges,
|
||||||
|
Pixelated,
|
||||||
// From the spec:
|
// From the spec:
|
||||||
//
|
//
|
||||||
// This property previously accepted the values optimizeSpeed and
|
// This property previously accepted the values optimizeSpeed and
|
||||||
|
@ -1256,10 +1258,9 @@ pub enum ImageRendering {
|
||||||
// them as valid values but must treat them as having the same behavior
|
// them as valid values but must treat them as having the same behavior
|
||||||
// as crisp-edges and smooth respectively, and authors must not use
|
// as crisp-edges and smooth respectively, and authors must not use
|
||||||
// them.
|
// them.
|
||||||
|
//
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
Optimizespeed,
|
Optimizespeed,
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
Optimizequality,
|
Optimizequality,
|
||||||
#[cfg(feature = "servo")]
|
|
||||||
Pixelated,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue