Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/BlockPainter.h" | 5 #include "core/paint/BlockPainter.h" |
| 6 | 6 |
| 7 #include "core/editing/DragCaretController.h" | 7 #include "core/editing/DragCaretController.h" |
| 8 #include "core/editing/FrameSelection.h" | 8 #include "core/editing/FrameSelection.h" |
| 9 #include "core/layout/LayoutFlexibleBox.h" | 9 #include "core/layout/LayoutFlexibleBox.h" |
| 10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 } else { | 187 } else { |
| 188 paintContents(contentsPaintInfo, paintOffset); | 188 paintContents(contentsPaintInfo, paintOffset); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 if (shouldPaintSelfOutline(paintPhase)) | 192 if (shouldPaintSelfOutline(paintPhase)) |
| 193 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset); | 193 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset); |
| 194 | 194 |
| 195 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, | 195 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, |
| 196 // then paint the caret. | 196 // then paint the caret. |
| 197 // LOG(ERROR) << "Painting caret [bounds=" << bounds.toString() << ", obj=" << m_layoutBlock.debugName() << "]."; | |
|
chrishtr
2016/09/01 15:00:13
remove these comments
wkorman
2016/09/01 23:40:41
Done.
| |
| 198 // m_layoutBlock.showLayoutTreeForThis(); | |
| 199 // TODO(wkorman): Consider moving recorder into caret, having caret be Displ ayItemClient for itself, | |
|
chrishtr
2016/09/01 15:00:13
The recorder is already in CaretBase.
wkorman
2016/09/01 23:40:40
Done.
| |
| 200 // and use logic in invalidateLocalCaretRect() for the caret visual rect. | |
| 197 if (paintPhase == PaintPhaseForeground && m_layoutBlock.hasCaret()) | 201 if (paintPhase == PaintPhaseForeground && m_layoutBlock.hasCaret()) |
| 198 paintCarets(paintInfo, paintOffset); | 202 paintCarets(paintInfo, paintOffset); |
| 199 } | 203 } |
| 200 | 204 |
| 201 void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) | 205 void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) |
| 202 { | 206 { |
| 203 LocalFrame* frame = m_layoutBlock.frame(); | 207 LocalFrame* frame = m_layoutBlock.frame(); |
| 204 | 208 |
| 205 if (m_layoutBlock.hasCursorCaret()) | 209 if (m_layoutBlock.hasCursorCaret()) |
| 206 frame->selection().paintCaret(paintInfo.context, paintOffset); | 210 frame->selection().paintCaret(paintInfo.context, paintOffset); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 } | 245 } |
| 242 | 246 |
| 243 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 247 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| 244 { | 248 { |
| 245 DCHECK(!m_layoutBlock.childrenInline()); | 249 DCHECK(!m_layoutBlock.childrenInline()); |
| 246 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 250 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 247 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 251 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
| 248 } | 252 } |
| 249 | 253 |
| 250 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |