| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/BlockFlowPaintInvalidator.h" | 5 #include "core/paint/BlockFlowPaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBlockFlow.h" | 7 #include "core/layout/LayoutBlockFlow.h" |
| 8 #include "core/paint/BoxPaintInvalidator.h" | 8 #include "core/paint/BoxPaintInvalidator.h" |
| 9 #include "core/paint/PaintInvalidator.h" | 9 #include "core/paint/PaintInvalidator.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 PaintInvalidationReason BlockFlowPaintInvalidator::invalidatePaintIfNeeded() | 13 PaintInvalidationReason BlockFlowPaintInvalidator::invalidatePaintIfNeeded() |
| 14 { | 14 { |
| 15 PaintInvalidationReason reason = BoxPaintInvalidator(m_blockFlow, m_context)
.invalidatePaintIfNeeded(); | 15 PaintInvalidationReason reason = BoxPaintInvalidator(m_blockFlow, m_context)
.invalidatePaintIfNeeded(); |
| 16 | 16 |
| 17 // TODO(wangxianzhu): Refactor the following into invalidateDisplayItemClien
ts(). |
| 18 |
| 17 if (reason == PaintInvalidationNone || reason == PaintInvalidationDelayedFul
l) | 19 if (reason == PaintInvalidationNone || reason == PaintInvalidationDelayedFul
l) |
| 18 return reason; | 20 return reason; |
| 19 | 21 |
| 20 RootInlineBox* line = m_blockFlow.firstRootBox(); | 22 RootInlineBox* line = m_blockFlow.firstRootBox(); |
| 21 if (line && line->isFirstLineStyle()) { | 23 if (line && line->isFirstLineStyle()) { |
| 22 // It's the RootInlineBox that paints the ::first-line background. Note
that since it may be | 24 // It's the RootInlineBox that paints the ::first-line background. Note
that since it may be |
| 23 // expensive to figure out if the first line is affected by any ::first-
line selectors at all, | 25 // expensive to figure out if the first line is affected by any ::first-
line selectors at all, |
| 24 // we just invalidate it unconditionally which is typically cheaper. | 26 // we just invalidate it unconditionally which is typically cheaper. |
| 25 m_blockFlow.invalidateDisplayItemClient(*line, reason); | 27 m_blockFlow.invalidateDisplayItemClient(*line, reason); |
| 26 } | 28 } |
| 29 |
| 30 if (m_blockFlow.multiColumnFlowThread()) { |
| 31 // Invalidate child LayoutMultiColumnSets which may need to repaint colu
mn rules after |
| 32 // m_blockFlow's column rule style and/or layout changed. |
| 33 for (LayoutObject* child = m_blockFlow.firstChild(); child; child = chil
d->nextSibling()) { |
| 34 if (child->isLayoutMultiColumnSet() && !child->shouldDoFullPaintInva
lidation()) |
| 35 m_blockFlow.invalidateDisplayItemClient(*child, reason); |
| 36 } |
| 37 } |
| 38 |
| 27 return reason; | 39 return reason; |
| 28 } | 40 } |
| 29 | 41 |
| 30 } // namespace blink | 42 } // namespace blink |
| OLD | NEW |