зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1597741 : use Enum class for NS_STYLE_SHAPE_RENDERING instead of #define r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53840 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a387bde283
Коммит
6482a37fc1
|
@ -128,6 +128,7 @@ rusty-enums = [
|
|||
"mozilla::StyleFlexWrap",
|
||||
"mozilla::StyleTextDecorationSkipInk",
|
||||
"mozilla::StyleTextDecorationLength",
|
||||
"mozilla::StyleShapeRendering",
|
||||
"nsStyleImageType",
|
||||
"nsINode_BooleanFlag",
|
||||
"mozilla::PseudoStyleType",
|
||||
|
|
|
@ -763,10 +763,12 @@ enum class StyleWhiteSpace : uint8_t {
|
|||
#define NS_STYLE_MASK_TYPE_ALPHA 1
|
||||
|
||||
// shape-rendering
|
||||
#define NS_STYLE_SHAPE_RENDERING_AUTO 0
|
||||
#define NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED 1
|
||||
#define NS_STYLE_SHAPE_RENDERING_CRISPEDGES 2
|
||||
#define NS_STYLE_SHAPE_RENDERING_GEOMETRICPRECISION 3
|
||||
enum class StyleShapeRendering : uint8_t {
|
||||
Auto,
|
||||
Optimizespeed,
|
||||
Crispedges,
|
||||
Geometricprecision,
|
||||
};
|
||||
|
||||
// stroke-linecap
|
||||
#define NS_STYLE_STROKE_LINECAP_BUTT 0
|
||||
|
|
|
@ -742,7 +742,7 @@ nsStyleSVG::nsStyleSVG(const Document& aDocument)
|
|||
mColorInterpolationFilters(NS_STYLE_COLOR_INTERPOLATION_LINEARRGB),
|
||||
mFillRule(StyleFillRule::Nonzero),
|
||||
mPaintOrder(0),
|
||||
mShapeRendering(NS_STYLE_SHAPE_RENDERING_AUTO),
|
||||
mShapeRendering(StyleShapeRendering::Auto),
|
||||
mStrokeLinecap(NS_STYLE_STROKE_LINECAP_BUTT),
|
||||
mStrokeLinejoin(NS_STYLE_STROKE_LINEJOIN_MITER),
|
||||
mDominantBaseline(NS_STYLE_DOMINANT_BASELINE_AUTO),
|
||||
|
|
|
@ -2219,7 +2219,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVG {
|
|||
uint8_t mColorInterpolationFilters; // NS_STYLE_COLOR_INTERPOLATION_*
|
||||
mozilla::StyleFillRule mFillRule;
|
||||
mozilla::StyleSVGPaintOrder mPaintOrder;
|
||||
uint8_t mShapeRendering; // NS_STYLE_SHAPE_RENDERING_*
|
||||
mozilla::StyleShapeRendering mShapeRendering;
|
||||
uint8_t mStrokeLinecap; // NS_STYLE_STROKE_LINECAP_*
|
||||
uint8_t mStrokeLinejoin; // NS_STYLE_STROKE_LINEJOIN_*
|
||||
uint8_t mDominantBaseline; // NS_STYLE_DOMINANT_BASELINE_*
|
||||
|
|
|
@ -657,8 +657,8 @@ void SVGGeometryFrame::Render(gfxContext* aContext, uint32_t aRenderComponents,
|
|||
SVGGeometryElement* element = static_cast<SVGGeometryElement*>(GetContent());
|
||||
|
||||
AntialiasMode aaMode =
|
||||
(StyleSVG()->mShapeRendering == NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED ||
|
||||
StyleSVG()->mShapeRendering == NS_STYLE_SHAPE_RENDERING_CRISPEDGES)
|
||||
(StyleSVG()->mShapeRendering == StyleShapeRendering::Optimizespeed ||
|
||||
StyleSVG()->mShapeRendering == StyleShapeRendering::Crispedges)
|
||||
? AntialiasMode::NONE
|
||||
: AntialiasMode::SUBPIXEL;
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ ${helpers.single_keyword(
|
|||
engines="gecko",
|
||||
animation_value_type="discrete",
|
||||
spec="https://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty",
|
||||
gecko_enum_prefix = "StyleShapeRendering",
|
||||
)}
|
||||
|
||||
${helpers.predefined_type(
|
||||
|
|
Загрузка…
Ссылка в новой задаче