Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/ObjectPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/ObjectPainter.cpp b/third_party/WebKit/Source/core/paint/ObjectPainter.cpp |
| index 7f066d4b82ef53a33ef9c250d53873d174e9e8ea..70a6a92753c040f58bea2553a8226992c72ade9d 100644 |
| --- a/third_party/WebKit/Source/core/paint/ObjectPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/ObjectPainter.cpp |
| @@ -188,7 +188,7 @@ void paintComplexOutline(GraphicsContext& graphicsContext, const Vector<IntRect> |
| void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| - ASSERT(paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline); |
| + ASSERT(shouldPaintSelfOutline(paintInfo.phase)); |
| const ComputedStyle& styleToUse = m_layoutObject.styleRef(); |
| if (!styleToUse.hasOutline() || styleToUse.visibility() != VISIBLE) |
| @@ -241,14 +241,12 @@ void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& |
| void ObjectPainter::paintInlineChildrenOutlines(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| - ASSERT(paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseDescendantOutlines); |
| - |
| - PaintInfo childPaintInfo(paintInfo); |
| - childPaintInfo.phase = paintInfo.phase == PaintPhaseDescendantOutlines ? PaintPhaseOutline : paintInfo.phase; |
| + ASSERT(shouldPaintDescendantOutlines(paintInfo.phase)); |
| + PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| for (LayoutObject* child = m_layoutObject.slowFirstChild(); child; child = child->nextSibling()) { |
| if (child->isLayoutInline() && !toLayoutInline(child)->hasSelfPaintingLayer()) |
| - child->paint(childPaintInfo, paintOffset); |
| + child->paint(paintInfoForDescendants, paintOffset); |
| } |
| } |
| @@ -536,23 +534,23 @@ void ObjectPainter::drawSolidBoxSide(GraphicsContext& graphicsContext, int x1, i |
| void ObjectPainter::paintAsPseudoStackingContext(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| - bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip; |
| - if (!preservePhase && paintInfo.phase != PaintPhaseForeground) |
| + if (paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip) { |
|
pdr.
2016/01/14 19:51:50
Can you add a comment here about why we preserve t
Xianzhu
2016/01/15 01:05:33
Done.
|
| + m_layoutObject.paint(paintInfo, paintOffset); |
| + return; |
| + } |
| + |
| + if (paintInfo.phase != PaintPhaseForeground) |
| return; |
| PaintInfo info(paintInfo); |
| - info.phase = preservePhase ? paintInfo.phase : PaintPhaseSelfBlockBackground; |
| + info.phase = PaintPhaseBlockBackground; |
| + m_layoutObject.paint(info, paintOffset); |
| + info.phase = PaintPhaseFloat; |
| + m_layoutObject.paint(info, paintOffset); |
| + info.phase = PaintPhaseForeground; |
| + m_layoutObject.paint(info, paintOffset); |
| + info.phase = PaintPhaseOutline; |
| m_layoutObject.paint(info, paintOffset); |
| - if (!preservePhase) { |
| - info.phase = PaintPhaseDescendantBlockBackgrounds; |
| - m_layoutObject.paint(info, paintOffset); |
| - info.phase = PaintPhaseFloat; |
| - m_layoutObject.paint(info, paintOffset); |
| - info.phase = PaintPhaseForeground; |
| - m_layoutObject.paint(info, paintOffset); |
| - info.phase = PaintPhaseOutline; |
| - m_layoutObject.paint(info, paintOffset); |
| - } |
| } |
| } // namespace blink |