Title: [234610] trunk/Source
Revision
234610
Author
commit-qu...@webkit.org
Date
2018-08-06 11:19:43 -0700 (Mon, 06 Aug 2018)

Log Message

Make BlendMode an enum class
https://bugs.webkit.org/show_bug.cgi?id=188325

Patch by Alex Christensen <achristen...@webkit.org> on 2018-08-06
Reviewed by Darin Adler.

Source/WebCore:

No change in behavior.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator BlendMode const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::State::State):
(WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
(WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
* platform/graphics/BitmapImage.h:
* platform/graphics/GraphicsContext.h:
(WebCore::ImagePaintingOptions::ImagePaintingOptions):
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsTypes.cpp:
(WebCore::parseBlendMode):
(WebCore::parseCompositeAndBlendOperator):
(WebCore::compositeOperatorName):
(WebCore::blendModeName):
(WebCore::operator<<):
* platform/graphics/GraphicsTypes.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::selectCGBlendMode):
* platform/graphics/cpu/arm/filters/FEBlendNEON.h:
(WebCore::FEBlend::platformApplyNEON):
* platform/graphics/displaylists/DisplayListItems.h:
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::externalRepresentation const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateBlendMode):
(WebCore::RenderLayer::beginTransparencyLayers):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBlendMode):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
(WebCore::FillLayer::hasOpaqueImage const):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::initialFillBlendMode):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setBlendMode):
(WebCore::RenderStyle::hasBlendMode const):
(WebCore::RenderStyle::blendMode const):
(WebCore::RenderStyle::initialBlendMode):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
* svg/SVGAnimatedEnumeration.cpp:
(WebCore::enumerationValueForTargetAttribute):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::SVGFEBlendElement):
(WebCore::SVGFEBlendElement::parseAttribute):
* svg/SVGFEBlendElement.h:
(WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
(WebCore::SVGPropertyTraits<BlendMode>::toString):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::drawPatternForContainer):
(WebCore::SVGImage::draw):

Source/WebKit:

* Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234609 => 234610)


--- trunk/Source/WebCore/ChangeLog	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/ChangeLog	2018-08-06 18:19:43 UTC (rev 234610)
@@ -1,3 +1,87 @@
+2018-08-06  Alex Christensen  <achristen...@webkit.org>
+
+        Make BlendMode an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=188325
+
+        Reviewed by Darin Adler.
+
+        No change in behavior.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator BlendMode const):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::parseAttribute):
+        * html/canvas/CanvasRenderingContext2DBase.cpp:
+        (WebCore::CanvasRenderingContext2DBase::State::State):
+        (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
+        (WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
+        * platform/graphics/BitmapImage.h:
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::ImagePaintingOptions::ImagePaintingOptions):
+        * platform/graphics/GraphicsContextImpl.h:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::dumpProperties const):
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/GraphicsTypes.cpp:
+        (WebCore::parseBlendMode):
+        (WebCore::parseCompositeAndBlendOperator):
+        (WebCore::compositeOperatorName):
+        (WebCore::blendModeName):
+        (WebCore::operator<<):
+        * platform/graphics/GraphicsTypes.h:
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::drawTiled):
+        * platform/graphics/Image.h:
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
+        (PlatformCAFilters::setBlendingFiltersOnLayer):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::selectCGBlendMode):
+        * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
+        (WebCore::FEBlend::platformApplyNEON):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        * platform/graphics/filters/FEBlend.cpp:
+        (WebCore::FEBlend::externalRepresentation const):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintFillLayers):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintIntoRect):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::RenderLayer):
+        (WebCore::RenderLayer::updateBlendMode):
+        (WebCore::RenderLayer::beginTransparencyLayers):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateBlendMode):
+        * rendering/style/FillLayer.cpp:
+        (WebCore::FillLayer::FillLayer):
+        (WebCore::FillLayer::hasOpaqueImage const):
+        * rendering/style/FillLayer.h:
+        (WebCore::FillLayer::initialFillBlendMode):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::setBlendMode):
+        (WebCore::RenderStyle::hasBlendMode const):
+        (WebCore::RenderStyle::blendMode const):
+        (WebCore::RenderStyle::initialBlendMode):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+        * svg/SVGAnimatedEnumeration.cpp:
+        (WebCore::enumerationValueForTargetAttribute):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::SVGFEBlendElement):
+        (WebCore::SVGFEBlendElement::parseAttribute):
+        * svg/SVGFEBlendElement.h:
+        (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
+        (WebCore::SVGPropertyTraits<BlendMode>::toString):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::nativeImageForCurrentFrame):
+        (WebCore::SVGImage::nativeImage):
+        (WebCore::SVGImage::drawPatternForContainer):
+        (WebCore::SVGImage::draw):
+
 2018-08-06  Aditya Keerthi  <akeer...@apple.com>
 
         [iOS] Indeterminate checkboxes appear unchecked

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (234609 => 234610)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -3903,58 +3903,58 @@
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (blendMode) {
-    case BlendModeNormal:
+    case BlendMode::Normal:
         m_value.valueID = CSSValueNormal;
         break;
-    case BlendModeMultiply:
+    case BlendMode::Multiply:
         m_value.valueID = CSSValueMultiply;
         break;
-    case BlendModeScreen:
+    case BlendMode::Screen:
         m_value.valueID = CSSValueScreen;
         break;
-    case BlendModeOverlay:
+    case BlendMode::Overlay:
         m_value.valueID = CSSValueOverlay;
         break;
-    case BlendModeDarken:
+    case BlendMode::Darken:
         m_value.valueID = CSSValueDarken;
         break;
-    case BlendModeLighten:
+    case BlendMode::Lighten:
         m_value.valueID = CSSValueLighten;
         break;
-    case BlendModeColorDodge:
+    case BlendMode::ColorDodge:
         m_value.valueID = CSSValueColorDodge;
         break;
-    case BlendModeColorBurn:
+    case BlendMode::ColorBurn:
         m_value.valueID = CSSValueColorBurn;
         break;
-    case BlendModeHardLight:
+    case BlendMode::HardLight:
         m_value.valueID = CSSValueHardLight;
         break;
-    case BlendModeSoftLight:
+    case BlendMode::SoftLight:
         m_value.valueID = CSSValueSoftLight;
         break;
-    case BlendModeDifference:
+    case BlendMode::Difference:
         m_value.valueID = CSSValueDifference;
         break;
-    case BlendModeExclusion:
+    case BlendMode::Exclusion:
         m_value.valueID = CSSValueExclusion;
         break;
-    case BlendModeHue:
+    case BlendMode::Hue:
         m_value.valueID = CSSValueHue;
         break;
-    case BlendModeSaturation:
+    case BlendMode::Saturation:
         m_value.valueID = CSSValueSaturation;
         break;
-    case BlendModeColor:
+    case BlendMode::Color:
         m_value.valueID = CSSValueColor;
         break;
-    case BlendModeLuminosity:
+    case BlendMode::Luminosity:
         m_value.valueID = CSSValueLuminosity;
         break;
-    case BlendModePlusDarker:
+    case BlendMode::PlusDarker:
         m_value.valueID = CSSValuePlusDarker;
         break;
-    case BlendModePlusLighter:
+    case BlendMode::PlusLighter:
         m_value.valueID = CSSValuePlusLighter;
         break;
     }
@@ -3966,47 +3966,47 @@
 
     switch (m_value.valueID) {
     case CSSValueNormal:
-        return BlendModeNormal;
+        return BlendMode::Normal;
     case CSSValueMultiply:
-        return BlendModeMultiply;
+        return BlendMode::Multiply;
     case CSSValueScreen:
-        return BlendModeScreen;
+        return BlendMode::Screen;
     case CSSValueOverlay:
-        return BlendModeOverlay;
+        return BlendMode::Overlay;
     case CSSValueDarken:
-        return BlendModeDarken;
+        return BlendMode::Darken;
     case CSSValueLighten:
-        return BlendModeLighten;
+        return BlendMode::Lighten;
     case CSSValueColorDodge:
-        return BlendModeColorDodge;
+        return BlendMode::ColorDodge;
     case CSSValueColorBurn:
-        return BlendModeColorBurn;
+        return BlendMode::ColorBurn;
     case CSSValueHardLight:
-        return BlendModeHardLight;
+        return BlendMode::HardLight;
     case CSSValueSoftLight:
-        return BlendModeSoftLight;
+        return BlendMode::SoftLight;
     case CSSValueDifference:
-        return BlendModeDifference;
+        return BlendMode::Difference;
     case CSSValueExclusion:
-        return BlendModeExclusion;
+        return BlendMode::Exclusion;
     case CSSValueHue:
-        return BlendModeHue;
+        return BlendMode::Hue;
     case CSSValueSaturation:
-        return BlendModeSaturation;
+        return BlendMode::Saturation;
     case CSSValueColor:
-        return BlendModeColor;
+        return BlendMode::Color;
     case CSSValueLuminosity:
-        return BlendModeLuminosity;
+        return BlendMode::Luminosity;
     case CSSValuePlusDarker:
-        return BlendModePlusDarker;
+        return BlendMode::PlusDarker;
     case CSSValuePlusLighter:
-        return BlendModePlusLighter;
+        return BlendMode::PlusLighter;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return BlendModeNormal;
+    return BlendMode::Normal;
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Isolation isolation)

Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (234609 => 234610)


--- trunk/Source/WebCore/html/HTMLImageElement.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -221,7 +221,7 @@
             treeScope().addImageElementByUsemap(*m_parsedUsemap.impl(), *this);
     } else if (name == compositeAttr) {
         // FIXME: images don't support blend modes in their compositing attribute.
-        BlendMode blendOp = BlendModeNormal;
+        BlendMode blendOp = BlendMode::Normal;
         if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp))
             m_compositeOperator = CompositeSourceOver;
 #if ENABLE(SERVICE_CONTROLS)

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (234609 => 234610)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -199,7 +199,7 @@
     , shadowColor(Color::transparent)
     , globalAlpha(1)
     , globalComposite(CompositeSourceOver)
-    , globalBlend(BlendModeNormal)
+    , globalBlend(BlendMode::Normal)
     , hasInvertibleTransform(true)
     , lineDashOffset(0)
     , imageSmoothingEnabled(true)
@@ -774,7 +774,7 @@
 void CanvasRenderingContext2DBase::setGlobalCompositeOperation(const String& operation)
 {
     CompositeOperator op = CompositeSourceOver;
-    BlendMode blendMode = BlendModeNormal;
+    BlendMode blendMode = BlendMode::Normal;
     if (!parseCompositeAndBlendOperator(operation, op, blendMode))
         return;
     if ((state().globalComposite == op) && (state().globalBlend == blendMode))
@@ -1714,10 +1714,10 @@
 void CanvasRenderingContext2DBase::drawImageFromRect(HTMLImageElement& imageElement, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, const String& compositeOperation)
 {
     CompositeOperator op;
-    auto blendOp = BlendModeNormal;
-    if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendModeNormal)
+    auto blendOp = BlendMode::Normal;
+    if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendMode::Normal)
         op = CompositeSourceOver;
-    drawImage(imageElement, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh }, op, BlendModeNormal);
+    drawImage(imageElement, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh }, op, BlendMode::Normal);
 }
 
 void CanvasRenderingContext2DBase::clearCanvas()

Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/BitmapImage.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -162,7 +162,7 @@
     void destroyDecodedDataIfNecessary(bool destroyAll = true);
 
     ImageDrawResult draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, DecodingMode, ImageOrientationDescription) override;
-    void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal) override;
+    void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal) override;
 #if PLATFORM(WIN)
     void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator) override;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -184,7 +184,7 @@
 
     float alpha { 1 };
     CompositeOperator compositeOperator { CompositeSourceOver };
-    BlendMode blendMode { BlendModeNormal };
+    BlendMode blendMode { BlendMode::Normal };
     InterpolationQuality imageInterpolationQuality { InterpolationDefault };
 
     bool shouldAntialias : 1;
@@ -198,7 +198,7 @@
 };
 
 struct ImagePaintingOptions {
-    ImagePaintingOptions(CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendModeNormal, DecodingMode decodingMode = DecodingMode::Synchronous, ImageOrientationDescription orientationDescription = ImageOrientationDescription(), InterpolationQuality interpolationQuality = InterpolationDefault)
+    ImagePaintingOptions(CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendMode::Normal, DecodingMode decodingMode = DecodingMode::Synchronous, ImageOrientationDescription orientationDescription = ImageOrientationDescription(), InterpolationQuality interpolationQuality = InterpolationDefault)
         : m_compositeOperator(compositeOperator)
         , m_blendMode(blendMode)
         , m_decodingMode(decodingMode)
@@ -207,7 +207,7 @@
     {
     }
 
-    ImagePaintingOptions(ImageOrientationDescription orientationDescription, InterpolationQuality interpolationQuality = InterpolationDefault, CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendModeNormal, DecodingMode decodingMode = DecodingMode::Synchronous)
+    ImagePaintingOptions(ImageOrientationDescription orientationDescription, InterpolationQuality interpolationQuality = InterpolationDefault, CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendMode::Normal, DecodingMode decodingMode = DecodingMode::Synchronous)
         : m_compositeOperator(compositeOperator)
         , m_blendMode(blendMode)
         , m_decodingMode(decodingMode)
@@ -216,7 +216,7 @@
     {
     }
 
-    ImagePaintingOptions(InterpolationQuality interpolationQuality, ImageOrientationDescription orientationDescription = ImageOrientationDescription(), CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendModeNormal, DecodingMode decodingMode = DecodingMode::Synchronous)
+    ImagePaintingOptions(InterpolationQuality interpolationQuality, ImageOrientationDescription orientationDescription = ImageOrientationDescription(), CompositeOperator compositeOperator = CompositeSourceOver, BlendMode blendMode = BlendMode::Normal, DecodingMode decodingMode = DecodingMode::Synchronous)
         : m_compositeOperator(compositeOperator)
         , m_blendMode(blendMode)
         , m_decodingMode(decodingMode)
@@ -326,7 +326,7 @@
     const GraphicsContextState& state() const { return m_state; }
 
 #if USE(CG) || USE(DIRECT2D) || USE(CAIRO)
-    WEBCORE_EXPORT void drawNativeImage(const NativeImagePtr&, const FloatSize& selfSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientation = ImageOrientation());
+    WEBCORE_EXPORT void drawNativeImage(const NativeImagePtr&, const FloatSize& selfSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendMode::Normal, ImageOrientation = ImageOrientation());
 #endif
 
 #if USE(CG) || USE(DIRECT2D)
@@ -364,8 +364,8 @@
     WEBCORE_EXPORT void fillRect(const FloatRect&);
     WEBCORE_EXPORT void fillRect(const FloatRect&, const Color&);
     void fillRect(const FloatRect&, Gradient&);
-    void fillRect(const FloatRect&, const Color&, CompositeOperator, BlendMode = BlendModeNormal);
-    void fillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode = BlendModeNormal);
+    void fillRect(const FloatRect&, const Color&, CompositeOperator, BlendMode = BlendMode::Normal);
+    void fillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode = BlendMode::Normal);
     void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&);
 
     WEBCORE_EXPORT void clearRect(const FloatRect&);
@@ -384,7 +384,7 @@
     void drawImageBuffer(ImageBuffer&, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
     void drawImageBuffer(ImageBuffer&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
 
-    void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal);
+    void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal);
 
     WEBCORE_EXPORT void drawConsumingImageBuffer(std::unique_ptr<ImageBuffer>, const FloatPoint& destination, const ImagePaintingOptions& = ImagePaintingOptions());
     void drawConsumingImageBuffer(std::unique_ptr<ImageBuffer>, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
@@ -456,7 +456,7 @@
     void setAlpha(float);
     float alpha() const { return m_state.alpha; }
 
-    WEBCORE_EXPORT void setCompositeOperation(CompositeOperator, BlendMode = BlendModeNormal);
+    WEBCORE_EXPORT void setCompositeOperation(CompositeOperator, BlendMode = BlendMode::Normal);
     CompositeOperator compositeOperation() const { return m_state.compositeOperator; }
     BlendMode blendModeOperation() const { return m_state.blendMode; }
 
@@ -614,7 +614,7 @@
     void clearPlatformShadow();
 
     void setPlatformAlpha(float);
-    void setPlatformCompositeOperation(CompositeOperator, BlendMode = BlendModeNormal);
+    void setPlatformCompositeOperation(CompositeOperator, BlendMode = BlendMode::Normal);
 
     void beginPlatformTransparencyLayer(float opacity);
     void endPlatformTransparencyLayer();

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -74,7 +74,7 @@
 #if USE(CG) || USE(CAIRO)
     virtual void drawNativeImage(const NativeImagePtr&, const FloatSize& selfSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientation) = 0;
 #endif
-    virtual void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal) = 0;
+    virtual void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal) = 0;
 
     virtual void drawRect(const FloatRect&, float borderThickness) = 0;
     virtual void drawLine(const FloatPoint&, const FloatPoint&) = 0;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -761,7 +761,7 @@
         ts << indent << "(opacity " << m_opacity << ")\n";
 
 #if ENABLE(CSS_COMPOSITING)
-    if (m_blendMode != BlendModeNormal)
+    if (m_blendMode != BlendMode::Normal)
         ts << indent << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")\n";
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -648,7 +648,7 @@
     FilterOperations m_backdropFilters;
 
 #if ENABLE(CSS_COMPOSITING)
-    BlendMode m_blendMode { BlendModeNormal };
+    BlendMode m_blendMode { BlendMode::Normal };
 #endif
 
     const Type m_type;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -72,13 +72,13 @@
     "plus-lighter"
 };
 const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames);
-const int numBlendOperatorNames = WTF_ARRAY_LENGTH(blendOperatorNames);
+const unsigned numBlendOperatorNames = WTF_ARRAY_LENGTH(blendOperatorNames);
 
 bool parseBlendMode(const String& s, BlendMode& blendMode)
 {
-    for (int i = 0; i < numBlendOperatorNames; i++) {
+    for (unsigned i = 0; i < numBlendOperatorNames; i++) {
         if (s == blendOperatorNames[i]) {
-            blendMode = static_cast<BlendMode>(i + BlendModeNormal);
+            blendMode = static_cast<BlendMode>(i + static_cast<unsigned>(BlendMode::Normal));
             return true;
         }
     }
@@ -91,7 +91,7 @@
     for (int i = 0; i < numCompositeOperatorNames; i++) {
         if (s == compositeOperatorNames[i]) {
             op = static_cast<CompositeOperator>(i);
-            blendOp = BlendModeNormal;
+            blendOp = BlendMode::Normal;
             return true;
         }
     }
@@ -111,23 +111,23 @@
 {
     ASSERT(op >= 0);
     ASSERT(op < numCompositeOperatorNames);
-    ASSERT(blendOp >= BlendModeNormal);
-    ASSERT(blendOp <= numBlendOperatorNames);
-    if (blendOp > BlendModeNormal)
-        return blendOperatorNames[blendOp - BlendModeNormal];
+    ASSERT(blendOp >= BlendMode::Normal);
+    ASSERT(static_cast<unsigned>(blendOp) <= numBlendOperatorNames);
+    if (blendOp > BlendMode::Normal)
+        return blendOperatorNames[static_cast<unsigned>(blendOp) - static_cast<unsigned>(BlendMode::Normal)];
     return compositeOperatorNames[op];
 }
 
 String blendModeName(BlendMode blendOp)
 {
-    ASSERT(blendOp >= BlendModeNormal);
-    ASSERT(blendOp <= BlendModePlusLighter);
-    return blendOperatorNames[blendOp - BlendModeNormal];
+    ASSERT(blendOp >= BlendMode::Normal);
+    ASSERT(blendOp <= BlendMode::PlusLighter);
+    return blendOperatorNames[static_cast<unsigned>(blendOp) - static_cast<unsigned>(BlendMode::Normal)];
 }
 
 TextStream& operator<<(TextStream& ts, CompositeOperator op)
 {
-    return ts << compositeOperatorName(op, BlendModeNormal);
+    return ts << compositeOperatorName(op, BlendMode::Normal);
 }
 
 TextStream& operator<<(TextStream& ts, BlendMode blendMode)

Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -51,25 +51,25 @@
     CompositeDifference
 };
 
-enum BlendMode {
-    BlendModeNormal = 1, // Start with 1 to match SVG's blendmode enumeration.
-    BlendModeMultiply,
-    BlendModeScreen,
-    BlendModeDarken,
-    BlendModeLighten,
-    BlendModeOverlay,
-    BlendModeColorDodge,
-    BlendModeColorBurn,
-    BlendModeHardLight,
-    BlendModeSoftLight,
-    BlendModeDifference,
-    BlendModeExclusion,
-    BlendModeHue,
-    BlendModeSaturation,
-    BlendModeColor,
-    BlendModeLuminosity,
-    BlendModePlusDarker,
-    BlendModePlusLighter
+enum class BlendMode {
+    Normal = 1, // Start with 1 to match SVG's blendmode enumeration.
+    Multiply,
+    Screen,
+    Darken,
+    Lighten,
+    Overlay,
+    ColorDodge,
+    ColorBurn,
+    HardLight,
+    SoftLight,
+    Difference,
+    Exclusion,
+    Hue,
+    Saturation,
+    Color,
+    Luminosity,
+    PlusDarker,
+    PlusLighter
 };
 
 enum GradientSpreadMethod {

Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/Image.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -196,7 +196,7 @@
             visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
             visibleSrcRect.setWidth(1);
             visibleSrcRect.setHeight(destRect.height() / scale.height());
-            return draw(ctxt, destRect, visibleSrcRect, op, BlendModeNormal, decodingMode, ImageOrientationDescription());
+            return draw(ctxt, destRect, visibleSrcRect, op, BlendMode::Normal, decodingMode, ImageOrientationDescription());
         }
         if (size().height() == 1 && intersection(oneTileRect, destRect).width() == destRect.width()) {
             FloatRect visibleSrcRect;
@@ -204,7 +204,7 @@
             visibleSrcRect.setY(0);
             visibleSrcRect.setWidth(destRect.width() / scale.width());
             visibleSrcRect.setHeight(1);
-            return draw(ctxt, destRect, visibleSrcRect, op, BlendModeNormal, decodingMode, ImageOrientationDescription());
+            return draw(ctxt, destRect, visibleSrcRect, op, BlendMode::Normal, decodingMode, ImageOrientationDescription());
         }
     }
 #endif
@@ -236,7 +236,7 @@
                 FloatRect fromRect(toFloatPoint(currentTileRect.location() - oneTileRect.location()), currentTileRect.size());
                 fromRect.scale(1 / scale.width(), 1 / scale.height());
 
-                result = draw(ctxt, toRect, fromRect, op, BlendModeNormal, decodingMode, ImageOrientationDescription());
+                result = draw(ctxt, toRect, fromRect, op, BlendMode::Normal, decodingMode, ImageOrientationDescription());
                 if (result == ImageDrawResult::DidRequestDecoding)
                     return result;
                 toX += currentTileRect.width();

Modified: trunk/Source/WebCore/platform/graphics/Image.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/Image.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/Image.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -174,7 +174,7 @@
 #endif
 
     virtual void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal);
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal);
 
 #if !ASSERT_DISABLED
     virtual bool notSolidColor() { return true; }

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -144,10 +144,10 @@
     void flushContext() const;
 #endif
     
-    void draw(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
-    void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal);
+    void draw(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendMode::Normal);
+    void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal);
 
-    static void drawConsuming(std::unique_ptr<ImageBuffer>, GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
+    static void drawConsuming(std::unique_ptr<ImageBuffer>, GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendMode::Normal);
 
     inline void genericConvertToLuminanceMask();
 

Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm	2018-08-06 18:19:43 UTC (rev 234610)
@@ -556,52 +556,52 @@
     CAFilter* filter = nil;
 
     switch (blendMode) {
-    case BlendModeNormal:
+    case BlendMode::Normal:
         // No need to set an actual filter object in this case.
         break;
-    case BlendModeOverlay:
+    case BlendMode::Overlay:
         filter = [CAFilter filterWithType:kCAFilterOverlayBlendMode];
         break;
-    case BlendModeColorDodge:
+    case BlendMode::ColorDodge:
         filter = [CAFilter filterWithType:kCAFilterColorDodgeBlendMode];
         break;
-    case BlendModeColorBurn:
+    case BlendMode::ColorBurn:
         filter = [CAFilter filterWithType:kCAFilterColorBurnBlendMode];
         break;
-    case BlendModeDarken:
+    case BlendMode::Darken:
         filter = [CAFilter filterWithType:kCAFilterDarkenBlendMode];
         break;
-    case BlendModeDifference:
+    case BlendMode::Difference:
         filter = [CAFilter filterWithType:kCAFilterDifferenceBlendMode];
         break;
-    case BlendModeExclusion:
+    case BlendMode::Exclusion:
         filter = [CAFilter filterWithType:kCAFilterExclusionBlendMode];
         break;
-    case BlendModeHardLight:
+    case BlendMode::HardLight:
         filter = [CAFilter filterWithType:kCAFilterHardLightBlendMode];
         break;
-    case BlendModeMultiply:
+    case BlendMode::Multiply:
         filter = [CAFilter filterWithType:kCAFilterMultiplyBlendMode];
         break;
-    case BlendModeLighten:
+    case BlendMode::Lighten:
         filter = [CAFilter filterWithType:kCAFilterLightenBlendMode];
         break;
-    case BlendModeSoftLight:
+    case BlendMode::SoftLight:
         filter = [CAFilter filterWithType:kCAFilterSoftLightBlendMode];
         break;
-    case BlendModeScreen:
+    case BlendMode::Screen:
         filter = [CAFilter filterWithType:kCAFilterScreenBlendMode];
         break;
-    case BlendModePlusDarker:
+    case BlendMode::PlusDarker:
         filter = [CAFilter filterWithType:kCAFilterPlusD];
         break;
-    case BlendModePlusLighter:
+    case BlendMode::PlusLighter:
         filter = [CAFilter filterWithType:kCAFilterPlusL];
         break;
-    case BlendModeHue:
-    case BlendModeSaturation:
-    case BlendModeColor:
-    case BlendModeLuminosity:
+    case BlendMode::Hue:
+    case BlendMode::Saturation:
+    case BlendMode::Color:
+    case BlendMode::Luminosity:
         // FIXME: CA does't support non-separable blend modes on compositing filters.
         break;
     default:

Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -178,8 +178,7 @@
         return;
 
     if (auto surface = image->nativeImageForCurrentFrame()) {
-        drawNativeImage(platformContext, surface.get(), FloatRect(roundedIntPoint(layerOrigin), layerSize), FloatRect(FloatPoint(), layerSize),
-            shadowState.globalCompositeOperator, BlendModeNormal, ImageOrientation(),
+        drawNativeImage(platformContext, surface.get(), FloatRect(roundedIntPoint(layerOrigin), layerSize), FloatRect(FloatPoint(), layerSize), shadowState.globalCompositeOperator, BlendMode::Normal, ImageOrientation(),
             InterpolationDefault, shadowState.globalAlpha, ShadowState());
     }
 }
@@ -837,8 +836,8 @@
     platformContext.save();
 
     // Set the compositing operation.
-    if (compositeOperator == CompositeSourceOver && blendMode == BlendModeNormal && !cairoSurfaceHasAlpha(surface))
-        Cairo::State::setCompositeOperation(platformContext, CompositeCopy, BlendModeNormal);
+    if (compositeOperator == CompositeSourceOver && blendMode == BlendMode::Normal && !cairoSurfaceHasAlpha(surface))
+        Cairo::State::setCompositeOperation(platformContext, CompositeCopy, BlendMode::Normal);
     else
         Cairo::State::setCompositeOperation(platformContext, compositeOperator, blendMode);
 

Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -164,37 +164,37 @@
 cairo_operator_t toCairoOperator(CompositeOperator op, BlendMode blendOp)
 {
     switch (blendOp) {
-    case BlendModeNormal:
+    case BlendMode::Normal:
         return toCairoCompositeOperator(op);
-    case BlendModeMultiply:
+    case BlendMode::Multiply:
         return CAIRO_OPERATOR_MULTIPLY;
-    case BlendModeScreen:
+    case BlendMode::Screen:
         return CAIRO_OPERATOR_SCREEN;
-    case BlendModeOverlay:
+    case BlendMode::Overlay:
         return CAIRO_OPERATOR_OVERLAY;
-    case BlendModeDarken:
+    case BlendMode::Darken:
         return CAIRO_OPERATOR_DARKEN;
-    case BlendModeLighten:
+    case BlendMode::Lighten:
         return CAIRO_OPERATOR_LIGHTEN;
-    case BlendModeColorDodge:
+    case BlendMode::ColorDodge:
         return CAIRO_OPERATOR_COLOR_DODGE;
-    case BlendModeColorBurn:
+    case BlendMode::ColorBurn:
         return CAIRO_OPERATOR_COLOR_BURN;
-    case BlendModeHardLight:
+    case BlendMode::HardLight:
         return CAIRO_OPERATOR_HARD_LIGHT;
-    case BlendModeSoftLight:
+    case BlendMode::SoftLight:
         return CAIRO_OPERATOR_SOFT_LIGHT;
-    case BlendModeDifference:
+    case BlendMode::Difference:
         return CAIRO_OPERATOR_DIFFERENCE;
-    case BlendModeExclusion:
+    case BlendMode::Exclusion:
         return CAIRO_OPERATOR_EXCLUSION;
-    case BlendModeHue:
+    case BlendMode::Hue:
         return CAIRO_OPERATOR_HSL_HUE;
-    case BlendModeSaturation:
+    case BlendMode::Saturation:
         return CAIRO_OPERATOR_HSL_SATURATION;
-    case BlendModeColor:
+    case BlendMode::Color:
         return CAIRO_OPERATOR_HSL_COLOR;
-    case BlendModeLuminosity:
+    case BlendMode::Luminosity:
         return CAIRO_OPERATOR_HSL_LUMINOSITY;
     default:
         return CAIRO_OPERATOR_OVER;

Modified: trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -80,7 +80,7 @@
 void setPathOnCairoContext(cairo_t* to, cairo_t* from);
 void appendWebCorePathToCairoContext(cairo_t* context, const Path& path);
 void appendRegionToCairoContext(cairo_t*, const cairo_region_t*);
-cairo_operator_t toCairoOperator(CompositeOperator, BlendMode = BlendModeNormal);
+cairo_operator_t toCairoOperator(CompositeOperator, BlendMode = BlendMode::Normal);
 void drawPatternToCairoContext(cairo_t* cr, cairo_surface_t* image, const IntSize& imageSize, const FloatRect& tileRect,
                                const AffineTransform& patternTransform, const FloatPoint& phase, cairo_operator_t op, const FloatRect& destRect);
 RefPtr<cairo_surface_t> copyCairoImageSurface(cairo_surface_t*);

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -164,7 +164,7 @@
 
     Cairo::State::setCompositeOperation(m_platformContext, compositeOperator, blendMode);
     Cairo::fillRect(m_platformContext, rect, color, Cairo::ShadowState(state));
-    Cairo::State::setCompositeOperation(m_platformContext, previousOperator, BlendModeNormal);
+    Cairo::State::setCompositeOperation(m_platformContext, previousOperator, BlendMode::Normal);
 }
 
 void GraphicsContextImplCairo::fillRoundedRect(const FloatRoundedRect& rect, const Color& color, BlendMode blendMode)
@@ -180,7 +180,7 @@
     else
         Cairo::fillRect(m_platformContext, rect.rect(), color, shadowState);
 
-    Cairo::State::setCompositeOperation(m_platformContext, previousOperator, BlendModeNormal);
+    Cairo::State::setCompositeOperation(m_platformContext, previousOperator, BlendMode::Normal);
 }
 
 void GraphicsContextImplCairo::fillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color&)

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -75,7 +75,7 @@
     ImageDrawResult drawTiledImage(Image&, const FloatRect&, const FloatPoint&, const FloatSize&, const FloatSize&, const ImagePaintingOptions&) override;
     ImageDrawResult drawTiledImage(Image&, const FloatRect&, const FloatRect&, const FloatSize&, Image::TileRule, Image::TileRule, const ImagePaintingOptions&) override;
     void drawNativeImage(const NativeImagePtr&, const FloatSize&, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode, ImageOrientation) override;
-    void drawPattern(Image&, const FloatRect&, const FloatRect&, const AffineTransform&, const FloatPoint&, const FloatSize&, CompositeOperator, BlendMode = BlendModeNormal) override;
+    void drawPattern(Image&, const FloatRect&, const FloatRect&, const AffineTransform&, const FloatPoint&, const FloatSize&, CompositeOperator, BlendMode = BlendMode::Normal) override;
 
     void drawRect(const FloatRect&, float) override;
     void drawLine(const FloatPoint&, const FloatPoint&) override;

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -158,7 +158,7 @@
 static CGBlendMode selectCGBlendMode(CompositeOperator compositeOperator, BlendMode blendMode)
 {
     switch (blendMode) {
-    case BlendModeNormal:
+    case BlendMode::Normal:
         switch (compositeOperator) {
         case CompositeClear:
             return kCGBlendModeClear;
@@ -190,39 +190,39 @@
             return kCGBlendModeDifference;
         }
         break;
-    case BlendModeMultiply:
+    case BlendMode::Multiply:
         return kCGBlendModeMultiply;
-    case BlendModeScreen:
+    case BlendMode::Screen:
         return kCGBlendModeScreen;
-    case BlendModeOverlay:
+    case BlendMode::Overlay:
         return kCGBlendModeOverlay;
-    case BlendModeDarken:
+    case BlendMode::Darken:
         return kCGBlendModeDarken;
-    case BlendModeLighten:
+    case BlendMode::Lighten:
         return kCGBlendModeLighten;
-    case BlendModeColorDodge:
+    case BlendMode::ColorDodge:
         return kCGBlendModeColorDodge;
-    case BlendModeColorBurn:
+    case BlendMode::ColorBurn:
         return kCGBlendModeColorBurn;
-    case BlendModeHardLight:
+    case BlendMode::HardLight:
         return kCGBlendModeHardLight;
-    case BlendModeSoftLight:
+    case BlendMode::SoftLight:
         return kCGBlendModeSoftLight;
-    case BlendModeDifference:
+    case BlendMode::Difference:
         return kCGBlendModeDifference;
-    case BlendModeExclusion:
+    case BlendMode::Exclusion:
         return kCGBlendModeExclusion;
-    case BlendModeHue:
+    case BlendMode::Hue:
         return kCGBlendModeHue;
-    case BlendModeSaturation:
+    case BlendMode::Saturation:
         return kCGBlendModeSaturation;
-    case BlendModeColor:
+    case BlendMode::Color:
         return kCGBlendModeColor;
-    case BlendModeLuminosity:
+    case BlendMode::Luminosity:
         return kCGBlendModeLuminosity;
-    case BlendModePlusDarker:
+    case BlendMode::PlusDarker:
         return kCGBlendModePlusDarker;
-    case BlendModePlusLighter:
+    case BlendMode::PlusLighter:
         return kCGBlendModePlusLighter;
     }
 

Modified: trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -163,19 +163,19 @@
 
         uint16x8_t result;
         switch (m_mode) {
-        case BlendModeNormal:
+        case BlendMode::Normal:
             result = FEBlendUtilitiesNEON::normal(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
             break;
-        case BlendModeMultiply:
+        case BlendMode::Multiply:
             result = FEBlendUtilitiesNEON::multiply(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
             break;
-        case BlendModeScreen:
+        case BlendMode::Screen:
             result = FEBlendUtilitiesNEON::screen(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
             break;
-        case BlendModeDarken:
+        case BlendMode::Darken:
             result = FEBlendUtilitiesNEON::darken(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
             break;
-        case BlendModeLighten:
+        case BlendMode::Lighten:
             result = FEBlendUtilitiesNEON::lighten(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
             break;
         default:

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -685,7 +685,7 @@
     FloatSize spacing() const { return m_spacing; }
 
 private:
-    DrawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal);
+    DrawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal);
 
     void apply(GraphicsContext&) const override;
 

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -93,7 +93,7 @@
 #if USE(CG) || USE(CAIRO)
     void drawNativeImage(const NativeImagePtr&, const FloatSize& selfSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientation) override;
 #endif
-    void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal) override;
+    void drawPattern(Image&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendMode::Normal) override;
 
     void drawRect(const FloatRect&, float borderThickness) override;
     void drawLine(const FloatPoint&, const FloatPoint&) override;

Modified: trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -78,7 +78,7 @@
 {
     ts << indent << "[feBlend";
     FilterEffect::externalRepresentation(ts, representation);
-    ts << " mode=\"" << (m_mode == BlendModeNormal ? "normal" : compositeOperatorName(CompositeSourceOver, m_mode)) << "\"]\n";
+    ts << " mode=\"" << (m_mode == BlendMode::Normal ? "normal" : compositeOperatorName(CompositeSourceOver, m_mode)) << "\"]\n";
 
     TextStream::IndentScope indentScope(ts);
     inputEffect(0)->externalRepresentation(ts, representation);

Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -305,7 +305,7 @@
 
             Cairo::State::setCompositeOperation(platformContext, arg<2>(), arg<3>());
             Cairo::fillRect(platformContext, arg<0>(), arg<1>(), arg<4>());
-            Cairo::State::setCompositeOperation(platformContext, arg<5>(), BlendModeNormal);
+            Cairo::State::setCompositeOperation(platformContext, arg<5>(), BlendMode::Normal);
         }
 
         void dump(TextStream& ts) override
@@ -335,7 +335,7 @@
             else
                 Cairo::fillRect(platformContext, rect.rect(), arg<1>(), arg<4>());
 
-            Cairo::State::setCompositeOperation(platformContext, arg<2>(), BlendModeNormal);
+            Cairo::State::setCompositeOperation(platformContext, arg<2>(), BlendMode::Normal);
         }
 
         void dump(TextStream& ts) override

Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -68,7 +68,7 @@
     WebCore::ImageDrawResult drawTiledImage(WebCore::Image&, const WebCore::FloatRect&, const WebCore::FloatPoint&, const WebCore::FloatSize&, const WebCore::FloatSize&, const WebCore::ImagePaintingOptions&) override;
     WebCore::ImageDrawResult drawTiledImage(WebCore::Image&, const WebCore::FloatRect&, const WebCore::FloatRect&, const WebCore::FloatSize&, WebCore::Image::TileRule, WebCore::Image::TileRule, const WebCore::ImagePaintingOptions&) override;
     void drawNativeImage(const WebCore::NativeImagePtr&, const WebCore::FloatSize&, const WebCore::FloatRect&, const WebCore::FloatRect&, WebCore::CompositeOperator, WebCore::BlendMode, WebCore::ImageOrientation) override;
-    void drawPattern(WebCore::Image&, const WebCore::FloatRect&, const WebCore::FloatRect&, const WebCore::AffineTransform&, const WebCore::FloatPoint&, const WebCore::FloatSize&, WebCore::CompositeOperator, WebCore::BlendMode = WebCore::BlendModeNormal) override;
+    void drawPattern(WebCore::Image&, const WebCore::FloatRect&, const WebCore::FloatRect&, const WebCore::AffineTransform&, const WebCore::FloatPoint&, const WebCore::FloatSize&, WebCore::CompositeOperator, WebCore::BlendMode = WebCore::BlendMode::Normal) override;
 
     void drawRect(const WebCore::FloatRect&, float) override;
     void drawLine(const WebCore::FloatPoint&, const WebCore::FloatPoint&) override;

Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -1881,57 +1881,57 @@
     D2D1_BLEND_MODE targetBlendMode = D2D1_BLEND_MODE_SCREEN;
     D2D1_COMPOSITE_MODE targetCompositeMode = D2D1_COMPOSITE_MODE_SOURCE_ATOP; // ???
 
-    if (blendMode != BlendModeNormal) {
+    if (blendMode != BlendMode::Normal) {
         switch (blendMode) {
-        case BlendModeMultiply:
+        case BlendMode::Multiply:
             targetBlendMode = D2D1_BLEND_MODE_MULTIPLY;
             break;
-        case BlendModeScreen:
+        case BlendMode::Screen:
             targetBlendMode = D2D1_BLEND_MODE_SCREEN;
             break;
-        case BlendModeOverlay:
+        case BlendMode::Overlay:
             targetBlendMode = D2D1_BLEND_MODE_OVERLAY;
             break;
-        case BlendModeDarken:
+        case BlendMode::Darken:
             targetBlendMode = D2D1_BLEND_MODE_DARKEN;
             break;
-        case BlendModeLighten:
+        case BlendMode::Lighten:
             targetBlendMode = D2D1_BLEND_MODE_LIGHTEN;
             break;
-        case BlendModeColorDodge:
+        case BlendMode::ColorDodge:
             targetBlendMode = D2D1_BLEND_MODE_COLOR_DODGE;
             break;
-        case BlendModeColorBurn:
+        case BlendMode::ColorBurn:
             targetBlendMode = D2D1_BLEND_MODE_COLOR_BURN;
             break;
-        case BlendModeHardLight:
+        case BlendMode::HardLight:
             targetBlendMode = D2D1_BLEND_MODE_HARD_LIGHT;
             break;
-        case BlendModeSoftLight:
+        case BlendMode::SoftLight:
             targetBlendMode = D2D1_BLEND_MODE_SOFT_LIGHT;
             break;
-        case BlendModeDifference:
+        case BlendMode::Difference:
             targetBlendMode = D2D1_BLEND_MODE_DIFFERENCE;
             break;
-        case BlendModeExclusion:
+        case BlendMode::Exclusion:
             targetBlendMode = D2D1_BLEND_MODE_EXCLUSION;
             break;
-        case BlendModeHue:
+        case BlendMode::Hue:
             targetBlendMode = D2D1_BLEND_MODE_HUE;
             break;
-        case BlendModeSaturation:
+        case BlendMode::Saturation:
             targetBlendMode = D2D1_BLEND_MODE_SATURATION;
             break;
-        case BlendModeColor:
+        case BlendMode::Color:
             targetBlendMode = D2D1_BLEND_MODE_COLOR;
             break;
-        case BlendModeLuminosity:
+        case BlendMode::Luminosity:
             targetBlendMode = D2D1_BLEND_MODE_LUMINOSITY;
             break;
-        case BlendModePlusDarker:
+        case BlendMode::PlusDarker:
             targetBlendMode = D2D1_BLEND_MODE_DARKER_COLOR;
             break;
-        case BlendModePlusLighter:
+        case BlendMode::PlusLighter:
             targetBlendMode = D2D1_BLEND_MODE_LIGHTER_COLOR;
             break;
         default:

Modified: trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -79,7 +79,7 @@
     if (size)
         drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, CompositeCopy);
     else
-        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 
     // Do cleanup
     CGContextRelease(cgContext);
@@ -95,7 +95,7 @@
         if (image && CGImageGetHeight(image) == static_cast<size_t>(srcSize.height()) && CGImageGetWidth(image) == static_cast<size_t>(srcSize.width())) {
             size_t currentFrame = m_currentFrame;
             m_currentFrame = i;
-            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
             m_currentFrame = currentFrame;
             return;
         }
@@ -103,7 +103,7 @@
 
     // No image of the correct size was found, fallback to drawing the current frame
     FloatSize imageSize = BitmapImage::size();
-    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -81,7 +81,7 @@
     if (size)
         drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, CompositeCopy);
     else
-        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 
     // Do cleanup
     cairo_destroy(targetRef);
@@ -100,7 +100,7 @@
         if (cairo_image_surface_get_height(surface.get()) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(surface.get()) == static_cast<size_t>(srcSize.width())) {
             size_t currentFrame = m_currentFrame;
             m_currentFrame = i;
-            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
             m_currentFrame = currentFrame;
             return;
         }
@@ -108,7 +108,7 @@
 
     // No image of the correct size was found, fallback to drawing the current frame
     FloatSize imageSize = BitmapImage::size();
-    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/win/ImageDirect2D.cpp (234609 => 234610)


--- trunk/Source/WebCore/platform/graphics/win/ImageDirect2D.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/platform/graphics/win/ImageDirect2D.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -81,7 +81,7 @@
         if (image && clampTo<size_t>(imageSize.height) == static_cast<size_t>(srcSize.height()) && clampTo<size_t>(imageSize.width) == static_cast<size_t>(srcSize.width())) {
             size_t currentFrame = m_currentFrame;
             m_currentFrame = i;
-            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendModeNormal, ImageOrientationDescription());
+            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendMode::Normal, ImageOrientationDescription());
             m_currentFrame = currentFrame;
             return;
         }
@@ -89,7 +89,7 @@
 
     // No image of the correct size was found, fallback to drawing the current frame
     FloatSize imageSize = BitmapImage::size();
-    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendModeNormal, ImageOrientationDescription());
+    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendMode::Normal, ImageOrientationDescription());
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -1581,7 +1581,7 @@
     for (auto* layer = &fillLayer; layer; layer = layer->next()) {
         layers.append(layer);
 
-        if (layer->blendMode() != BlendModeNormal)
+        if (layer->blendMode() != BlendMode::Normal)
             shouldDrawBackgroundInSeparateBuffer = true;
 
         // Stop traversal when an opaque layer is encountered.
@@ -1593,7 +1593,7 @@
         // and pass it down.
 
         // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
-        if (layer->clipOccludesNextLayers(layer == &fillLayer) && layer->hasOpaqueImage(*this) && layer->image()->canRender(this, style().effectiveZoom()) && layer->hasRepeatXY() && layer->blendMode() == BlendModeNormal)
+        if (layer->clipOccludesNextLayers(layer == &fillLayer) && layer->hasOpaqueImage(*this) && layer->image()->canRender(this, style().effectiveZoom()) && layer->hasRepeatXY() && layer->blendMode() == BlendMode::Normal)
             break;
     }
 

Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/RenderImage.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -617,7 +617,7 @@
 
     ImageOrientationDescription orientationDescription(shouldRespectImageOrientation(), style().imageOrientation());
     auto decodingMode = decodingModeForImageDraw(*image, paintInfo);
-    auto drawResult = paintInfo.context().drawImage(*img, rect, ImagePaintingOptions(compositeOperator, BlendModeNormal, decodingMode, orientationDescription, interpolation));
+    auto drawResult = paintInfo.context().drawImage(*img, rect, ImagePaintingOptions(compositeOperator, BlendMode::Normal, decodingMode, orientationDescription, interpolation));
     if (drawResult == ImageDrawResult::DidRequestDecoding)
         imageResource().cachedImage()->addClientWaitingForAsyncDecoding(*this);
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -313,7 +313,7 @@
 #endif
     , m_hasFilterInfo(false)
 #if ENABLE(CSS_COMPOSITING)
-    , m_blendMode(BlendModeNormal)
+    , m_blendMode(static_cast<unsigned>(BlendMode::Normal))
     , m_hasNotIsolatedCompositedBlendingDescendants(false)
     , m_hasNotIsolatedBlendingDescendants(false)
     , m_hasNotIsolatedBlendingDescendantsStatusDirty(false)
@@ -926,7 +926,7 @@
 
 void RenderLayer::updateBlendMode()
 {
-    bool hadBlendMode = m_blendMode != BlendModeNormal;
+    bool hadBlendMode = static_cast<BlendMode>(m_blendMode) != BlendMode::Normal;
     if (parent() && hadBlendMode != hasBlendMode()) {
         if (hasBlendMode())
             parent()->updateAncestorChainHasBlendingDescendants();
@@ -935,8 +935,8 @@
     }
 
     BlendMode newBlendMode = renderer().style().blendMode();
-    if (newBlendMode != m_blendMode)
-        m_blendMode = newBlendMode;
+    if (newBlendMode != static_cast<BlendMode>(m_blendMode))
+        m_blendMode = static_cast<unsigned>(newBlendMode);
 }
 
 void RenderLayer::updateAncestorChainHasBlendingDescendants()
@@ -1827,7 +1827,7 @@
 
 #if ENABLE(CSS_COMPOSITING)
         if (usesCompositeOperation)
-            context.setCompositeOperation(context.compositeOperation(), BlendModeNormal);
+            context.setCompositeOperation(context.compositeOperation(), BlendMode::Normal);
 #endif
 
 #ifdef REVEAL_TRANSPARENCY_LAYERS

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -540,7 +540,7 @@
     // FIXME: where is the blend mode updated when m_ancestorClippingLayers come and go?
     if (m_ancestorClippingLayer) {
         m_ancestorClippingLayer->setBlendMode(style.blendMode());
-        m_graphicsLayer->setBlendMode(BlendModeNormal);
+        m_graphicsLayer->setBlendMode(BlendMode::Normal);
     } else
         m_graphicsLayer->setBlendMode(style.blendMode());
 }

Modified: trunk/Source/WebCore/rendering/style/FillLayer.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/style/FillLayer.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/style/FillLayer.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -54,7 +54,7 @@
     , m_repeatY(static_cast<unsigned>(FillLayer::initialFillRepeatY(type)))
     , m_composite(FillLayer::initialFillComposite(type))
     , m_sizeType(static_cast<unsigned>(FillSizeType::None))
-    , m_blendMode(FillLayer::initialFillBlendMode(type))
+    , m_blendMode(static_cast<unsigned>(FillLayer::initialFillBlendMode(type)))
     , m_maskSourceType(static_cast<unsigned>(FillLayer::initialFillMaskSourceType(type)))
     , m_imageSet(false)
     , m_attachmentSet(false)
@@ -357,7 +357,7 @@
     if (m_composite == CompositeClear || m_composite == CompositeCopy)
         return true;
 
-    return m_blendMode == BlendModeNormal && m_composite == CompositeSourceOver && m_image->knownToBeOpaque(&renderer);
+    return static_cast<BlendMode>(m_blendMode) == BlendMode::Normal && m_composite == CompositeSourceOver && m_image->knownToBeOpaque(&renderer);
 }
 
 bool FillLayer::hasRepeatXY() const

Modified: trunk/Source/WebCore/rendering/style/FillLayer.h (234609 => 234610)


--- trunk/Source/WebCore/rendering/style/FillLayer.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/style/FillLayer.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -162,7 +162,7 @@
     static FillRepeat initialFillRepeatX(FillLayerType) { return FillRepeat::Repeat; }
     static FillRepeat initialFillRepeatY(FillLayerType) { return FillRepeat::Repeat; }
     static CompositeOperator initialFillComposite(FillLayerType) { return CompositeSourceOver; }
-    static BlendMode initialFillBlendMode(FillLayerType) { return BlendModeNormal; }
+    static BlendMode initialFillBlendMode(FillLayerType) { return BlendMode::Normal; }
     static FillSize initialFillSize(FillLayerType) { return { }; }
     static Length initialFillXPosition(FillLayerType) { return Length(0.0f, Percent); }
     static Length initialFillYPosition(FillLayerType) { return Length(0.0f, Percent); }

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (234609 => 234610)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -766,14 +766,14 @@
 
 #if ENABLE(CSS_COMPOSITING)
     BlendMode blendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode); }
-    void setBlendMode(BlendMode mode) { SET_VAR(m_rareNonInheritedData, effectiveBlendMode, mode); }
-    bool hasBlendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode) != BlendModeNormal; }
+    void setBlendMode(BlendMode mode) { SET_VAR(m_rareNonInheritedData, effectiveBlendMode, static_cast<unsigned>(mode)); }
+    bool hasBlendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode) != BlendMode::Normal; }
 
     Isolation isolation() const { return static_cast<Isolation>(m_rareNonInheritedData->isolation); }
     void setIsolation(Isolation isolation) { SET_VAR(m_rareNonInheritedData, isolation, static_cast<unsigned>(isolation)); }
     bool hasIsolation() const { return isolation() != Isolation::Auto; }
 #else
