Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (263543 => 263544)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2020-06-25 23:27:27 UTC (rev 263543)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2020-06-25 23:30:46 UTC (rev 263544)
@@ -4151,7 +4151,7 @@
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, subpixelOffset, subtreePaintRoot, &overlapTestRequests, paintPolicy == SecurityOriginPaintPolicy::AccessibleOriginOnly);
if (eventRegionContext) {
paintingInfo.eventRegionContext = eventRegionContext;
- paintFlags.add(RenderLayer::PaintLayerCollectingEventRegion);
+ paintFlags.add(RenderLayer::PaintLayerFlag::CollectingEventRegion);
}
paintLayer(context, paintingInfo, paintFlags);
@@ -4165,7 +4165,7 @@
return;
LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBehavior, LayoutSize(), subtreePaintRoot);
- paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
+ paintLayer(context, paintingInfo, PaintLayerFlag::PaintingOverlayScrollbars);
m_containsDirtyOverlayScrollbars = false;
}
@@ -4256,7 +4256,7 @@
static inline bool paintForFixedRootBackground(const RenderLayer* layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags)
{
- return layer->renderer().isDocumentElementRenderer() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
+ return layer->renderer().isDocumentElementRenderer() && (paintFlags & RenderLayer::PaintLayerFlag::PaintingRootBackgroundOnly);
}
void RenderLayer::paintLayer(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, OptionSet<PaintLayerFlag> paintFlags)
@@ -4264,7 +4264,7 @@
auto shouldContinuePaint = [&] () {
return backing()->paintsIntoWindow()
|| backing()->paintsIntoCompositedAncestor()
- || shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerPaintingReflection))
+ || shouldDoSoftwarePaint(this, paintFlags.contains(PaintLayerFlag::PaintingReflection))
|| paintForFixedRootBackground(this, paintFlags);
};
@@ -4282,7 +4282,7 @@
if (!context.performingPaintInvalidation() && !(paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers))
return;
- paintFlags.add(PaintLayerTemporaryClipRects);
+ paintFlags.add(PaintLayerFlag::TemporaryClipRects);
}
if (viewportConstrainedNotCompositedReason() == NotCompositedForBoundsOutOfView) {
@@ -4309,10 +4309,10 @@
return;
if (paintsWithTransparency(paintingInfo.paintBehavior))
- paintFlags.add(PaintLayerHaveTransparency);
+ paintFlags.add(PaintLayerFlag::HaveTransparency);
- // PaintLayerAppliedTransform is used in RenderReplica, to avoid applying the transform twice.
- if (paintsWithTransform(paintingInfo.paintBehavior) && !(paintFlags & PaintLayerAppliedTransform)) {
+ // PaintLayerFlag::AppliedTransform is used in RenderReplica, to avoid applying the transform twice.
+ if (paintsWithTransform(paintingInfo.paintBehavior) && !(paintFlags & PaintLayerFlag::AppliedTransform)) {
TransformationMatrix layerTransform = renderableTransform(paintingInfo.paintBehavior);
// If the transform can't be inverted, then don't paint anything.
if (!layerTransform.isInvertible())
@@ -4320,7 +4320,7 @@
// If we have a transparency layer enclosing us and we are the root of a transform, then we need to establish the transparency
// layer from the parent now, assuming there is a parent
- if (paintFlags & PaintLayerHaveTransparency) {
+ if (paintFlags & PaintLayerFlag::HaveTransparency) {
if (parent())
parent()->beginTransparencyLayers(context, paintingInfo, paintingInfo.paintDirtyRect);
else
@@ -4335,8 +4335,8 @@
// Make sure the parent's clip rects have been calculated.
ClipRect clipRect = paintingInfo.paintDirtyRect;
if (parent()) {
- ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,
- IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip);
+ ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlags & PaintLayerFlag::TemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,
+ IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerFlag::PaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip);
clipRect = backgroundClipRect(clipRectsContext);
clipRect.intersect(paintingInfo.paintDirtyRect);
@@ -4360,13 +4360,13 @@
{
ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant());
- auto localPaintFlags = paintFlags - PaintLayerAppliedTransform;
+ auto localPaintFlags = paintFlags - PaintLayerFlag::AppliedTransform;
// Paint the reflection first if we have one.
if (m_reflection && !m_paintingInsideReflection) {
// Mark that we are now inside replica painting.
m_paintingInsideReflection = true;
- reflectionLayer()->paintLayer(context, paintingInfo, localPaintFlags | PaintLayerPaintingReflection);
+ reflectionLayer()->paintLayer(context, paintingInfo, localPaintFlags | PaintLayerFlag::PaintingReflection);
m_paintingInsideReflection = false;
}
@@ -4477,7 +4477,7 @@
if (context.paintingDisabled())
return nullptr;
- if (paintFlags & PaintLayerPaintingOverlayScrollbars)
+ if (paintFlags & PaintLayerFlag::PaintingOverlayScrollbars)
return nullptr;
if (!paintsWithFilters())
@@ -4533,15 +4533,15 @@
if (context.detectingContentfulPaint() && context.contenfulPaintDetected())
return;
- auto localPaintFlags = paintFlags - PaintLayerAppliedTransform;
- bool haveTransparency = localPaintFlags.contains(PaintLayerHaveTransparency);
+ auto localPaintFlags = paintFlags - PaintLayerFlag::AppliedTransform;
+ bool haveTransparency = localPaintFlags.contains(PaintLayerFlag::HaveTransparency);
bool isSelfPaintingLayer = this->isSelfPaintingLayer();
- bool isPaintingOverlayScrollbars = paintFlags.contains(PaintLayerPaintingOverlayScrollbars);
- bool isPaintingScrollingContent = paintFlags.contains(PaintLayerPaintingCompositingScrollingPhase);
- bool isPaintingCompositedForeground = paintFlags.contains(PaintLayerPaintingCompositingForegroundPhase);
- bool isPaintingCompositedBackground = paintFlags.contains(PaintLayerPaintingCompositingBackgroundPhase);
- bool isPaintingOverflowContents = paintFlags.contains(PaintLayerPaintingOverflowContents);
- bool isCollectingEventRegion = paintFlags.contains(PaintLayerCollectingEventRegion);
+ bool isPaintingOverlayScrollbars = paintFlags.contains(PaintLayerFlag::PaintingOverlayScrollbars);
+ bool isPaintingScrollingContent = paintFlags.contains(PaintLayerFlag::PaintingCompositingScrollingPhase);
+ bool isPaintingCompositedForeground = paintFlags.contains(PaintLayerFlag::PaintingCompositingForegroundPhase);
+ bool isPaintingCompositedBackground = paintFlags.contains(PaintLayerFlag::PaintingCompositingBackgroundPhase);
+ bool isPaintingOverflowContents = paintFlags.contains(PaintLayerFlag::PaintingOverflowContents);
+ bool isCollectingEventRegion = paintFlags.contains(PaintLayerFlag::CollectingEventRegion);
// Outline always needs to be painted even if we have no visible content. Also,
// the outline is painted in the background phase during composited scrolling.
// If it were painted in the foreground phase, it would move with the scrolled
@@ -4554,7 +4554,7 @@
|| (!isPaintingScrollingContent && isPaintingCompositedForeground));
bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars && !isCollectingEventRegion;
- if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer()) {
+ if (localPaintFlags & PaintLayerFlag::PaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer()) {
// If beginTransparencyLayers was called prior to this, ensure the transparency state is cleaned up before returning.
if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) {
context.endTransparencyLayer();
@@ -4612,9 +4612,9 @@
performOverlapTests(*localPaintingInfo.overlapTestRequests, localPaintingInfo.rootLayer, this);
OptionSet<PaintBehavior> paintBehavior = PaintBehavior::Normal;
- if (localPaintFlags & PaintLayerPaintingSkipRootBackground)
+ if (localPaintFlags & PaintLayerFlag::PaintingSkipRootBackground)
paintBehavior.add(PaintBehavior::SkipRootBackground);
- else if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly)
+ else if (localPaintFlags & PaintLayerFlag::PaintingRootBackgroundOnly)
paintBehavior.add(PaintBehavior::RootBackgroundOnly);
if (paintingInfo.paintBehavior & PaintBehavior::FlattenCompositingLayers)
@@ -4643,7 +4643,7 @@
paintDirtyRect = clipRectRelativeToAncestor(localPaintingInfo.rootLayer, offsetFromRoot, LayoutRect::infiniteRect());
}
collectFragments(layerFragments, localPaintingInfo.rootLayer, paintDirtyRect, ExcludeCompositedPaginatedLayers,
- (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
+ (localPaintFlags & PaintLayerFlag::TemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
(isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetFromRoot);
updatePaintingInfoForFragments(layerFragments, localPaintingInfo, localPaintFlags, shouldPaintContent, offsetFromRoot);
}
@@ -4690,7 +4690,7 @@
// Note that we also use paintingInfo here, not localPaintingInfo which filters also contaminated.
LayerFragments layerFragments;
collectFragments(layerFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, ExcludeCompositedPaginatedLayers,
- (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
+ (localPaintFlags & PaintLayerFlag::TemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
(isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetFromRoot);
updatePaintingInfoForFragments(layerFragments, paintingInfo, localPaintFlags, shouldPaintContent, offsetFromRoot);
@@ -4717,12 +4717,12 @@
paintMaskForFragments(layerFragments, context, paintingInfo, paintBehavior, subtreePaintRootForRenderer);
}
- if (!(paintFlags & PaintLayerPaintingCompositingMaskPhase) && (paintFlags & PaintLayerPaintingCompositingClipPathPhase)) {
+ if (!(paintFlags & PaintLayerFlag::PaintingCompositingMaskPhase) && (paintFlags & PaintLayerFlag::PaintingCompositingClipPathPhase)) {
// Re-use paintChildClippingMaskForFragments to paint black for the compositing clipping mask.
paintChildClippingMaskForFragments(layerFragments, context, paintingInfo, paintBehavior, subtreePaintRootForRenderer);
}
- if (localPaintFlags & PaintLayerPaintingChildClippingMaskPhase) {
+ if (localPaintFlags & PaintLayerFlag::PaintingChildClippingMaskPhase) {
// Paint the border radius mask for the fragments.
paintChildClippingMaskForFragments(layerFragments, context, paintingInfo, paintBehavior, subtreePaintRootForRenderer);
}
@@ -4954,7 +4954,7 @@
{
for (auto& fragment : fragments) {
fragment.shouldPaintContent = shouldPaintContent;
- if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents)) {
+ if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLayerFlag::PaintingOverflowContents)) {
LayoutSize newOffsetFromRoot = offsetFromRoot + fragment.paginationOffset;
fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBounds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, newOffsetFromRoot, fragment.boundingBox);
}
@@ -4968,8 +4968,8 @@
RenderLayer* paginatedLayer = enclosingPaginationLayer(ExcludeCompositedPaginatedLayers);
LayoutRect transformedExtent = transparencyClipBox(*this, paginatedLayer, PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.paintBehavior);
paginatedLayer->collectFragments(enclosingPaginationFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, ExcludeCompositedPaginatedLayers,
- (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
- (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent);
+ (paintFlags & PaintLayerFlag::TemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, IgnoreOverlayScrollbarSize,
+ (paintFlags & PaintLayerFlag::PaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip, offsetOfPaginationLayerFromRoot, &transformedExtent);
for (const auto& fragment : enclosingPaginationFragments) {
// Apply the page/column clip for this fragment, as well as any clips established by layers in between us and
@@ -4980,8 +4980,8 @@
if (parent() != paginatedLayer) {
offsetOfPaginationLayerFromRoot = toLayoutSize(paginatedLayer->convertToLayerCoords(paintingInfo.rootLayer, toLayoutPoint(offsetOfPaginationLayerFromRoot)));
- ClipRectsContext clipRectsContext(paginatedLayer, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,
- IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip);
+ ClipRectsContext clipRectsContext(paginatedLayer, (paintFlags & PaintLayerFlag::TemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,
+ IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerFlag::PaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip);
LayoutRect parentClipRect = backgroundClipRect(clipRectsContext).rect();
parentClipRect.move(fragment.paginationOffset + offsetOfPaginationLayerFromRoot);
clipRect.intersect(parentClipRect);
@@ -6335,7 +6335,7 @@
if (paintsToWindow || (paintBehavior & PaintBehavior::FlattenCompositingLayers))
return true;
- return paintFlags.contains(PaintLayerPaintingCompositingMaskPhase);
+ return paintFlags.contains(PaintLayerFlag::PaintingCompositingMaskPhase);
}
bool RenderLayer::shouldApplyClipPath(OptionSet<PaintBehavior> paintBehavior, OptionSet<PaintLayerFlag> paintFlags) const
@@ -6347,7 +6347,7 @@
if (paintsToWindow || (paintBehavior & PaintBehavior::FlattenCompositingLayers))
return true;
- return paintFlags.contains(PaintLayerPaintingCompositingClipPathPhase);
+ return paintFlags.contains(PaintLayerFlag::PaintingCompositingClipPathPhase);
}
bool RenderLayer::scrollingMayRevealBackground() const
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (263543 => 263544)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2020-06-25 23:27:27 UTC (rev 263543)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2020-06-25 23:30:46 UTC (rev 263544)
@@ -669,24 +669,24 @@
int zIndex() const { return renderer().style().usedZIndex(); }
- enum PaintLayerFlag {
- PaintLayerHaveTransparency = 1 << 0,
- PaintLayerAppliedTransform = 1 << 1,
- PaintLayerTemporaryClipRects = 1 << 2,
- PaintLayerPaintingReflection = 1 << 3,
- PaintLayerPaintingOverlayScrollbars = 1 << 4,
- PaintLayerPaintingCompositingBackgroundPhase = 1 << 5,
- PaintLayerPaintingCompositingForegroundPhase = 1 << 6,
- PaintLayerPaintingCompositingMaskPhase = 1 << 7,
- PaintLayerPaintingCompositingClipPathPhase = 1 << 8,
- PaintLayerPaintingCompositingScrollingPhase = 1 << 9,
- PaintLayerPaintingOverflowContents = 1 << 10,
- PaintLayerPaintingRootBackgroundOnly = 1 << 11,
- PaintLayerPaintingSkipRootBackground = 1 << 12,
- PaintLayerPaintingChildClippingMaskPhase = 1 << 13,
- PaintLayerCollectingEventRegion = 1 << 14,
+ enum class PaintLayerFlag : uint16_t {
+ HaveTransparency = 1 << 0,
+ AppliedTransform = 1 << 1,
+ TemporaryClipRects = 1 << 2,
+ PaintingReflection = 1 << 3,
+ PaintingOverlayScrollbars = 1 << 4,
+ PaintingCompositingBackgroundPhase = 1 << 5,
+ PaintingCompositingForegroundPhase = 1 << 6,
+ PaintingCompositingMaskPhase = 1 << 7,
+ PaintingCompositingClipPathPhase = 1 << 8,
+ PaintingCompositingScrollingPhase = 1 << 9,
+ PaintingOverflowContents = 1 << 10,
+ PaintingRootBackgroundOnly = 1 << 11,
+ PaintingSkipRootBackground = 1 << 12,
+ PaintingChildClippingMaskPhase = 1 << 13,
+ CollectingEventRegion = 1 << 14,
};
- static constexpr OptionSet<PaintLayerFlag> paintLayerPaintingCompositingAllPhasesFlags() { return { PaintLayerPaintingCompositingBackgroundPhase, PaintLayerPaintingCompositingForegroundPhase }; }
+ static constexpr OptionSet<PaintLayerFlag> paintLayerPaintingCompositingAllPhasesFlags() { return { PaintLayerFlag::PaintingCompositingBackgroundPhase, PaintLayerFlag::PaintingCompositingForegroundPhase }; }
enum class SecurityOriginPaintPolicy { AnyOrigin, AccessibleOriginOnly };