CompositedScrollingHistogramMax = 3
};
+enum CompositingQueryMode {
+ CompositingQueriesAreAllowed,
+ CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases
+};
+
+// FIXME: remove this once the compositing query ASSERTS are no longer hit.
+class DisableCompositingQueryAsserts {
+ WTF_MAKE_NONCOPYABLE(DisableCompositingQueryAsserts);
+public:
+ DisableCompositingQueryAsserts();
+private:
+ TemporaryChange<CompositingQueryMode> m_disabler;
+};
+
class RenderLayer {
public:
friend class RenderReplica;
void styleChanged(StyleDifference, const RenderStyle* oldStyle);
bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; }
+ bool isOverflowOnlyLayer() const { return m_layerType == OverflowClipLayer; }
+ bool isForcedLayer() const { return m_layerType == ForcedLayer; }
- bool isOverflowOnlyLayer() const { return m_isOverflowOnlyLayer; }
- void setIsOverflowOnlyLayer(bool isOverflowOnlyLayer) { m_isOverflowOnlyLayer = isOverflowOnlyLayer; }
+ void setLayerType(LayerType layerType) { m_layerType = layerType; }
bool cannotBlitToWindow() const;
RenderLayer* enclosingPaginationLayer() const { return m_enclosingPaginationLayer; }
void updateTransform();
+ void update3dRenderingContext();
+ RenderLayer* renderingContextRoot() const { return m_3dRenderingContextRoot; }
const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlowPosition; }
// paints the layers that intersect the damage rect from back to
// front. The hitTest method looks for mouse events by walking
// layers that intersect the point from front to back.
- void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0,
- RenderRegion* = 0, PaintLayerFlags = 0);
+ void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = PaintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0);
bool hitTest(const HitTestRequest&, HitTestResult&);
bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot = 0);
bool preserves3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; }
bool has3DTransform() const { return m_transform && !m_transform->isAffine(); }
+ // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
+ bool shouldFlattenTransform() const { return renderer()->hasReflection() || !renderer()->style() || renderer()->style()->transformStyle3D() != TransformStyle3DPreserve3D; }
+
void filterNeedsRepaint();
bool hasFilter() const { return renderer()->hasFilter(); }
- bool paintsWithBlendMode() const { return m_blendInfo.hasBlendMode() && compositingState() != PaintsIntoOwnBacking; }
+ bool paintsWithBlendMode() const;
void* operator new(size_t);
// Only safe to call from RenderLayerModelObject::destroyLayer()
CompositingState compositingState() const;
+ // This returns true if our document is in a phase of its lifestyle during which
+ // compositing state may legally be read.
+ bool isAllowedToQueryCompositingState() const;
+
CompositedLayerMappingPtr compositedLayerMapping() const { return m_compositedLayerMapping.get(); }
CompositedLayerMappingPtr ensureCompositedLayerMapping();
void addLayerHitTestRects(LayerHitTestRects&) const;
+ // Compute rects only for this layer
+ void computeSelfHitTestRects(LayerHitTestRects&) const;
+
// FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed.
RenderLayerScrollableArea* scrollableArea() const { return m_scrollableArea.get(); }
RenderLayerRepainter& repainter() { return m_repainter; }
void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&);
void updateSelfPaintingLayer();
- void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle);
void updateOutOfFlowPositioned(const RenderStyle* oldStyle);
void paintPaginatedChildLayer(RenderLayer* childLayer, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags);
void paintChildLayerIntoColumns(RenderLayer* childLayer, GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags, const Vector<RenderLayer*>& columnLayers, size_t columnIndex);
- void collectFragments(LayerFragments&, const RenderLayer* rootLayer, RenderRegion*, const LayoutRect& dirtyRect,
+ void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const LayoutRect& dirtyRect,
ClipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize,
ShouldRespectOverflowClip = RespectOverflowClip, const LayoutPoint* offsetFromRoot = 0,
const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect* layerBoundingBox = 0);
bool shouldIsolateCompositedDescendants() const { return m_compositingProperties.shouldIsolateCompositedDescendants; }
void setShouldIsolateCompositedDescendants(bool b) { m_compositingProperties.shouldIsolateCompositedDescendants = b; }
- bool shouldInvalidateNextBacking() const { return m_compositingProperties.shouldInvalidateNextBacking; }
- void setShouldInvalidateNextBacking(bool b) { m_compositingProperties.shouldInvalidateNextBacking = b; }
+ bool lostGroupedMapping() const { return m_compositingProperties.lostGroupedMapping; }
+ void setLostGroupedMapping(bool b) { m_compositingProperties.lostGroupedMapping = b; }
void setCompositingReasons(CompositingReasons reasons) { m_compositingProperties.compositingReasons = reasons; }
CompositingReasons compositingReasons() const { return m_compositingProperties.compositingReasons; }
friend class RenderLayerModelObject;
protected:
+ LayerType m_layerType;
+
// Self-painting layer is an optimization where we avoid the heavy RenderLayer painting
// machinery for a RenderLayer allocated only to handle the overflow clip case.
// FIXME(crbug.com/332791): Self-painting layer should be merged into the overflow-only concept.
unsigned m_isSelfPaintingLayer : 1;
- unsigned m_isOverflowOnlyLayer : 1;
// If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
// significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
// Pointer to the enclosing RenderLayer that caused us to be paginated. It is 0 if we are not paginated.
RenderLayer* m_enclosingPaginationLayer;
+ // Pointer to the enclosing RenderLayer that establishes the 3d rendering context in which this layer participates.
+ // If it 0, it does not participate in a 3d rendering context.
+ RenderLayer* m_3dRenderingContextRoot;
+
// Properties that are computed while updating compositing layers. These values may be dirty/invalid if
// compositing status is not up-to-date before using them.
struct CompositingProperties {
: hasCompositingDescendant(false)
, hasNonCompositedChild(false)
, shouldIsolateCompositedDescendants(false)
- , shouldInvalidateNextBacking(false)
+ , lostGroupedMapping(false)
, viewportConstrainedNotCompositedReason(NoNotCompositedReason)
, compositingReasons(CompositingReasonNone)
{ }
// Should be for stacking contexts having unisolated blending descendants.
bool shouldIsolateCompositedDescendants : 1;
- // Used when the layer needs to cause a repaint invalidation but does not yet know which GraphicsLayer
- // it will be assigned to.
- bool shouldInvalidateNextBacking : 1;
+ // True if this render layer just lost its grouped mapping due to the CompositedLayerMapping being destroyed,
+ // and we don't yet know to what graphics layer this RenderLayer will be assigned.
+ bool lostGroupedMapping : 1;
// The reason, if any exists, that a fixed-position layer is chosen not to be composited.
unsigned viewportConstrainedNotCompositedReason : 2;