-    BlendMode blendMode() const { return BlendModeNormal; }
+    BlendMode blendMode() const { return BlendMode::Normal; }
     bool hasBlendMode() const { return false; }
 
     Isolation isolation() const { return Isolation::Auto; }
@@ -1671,7 +1671,7 @@
 #endif
 
 #if ENABLE(CSS_COMPOSITING)
-    static BlendMode initialBlendMode() { return BlendModeNormal; }
+    static BlendMode initialBlendMode() { return BlendMode::Normal; }
     static Isolation initialIsolation() { return Isolation::Auto; }
 #endif
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -91,7 +91,7 @@
     , textDecorationStyle(static_cast<unsigned>(RenderStyle::initialTextDecorationStyle()))
     , aspectRatioType(static_cast<unsigned>(RenderStyle::initialAspectRatioType()))
 #if ENABLE(CSS_COMPOSITING)
-    , effectiveBlendMode(RenderStyle::initialBlendMode())
+    , effectiveBlendMode(static_cast<unsigned>(RenderStyle::initialBlendMode()))
     , isolation(static_cast<unsigned>(RenderStyle::initialIsolation()))
 #endif
 #if ENABLE(APPLE_PAY)

Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (234609 => 234610)


--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -122,7 +122,7 @@
             m_paintInfo->context().beginTransparencyLayer(opacity);
 
             if (hasBlendMode)
-                m_paintInfo->context().setCompositeOperation(m_paintInfo->context().compositeOperation(), BlendModeNormal);
+                m_paintInfo->context().setCompositeOperation(m_paintInfo->context().compositeOperation(), BlendMode::Normal);
 
             m_renderingFlags |= EndOpacityLayer;
         }

Modified: trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp (234609 => 234610)


--- trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -87,9 +87,9 @@
     }
 
     if (attrName == SVGNames::modeAttr) {
-        BlendMode mode = BlendModeNormal;
+        BlendMode mode = BlendMode::Normal;
         parseBlendMode(value, mode);
-        return mode;
+        return static_cast<unsigned>(mode);
     }
     if (attrName == SVGNames::stitchTilesAttr)
         return SVGPropertyTraits<SVGStitchOptions>::fromString(value);

Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.cpp (234609 => 234610)


--- trunk/Source/WebCore/svg/SVGFEBlendElement.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -46,7 +46,7 @@
 
 inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document& document)
     : SVGFilterPrimitiveStandardAttributes(tagName, document)
-    , m_mode(BlendModeNormal)
+    , m_mode(BlendMode::Normal)
 {
     ASSERT(hasTagName(SVGNames::feBlendTag));
     registerAnimatedPropertiesForSVGFEBlendElement();
@@ -60,7 +60,7 @@
 void SVGFEBlendElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == SVGNames::modeAttr) {
-        BlendMode mode = BlendModeNormal;
+        BlendMode mode = BlendMode::Normal;
         if (parseBlendMode(value, mode))
             setModeBaseValue(mode);
         return;

Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.h (234609 => 234610)


--- trunk/Source/WebCore/svg/SVGFEBlendElement.h	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.h	2018-08-06 18:19:43 UTC (rev 234610)
@@ -29,11 +29,11 @@
 
 template<>
 struct SVGPropertyTraits<BlendMode> {
-    static unsigned highestEnumValue() { return BlendModeLuminosity; }
+    static unsigned highestEnumValue() { return static_cast<unsigned>(BlendMode::Luminosity); }
 
     static String toString(BlendMode type)
     {
-        if (type < BlendModePlusDarker)
+        if (type < BlendMode::PlusDarker)
             return blendModeName(type);
 
         return emptyString();

Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (234609 => 234610)


--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2018-08-06 18:19:43 UTC (rev 234610)
@@ -216,7 +216,7 @@
     if (!buffer) // failed to allocate image
         return nullptr;
 
-    draw(buffer->context(), rect(), rect(), CompositeSourceOver, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+    draw(buffer->context(), rect(), rect(), CompositeSourceOver, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 
     // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here.
     return buffer->copyImage(CopyBackingStore)->nativeImageForCurrentFrame();
@@ -240,7 +240,7 @@
 
     GraphicsContext localContext(nativeImageTarget.get());
 
-    draw(localContext, rect(), rect(), CompositeSourceOver, BlendModeNormal, DecodingMode::Synchronous, ImageOrientationDescription());
+    draw(localContext, rect(), rect(), CompositeSourceOver, BlendMode::Normal, DecodingMode::Synchronous, ImageOrientationDescription());
 
     COMPtr<ID2D1Bitmap> nativeImage;
     hr = nativeImageTarget->GetBitmap(&nativeImage);
@@ -268,7 +268,7 @@
     std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context);
     if (!buffer) // Failed to allocate buffer.
         return;
-    drawForContainer(buffer->context(), containerSize, containerZoom, initialFragmentURL, imageBufferSize, zoomedContainerRect, CompositeSourceOver, BlendModeNormal);
+    drawForContainer(buffer->context(), containerSize, containerZoom, initialFragmentURL, imageBufferSize, zoomedContainerRect, CompositeSourceOver, BlendMode::Normal);
     if (context.drawLuminanceMask())
         buffer->convertToLuminanceMask();
 
@@ -299,10 +299,10 @@
     context.clip(enclosingIntRect(dstRect));
 
     float alpha = context.alpha();
-    bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != BlendModeNormal || alpha < 1;
+    bool compositingRequiresTransparencyLayer = compositeOp != CompositeSourceOver || blendMode != BlendMode::Normal || alpha < 1;
     if (compositingRequiresTransparencyLayer) {
         context.beginTransparencyLayer(alpha);
-        context.setCompositeOperation(CompositeSourceOver, BlendModeNormal);
+        context.setCompositeOperation(CompositeSourceOver, BlendMode::Normal);
     }
 
     FloatSize scale(dstRect.size() / srcRect.size());

Modified: trunk/Source/WebKit/ChangeLog (234609 => 234610)


--- trunk/Source/WebKit/ChangeLog	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebKit/ChangeLog	2018-08-06 18:19:43 UTC (rev 234610)
@@ -1,3 +1,13 @@
+2018-08-06  Alex Christensen  <achristen...@webkit.org>
+
+        Make BlendMode an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=188325
+
+        Reviewed by Darin Adler.
+
+        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
+
 2018-08-06  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm (234609 => 234610)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm	2018-08-06 18:06:25 UTC (rev 234609)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm	2018-08-06 18:19:43 UTC (rev 234610)
@@ -93,7 +93,7 @@
     , customAppearance(GraphicsLayer::CustomAppearance::None)
     , minificationFilter(PlatformCALayer::FilterType::Linear)
     , magnificationFilter(PlatformCALayer::FilterType::Linear)
-    , blendMode(BlendModeNormal)
+    , blendMode(BlendMode::Normal)
     , windRule(WindRule::NonZero)
     , hidden(false)
     , backingStoreAttached(true)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to