Modernize SVGRenderStyleDefs.h
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 15:20:04 +0000 (15:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2018 15:20:04 +0000 (15:20 +0000)
commit3106c3c45f5d3f45145e92f6e8f50aea156bcd2b
treee73682ac8cdeef6160d70786d4395fc4705081ac
parentf40c4e25bbeb96c4e2cc10ae116fc0e76dc64f30
Modernize SVGRenderStyleDefs.h
https://bugs.webkit.org/show_bug.cgi?id=186024

Patch by Sam Weinig <sam@webkit.org> on 2018-05-28
Reviewed by Daniel Bates.

Source/WebCore:

Modernized the set of enums in SVGRenderStyleDefs.h and WindRule.h by:
    - Converting them to enum classes
    - Renaming them to remove unnecessary prefix 'E's
    - Renaming values to take advantage of enum class scoping (e.g. StyleDifferenceEqual -> StyleDifference::Equal)
    - Renaming to match modern conventions (e.g BNONE -> None)

Modernizes the following enums:
    SVGPaintType
    BaselineShift (renamed from EBaselineShift)
    TextAnchor (renamed from ETextAnchor)
    ColorInterpolation (renamed from EColorInterpolation)
    ColorRendering (renamed from EColorRendering)
    ShapeRendering (renamed from EShapeRendering)
    GlyphOrientation (renamed from EGlyphOrientation)
    AlignmentBaseline (renamed from EAlignmentBaseline)
    DominantBaseline (renamed from EDominantBaseline)
    VectorEffect (renamed from EVectorEffect)
    BufferedRendering (renamed from EBufferedRendering)
    MaskType (renamed from EMaskType)
    WindRule

* css/CSSBasicShapes.cpp:
(WebCore::buildPathString):
(WebCore::buildPolygonString):
* css/CSSBasicShapes.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WindRule const):
(WebCore::CSSPrimitiveValue::operator AlignmentBaseline const):
(WebCore::CSSPrimitiveValue::operator BufferedRendering const):
(WebCore::CSSPrimitiveValue::operator ColorInterpolation const):
(WebCore::CSSPrimitiveValue::operator ColorRendering const):
(WebCore::CSSPrimitiveValue::operator DominantBaseline const):
(WebCore::CSSPrimitiveValue::operator ShapeRendering const):
(WebCore::CSSPrimitiveValue::operator TextAnchor const):
(WebCore::CSSPrimitiveValue::operator VectorEffect const):
(WebCore::CSSPrimitiveValue::operator MaskType const):
(WebCore::CSSPrimitiveValue::operator EAlignmentBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EBufferedRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorInterpolation const): Deleted.
(WebCore::CSSPrimitiveValue::operator EColorRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator EDominantBaseline const): Deleted.
(WebCore::CSSPrimitiveValue::operator EShapeRendering const): Deleted.
(WebCore::CSSPrimitiveValue::operator ETextAnchor const): Deleted.
(WebCore::CSSPrimitiveValue::operator EVectorEffect const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMaskType const): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::glyphOrientationToCSSPrimitiveValue):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGlyphOrientation):
(WebCore::StyleBuilderConverter::convertGlyphOrientationOrAuto):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueBaselineShift):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeBasicShapePolygon):
(WebCore::consumeBasicShapePath):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::toWindRule):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygon::contains const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::shapeLayerWindRule const):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* platform/graphics/Path.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::drawInsetShadow):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
* platform/graphics/WindRule.h:
(): Deleted.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::shapeWindRule const):
(PlatformCALayerCocoa::setShapeWindRule):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::calculateDrawingMode):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clipPath):
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::contains const):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawAnimation):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::clipBorderSidePolygon):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeClipPath const):
* rendering/style/BasicShapes.h:
(WebCore::BasicShape::windRule const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType const):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType const):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialAlignmentBaseline):
(WebCore::SVGRenderStyle::initialDominantBaseline):
(WebCore::SVGRenderStyle::initialBaselineShift):
(WebCore::SVGRenderStyle::initialVectorEffect):
(WebCore::SVGRenderStyle::initialBufferedRendering):
(WebCore::SVGRenderStyle::initialClipRule):
(WebCore::SVGRenderStyle::initialColorInterpolation):
(WebCore::SVGRenderStyle::initialColorInterpolationFilters):
(WebCore::SVGRenderStyle::initialColorRendering):
(WebCore::SVGRenderStyle::initialFillRule):
(WebCore::SVGRenderStyle::initialShapeRendering):
(WebCore::SVGRenderStyle::initialTextAnchor):
(WebCore::SVGRenderStyle::initialGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::initialGlyphOrientationVertical):
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::initialMaskType):
(WebCore::SVGRenderStyle::setAlignmentBaseline):
(WebCore::SVGRenderStyle::setDominantBaseline):
(WebCore::SVGRenderStyle::setBaselineShift):
(WebCore::SVGRenderStyle::setVectorEffect):
(WebCore::SVGRenderStyle::setBufferedRendering):
(WebCore::SVGRenderStyle::setClipRule):
(WebCore::SVGRenderStyle::setColorInterpolation):
(WebCore::SVGRenderStyle::setColorInterpolationFilters):
(WebCore::SVGRenderStyle::setColorRendering):
(WebCore::SVGRenderStyle::setFillRule):
(WebCore::SVGRenderStyle::setShapeRendering):
(WebCore::SVGRenderStyle::setTextAnchor):
(WebCore::SVGRenderStyle::setGlyphOrientationHorizontal):
(WebCore::SVGRenderStyle::setGlyphOrientationVertical):
(WebCore::SVGRenderStyle::setMaskType):
(WebCore::SVGRenderStyle::alignmentBaseline const):
(WebCore::SVGRenderStyle::dominantBaseline const):
(WebCore::SVGRenderStyle::baselineShift const):
(WebCore::SVGRenderStyle::vectorEffect const):
(WebCore::SVGRenderStyle::bufferedRendering const):
(WebCore::SVGRenderStyle::clipRule const):
(WebCore::SVGRenderStyle::colorInterpolation const):
(WebCore::SVGRenderStyle::colorInterpolationFilters const):
(WebCore::SVGRenderStyle::colorRendering const):
(WebCore::SVGRenderStyle::fillRule const):
(WebCore::SVGRenderStyle::shapeRendering const):
(WebCore::SVGRenderStyle::textAnchor const):
(WebCore::SVGRenderStyle::glyphOrientationHorizontal const):
(WebCore::SVGRenderStyle::glyphOrientationVertical const):
(WebCore::SVGRenderStyle::fillPaintType const):
(WebCore::SVGRenderStyle::strokePaintType const):
(WebCore::SVGRenderStyle::maskType const):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType const):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType const):
(WebCore::SVGRenderStyle::hasStroke const):
(WebCore::SVGRenderStyle::hasFill const):
(WebCore::SVGRenderStyle::setBitDefaults):
* rendering/style/SVGRenderStyleDefs.h:
(WebCore::StyleFillData::create):
(WebCore::StyleFillData::operator!= const):
(WebCore::StyleStrokeData::create):
(WebCore::StyleStrokeData::operator!= const):
(WebCore::StyleStopData::create):
(WebCore::StyleStopData::operator!= const):
(WebCore::StyleTextData::create):
(WebCore::StyleTextData::operator!= const):
(WebCore::StyleMiscData::create):
(WebCore::StyleMiscData::operator!= const):
(WebCore::StyleShadowSVGData::create):
(WebCore::StyleShadowSVGData::operator!= const):
(WebCore::StyleResourceData::create):
(WebCore::StyleResourceData::operator!= const):
(WebCore::StyleInheritedResourceData::create):
(WebCore::StyleInheritedResourceData::operator!= const):
(WebCore::StyleLayoutData::create):
(WebCore::StyleLayoutData::operator!= const):
(): Deleted.
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::applyResource):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::hasNonScalingStroke const):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
(WebCore::writeSVGInlineTextBox):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::dominantBaselineToAlignmentBaseline const):
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift const):
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
* rendering/svg/SVGTextLayoutEngineBaseline.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
Update for new enum names.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
55 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSBasicShapes.cpp
Source/WebCore/css/CSSBasicShapes.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/graphics/FloatPolygon.cpp
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsTypes.cpp
Source/WebCore/platform/graphics/Path.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/WindRule.h
Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
Source/WebCore/platform/graphics/cairo/CairoOperations.h
Source/WebCore/platform/graphics/cairo/PathCairo.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/PathCG.cpp
Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp
Source/WebCore/platform/graphics/win/PathDirect2D.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/style/BasicShapes.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/rendering/style/SVGRenderStyleDefs.h
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGRect.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGShape.h
Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/rendering/svg/SVGTextChunk.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm