Use enum classes and OptionSets for PaintPhase and PaintBehavior
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 20:41:05 +0000 (20:41 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 20:41:05 +0000 (20:41 +0000)
commitdf79e2b39ebebc6a3d0ec12492a5eb21d9bc474e
tree8447763fbd3f6fa027fd3b33e47b062cac039da6
parent5775a2f6922ec0a0a8fe0271eab579eb712bd803
Use enum classes and OptionSets for PaintPhase and PaintBehavior
https://bugs.webkit.org/show_bug.cgi?id=188323

Reviewed by Simon Fraser.

Source/WebCore:

No change in behaviour.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::paintContents):
(WebCore::FrameView::setPaintBehavior):
(WebCore::FrameView::paintBehavior const):
(WebCore::FrameView::paintContentsForSnapshot):
* page/FrameView.h:
* rendering/InlineElementBox.cpp:
(WebCore::InlineElementBox::paint):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::PaintInfo):
(WebCore::PaintInfo::forceBlackText const):
(WebCore::PaintInfo::forceWhiteText const):
(WebCore::PaintInfo::skipRootBackground const):
(WebCore::PaintInfo::paintRootBackgroundOnly const):
* rendering/PaintPhase.h:
(): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
(WebCore::RenderBlock::paintContents):
(WebCore::RenderBlock::paintObject):
(WebCore::RenderBlock::paintSelection):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::paintFloats):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintMask):
(WebCore::RenderBox::paintClippingMask):
(WebCore::RenderBox::paintMaskImages):
(WebCore::RenderBox::pushContentsClip):
(WebCore::RenderBox::popContentsClip):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
(WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
(WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintAsInlineBlock):
(WebCore::RenderElement::selectionColor const):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paint):
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::renderableTransform const):
(WebCore::transparencyClipBox):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::paintingExtent):
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::paintOverlayScrollbars):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintChildClippingMaskForFragments):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::paint const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintObject):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
(WebCore::RenderReplaced::shouldPaint):
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::paint):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::paintIntoRect):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintObject):
(WebCore::RenderTable::paintMask):
(WebCore::RenderTable::overflowClipRect):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paint):
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::paintMask):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
(WebCore::RenderTableRow::paint):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paint):
(WebCore::RenderTableSection::paintCell):
(WebCore::RenderTableSection::paintObject):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
(WebCore::RenderThemeMac::paintImageControlsButton):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):
(WebCore::RenderWidget::paint):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::paintEllipsisBox const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/mathml/MathOperator.cpp:
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::paint):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::paint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::paint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paint):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::applyResource):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::paint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::paint):
* rendering/svg/SVGInlineFlowBox.cpp:
(WebCore::SVGInlineFlowBox::paintSelectionBackground):
(WebCore::SVGInlineFlowBox::paint):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::isRenderingMaskImage):
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer):
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::paint):

Source/WebKit:

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::imageForRect):
* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::shouldCreateTransientPaintingSnapshot const):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):
* WebView/WebFrame.mm:
(-[WebFrame _paintBehaviorForDestinationContext:]):
(-[WebFrame _drawRect:contentsOnly:]):
* WebView/WebHTMLView.mm:
(imageFromRect):
(selectionImage):

Source/WTF:

* wtf/OptionSet.h:
(WTF::OptionSet::OptionSet):
Allow a zero-valued enum value in the OptionSet constructor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
74 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/OptionSet.h
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/win/FrameCGWin.cpp
Source/WebCore/page/win/FrameWin.cpp
Source/WebCore/page/win/FrameWinDirect2D.cpp
Source/WebCore/rendering/InlineElementBox.cpp
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/PaintPhase.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLineBoxList.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplica.cpp
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/mathml/MathOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm