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/BlockPaintInvalidator.h" | 5 #include "core/paint/BlockPaintInvalidator.h" |
6 | 6 |
| 7 #include "core/editing/DragCaret.h" |
7 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
8 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
9 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
| 11 #include "core/page/Page.h" |
10 #include "core/paint/BoxPaintInvalidator.h" | 12 #include "core/paint/BoxPaintInvalidator.h" |
| 13 #include "core/paint/ObjectPaintInvalidator.h" |
11 #include "core/paint/PaintInvalidator.h" | 14 #include "core/paint/PaintInvalidator.h" |
12 | 15 |
13 namespace blink { | 16 namespace blink { |
14 | 17 |
15 PaintInvalidationReason BlockPaintInvalidator::invalidatePaintIfNeeded() { | 18 void BlockPaintInvalidator::clearPreviousVisualRects() { |
| 19 m_block.frame()->selection().clearPreviousCaretVisualRect(m_block); |
| 20 m_block.frame()->page()->dragCaret().clearPreviousVisualRect(m_block); |
| 21 } |
| 22 |
| 23 PaintInvalidationReason BlockPaintInvalidator::invalidatePaintIfNeeded( |
| 24 const PaintInvalidatorContext& context) { |
16 PaintInvalidationReason reason = | 25 PaintInvalidationReason reason = |
17 BoxPaintInvalidator(m_block, m_context).invalidatePaintIfNeeded(); | 26 BoxPaintInvalidator(m_block, context).invalidatePaintIfNeeded(); |
18 | 27 |
19 if (reason != PaintInvalidationNone && m_block.hasCaret()) { | 28 m_block.frame()->selection().invalidatePaintIfNeeded(m_block, context, |
20 FrameSelection& selection = m_block.frame()->selection(); | 29 reason); |
21 selection.setCaretRectNeedsUpdate(); | 30 m_block.frame()->page()->dragCaret().invalidatePaintIfNeeded(m_block, context, |
22 selection.invalidateCaretRect(true); | 31 reason); |
23 } | 32 |
24 return reason; | 33 return reason; |
25 } | 34 } |
26 } | 35 } |
OLD | NEW |