Let setShouldDoFullPaintInvalidation accept reason

Combines setShouldDoFullPaintInvalidationWithReason() into
setShouldDoFullPaintInvalidation().

This is preparation to allow more paint invalidation reasons.

For now allow default value. In the future we may force every
setShouldDoFullPaintInvalidation to have a reason, when we can
remove the default value.

BUG=410465

Review URL: https://codereview.chromium.org/656643004

git-svn-id: svn://svn.chromium.org/blink/trunk@183700 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8b08b85e
...@@ -3046,7 +3046,7 @@ bool RenderObject::isRelayoutBoundaryForInspector() const ...@@ -3046,7 +3046,7 @@ bool RenderObject::isRelayoutBoundaryForInspector() const
return objectIsRelayoutBoundary(this); return objectIsRelayoutBoundary(this);
} }
void RenderObject::setShouldDoFullPaintInvalidationWithReason(PaintInvalidationReason reason) void RenderObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reason)
{ {
// Only full invalidation reasons are allowed. // Only full invalidation reasons are allowed.
ASSERT(isFullPaintInvalidationReason(reason)); ASSERT(isFullPaintInvalidationReason(reason));
...@@ -3054,7 +3054,7 @@ void RenderObject::setShouldDoFullPaintInvalidationWithReason(PaintInvalidationR ...@@ -3054,7 +3054,7 @@ void RenderObject::setShouldDoFullPaintInvalidationWithReason(PaintInvalidationR
// RenderText objects don't know how to invalidate paint for themselves, since they don't know how to compute their bounds. // RenderText objects don't know how to invalidate paint for themselves, since they don't know how to compute their bounds.
// Instead the parent fully invalidate when any text needs full paint invalidation. // Instead the parent fully invalidate when any text needs full paint invalidation.
if (isText()) { if (isText()) {
parent()->setShouldDoFullPaintInvalidationWithReason(reason); parent()->setShouldDoFullPaintInvalidation(reason);
return; return;
} }
......
...@@ -996,8 +996,7 @@ public: ...@@ -996,8 +996,7 @@ public:
void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& positionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking; } void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& positionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvalidationBacking; }
bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; } bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInvalidationReason() != PaintInvalidationNone; }
void setShouldDoFullPaintInvalidation() { setShouldDoFullPaintInvalidationWithReason(PaintInvalidationFull); } void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalidationFull);
void setShouldDoFullPaintInvalidationWithReason(PaintInvalidationReason);
void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone); } void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalidationReason(PaintInvalidationNone); }
bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInvalidateOverflowForPaint(); } bool shouldInvalidateOverflowForPaint() const { return m_bitfields.shouldInvalidateOverflowForPaint(); }
......
...@@ -162,7 +162,7 @@ void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* n ...@@ -162,7 +162,7 @@ void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* n
} }
newChild->setNeedsLayoutAndPrefWidthsRecalc(); newChild->setNeedsLayoutAndPrefWidthsRecalc();
newChild->setShouldDoFullPaintInvalidationWithReason(PaintInvalidationRendererInsertion); newChild->setShouldDoFullPaintInvalidation(PaintInvalidationRendererInsertion);
if (!owner->normalChildNeedsLayout()) if (!owner->normalChildNeedsLayout())
owner->setChildNeedsLayout(); // We may supply the static position for an absolute positioned child. owner->setChildNeedsLayout(); // We may supply the static position for an absolute positioned child.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment