Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: third_party/WebKit/Source/core/paint/BlockPainter.cpp

Issue 2292353003: Cherry-pick r415013 to M53. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } else { 186 } else {
187 paintContents(contentsPaintInfo, paintOffset); 187 paintContents(contentsPaintInfo, paintOffset);
188 } 188 }
189 } 189 }
190 190
191 if (shouldPaintSelfOutline(paintPhase)) 191 if (shouldPaintSelfOutline(paintPhase))
192 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset); 192 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset);
193 193
194 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, 194 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground,
195 // then paint the caret. 195 // then paint the caret.
196 if (paintPhase == PaintPhaseForeground && m_layoutBlock.hasCaret() && !Layou tObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, m_layoutBl ock, DisplayItem::Caret)) { 196 if (paintPhase == PaintPhaseForeground && m_layoutBlock.hasCaret())
197 LayoutRect bounds = m_layoutBlock.visualOverflowRect();
198 bounds.moveBy(paintOffset);
199 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutBlock, D isplayItem::Caret, bounds);
200 paintCarets(paintInfo, paintOffset); 197 paintCarets(paintInfo, paintOffset);
201 }
202 } 198 }
203 199
204 void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) 200 void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset)
205 { 201 {
206 LocalFrame* frame = m_layoutBlock.frame(); 202 LocalFrame* frame = m_layoutBlock.frame();
207 203
208 if (m_layoutBlock.hasCursorCaret()) 204 if (m_layoutBlock.hasCursorCaret())
209 frame->selection().paintCaret(paintInfo.context, paintOffset); 205 frame->selection().paintCaret(paintInfo.context, paintOffset);
210 206
211 if (m_layoutBlock.hasDragCaret()) 207 if (m_layoutBlock.hasDragCaret())
(...skipping 24 matching lines...) Expand all
236 } 232 }
237 233
238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 234 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
239 { 235 {
240 DCHECK(!m_layoutBlock.childrenInline()); 236 DCHECK(!m_layoutBlock.childrenInline());
241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 237 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 238 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
243 } 239 }
244 240
245 } // namespace blink 241 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698