Chromium Code Reviews| 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/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
| 9 #include "core/paint/BoxPaintInvalidator.h" | 9 #include "core/paint/BoxPaintInvalidator.h" |
| 10 #include "core/paint/PaintInvalidator.h" | 10 #include "core/paint/PaintInvalidator.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 ObjectPaintInvalidator objectPaintInvalidator(m_blockFlow); | 43 ObjectPaintInvalidator objectPaintInvalidator(m_blockFlow); |
| 44 objectPaintInvalidator.invalidateDisplayItemClient(m_blockFlow, reason); | 44 objectPaintInvalidator.invalidateDisplayItemClient(m_blockFlow, reason); |
| 45 | 45 |
| 46 // PaintInvalidationRectangle happens when we invalidate the caret. | 46 // PaintInvalidationRectangle happens when we invalidate the caret. |
| 47 // The later conditions don't apply when we invalidate the caret or the | 47 // The later conditions don't apply when we invalidate the caret or the |
| 48 // selection. | 48 // selection. |
| 49 if (reason == PaintInvalidationRectangle || | 49 if (reason == PaintInvalidationRectangle || |
| 50 reason == PaintInvalidationSelection) | 50 reason == PaintInvalidationSelection) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 // If the block is a continuation or containing block of an inline | |
| 54 // continuation, invalidate the start object of the continuations if it has | |
| 55 // focus ring because change of continuation may change the shape of the focus | |
| 56 // ring. | |
| 57 if (m_blockFlow.isAnonymous()) { | |
| 58 LayoutObject* startOfContinuations = nullptr; | |
| 59 if (LayoutInline* inlineElementContinuation = | |
| 60 m_blockFlow.inlineElementContinuation()) { | |
| 61 // This block is an anonymous block continuation. | |
| 62 startOfContinuations = inlineElementContinuation->node()->layoutObject(); | |
| 63 } else if (LayoutObject* firstChild = m_blockFlow.firstChild()) { | |
| 64 // This block is the anonymous containing block of an inline element | |
| 65 // continuation. | |
| 66 if (firstChild->isElementContinuation()) | |
| 67 startOfContinuations = firstChild->node()->layoutObject(); | |
| 68 } | |
| 69 if (startOfContinuations && | |
| 70 startOfContinuations->styleRef().outlineStyleIsAuto()) | |
| 71 ObjectPaintInvalidator(*startOfContinuations) | |
| 72 .slowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient( | |
|
wkorman
2017/03/21 19:31:52
This change removes this display item client inval
Xianzhu
2017/03/22 02:46:07
Yes. With setMayNeedPaintInvalidation(), we will u
| |
| 73 *startOfContinuations, reason); | |
| 74 } | |
| 75 | |
| 76 RootInlineBox* line = m_blockFlow.firstRootBox(); | 53 RootInlineBox* line = m_blockFlow.firstRootBox(); |
| 77 if (line && line->isFirstLineStyle()) { | 54 if (line && line->isFirstLineStyle()) { |
| 78 // It's the RootInlineBox that paints the ::first-line background. Note that | 55 // It's the RootInlineBox that paints the ::first-line background. Note that |
| 79 // since it may be expensive to figure out if the first line is affected by | 56 // since it may be expensive to figure out if the first line is affected by |
| 80 // any ::first-line selectors at all, we just invalidate it unconditionally | 57 // any ::first-line selectors at all, we just invalidate it unconditionally |
| 81 // which is typically cheaper. | 58 // which is typically cheaper. |
| 82 objectPaintInvalidator.invalidateDisplayItemClient(*line, reason); | 59 objectPaintInvalidator.invalidateDisplayItemClient(*line, reason); |
| 83 } | 60 } |
| 84 | 61 |
| 85 if (m_blockFlow.multiColumnFlowThread()) { | 62 if (m_blockFlow.multiColumnFlowThread()) { |
| 86 // Invalidate child LayoutMultiColumnSets which may need to repaint column | 63 // Invalidate child LayoutMultiColumnSets which may need to repaint column |
| 87 // rules after m_blockFlow's column rule style and/or layout changed. | 64 // rules after m_blockFlow's column rule style and/or layout changed. |
| 88 for (LayoutObject* child = m_blockFlow.firstChild(); child; | 65 for (LayoutObject* child = m_blockFlow.firstChild(); child; |
| 89 child = child->nextSibling()) { | 66 child = child->nextSibling()) { |
| 90 if (child->isLayoutMultiColumnSet() && | 67 if (child->isLayoutMultiColumnSet() && |
| 91 !child->shouldDoFullPaintInvalidation()) | 68 !child->shouldDoFullPaintInvalidation()) |
| 92 objectPaintInvalidator.invalidateDisplayItemClient(*child, reason); | 69 objectPaintInvalidator.invalidateDisplayItemClient(*child, reason); |
| 93 } | 70 } |
| 94 } | 71 } |
| 95 } | 72 } |
| 96 | 73 |
| 97 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |