зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1611041 - Convert image-rendering #defines to an enum class. r=emilio
MANUAL PUSH: Contributor didn't use Phabricator and I don't want patch to rot
This commit is contained in:
Родитель
4165a2e843
Коммит
a63c10f0de
|
@ -6550,11 +6550,11 @@ SamplingFilter nsLayoutUtils::GetSamplingFilterForFrame(nsIFrame* aForFrame) {
|
|||
}
|
||||
|
||||
switch (sc->StyleVisibility()->mImageRendering) {
|
||||
case NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED:
|
||||
case StyleImageRendering::Optimizespeed:
|
||||
return SamplingFilter::POINT;
|
||||
case NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY:
|
||||
case StyleImageRendering::Optimizequality:
|
||||
return SamplingFilter::LINEAR;
|
||||
case NS_STYLE_IMAGE_RENDERING_CRISP_EDGES:
|
||||
case StyleImageRendering::CrispEdges:
|
||||
return SamplingFilter::POINT;
|
||||
default:
|
||||
return defaultFilter;
|
||||
|
|
|
@ -99,6 +99,7 @@ rusty-enums = [
|
|||
"mozilla::StyleDirection",
|
||||
"mozilla::StyleFloat",
|
||||
"mozilla::StyleImageOrientation",
|
||||
"mozilla::StyleImageRendering",
|
||||
"mozilla::StyleUserModify",
|
||||
"mozilla::StyleUserInput",
|
||||
"mozilla::StyleBoxDirection",
|
||||
|
|
|
@ -745,10 +745,12 @@ enum class StyleDominantBaseline : uint8_t {
|
|||
};
|
||||
|
||||
// image-rendering
|
||||
#define NS_STYLE_IMAGE_RENDERING_AUTO 0
|
||||
#define NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED 1
|
||||
#define NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY 2
|
||||
#define NS_STYLE_IMAGE_RENDERING_CRISP_EDGES 3
|
||||
enum class StyleImageRendering : uint8_t {
|
||||
Auto,
|
||||
Optimizespeed,
|
||||
Optimizequality,
|
||||
CrispEdges,
|
||||
};
|
||||
|
||||
// mask-type
|
||||
enum class StyleMaskType : uint8_t {
|
||||
|
|
|
@ -3130,7 +3130,7 @@ nsStyleVisibility::nsStyleVisibility(const Document& aDocument)
|
|||
? StyleDirection::Rtl
|
||||
: StyleDirection::Ltr),
|
||||
mVisible(StyleVisibility::Visible),
|
||||
mImageRendering(NS_STYLE_IMAGE_RENDERING_AUTO),
|
||||
mImageRendering(StyleImageRendering::Auto),
|
||||
mWritingMode(NS_STYLE_WRITING_MODE_HORIZONTAL_TB),
|
||||
mTextOrientation(StyleTextOrientation::Mixed),
|
||||
mColorAdjust(StyleColorAdjust::Economy) {
|
||||
|
|
|
@ -1261,7 +1261,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility {
|
|||
mozilla::StyleImageOrientation mImageOrientation;
|
||||
mozilla::StyleDirection mDirection;
|
||||
mozilla::StyleVisibility mVisible;
|
||||
uint8_t mImageRendering; // NS_STYLE_IMAGE_RENDERING_*
|
||||
mozilla::StyleImageRendering mImageRendering;
|
||||
uint8_t mWritingMode; // NS_STYLE_WRITING_MODE_*
|
||||
mozilla::StyleTextOrientation mTextOrientation;
|
||||
mozilla::StyleColorAdjust mColorAdjust;
|
||||
|
|
|
@ -78,6 +78,7 @@ ${helpers.single_keyword(
|
|||
extra_servo_2013_values="pixelated",
|
||||
extra_servo_2020_values="pixelated",
|
||||
gecko_aliases="-moz-crisp-edges=crisp-edges",
|
||||
gecko_enum_prefix="StyleImageRendering",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-images/#propdef-image-rendering",
|
||||
)}
|
||||
|
|
Загрузка…
Ссылка в новой задаче