| 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 24 matching lines...) Expand all Loading... |
| 35 if (!intersectsPaintRect(paintInfo, adjustedPaintOffset)) | 35 if (!intersectsPaintRect(paintInfo, adjustedPaintOffset)) |
| 36 return; | 36 return; |
| 37 | 37 |
| 38 PaintInfo localPaintInfo(paintInfo); | 38 PaintInfo localPaintInfo(paintInfo); |
| 39 PaintPhase originalPhase = localPaintInfo.phase; | 39 PaintPhase originalPhase = localPaintInfo.phase; |
| 40 | 40 |
| 41 // There are some cases where not all clipped visual overflow is accounted | 41 // There are some cases where not all clipped visual overflow is accounted |
| 42 // for. | 42 // for. |
| 43 // FIXME: reduce the number of such cases. | 43 // FIXME: reduce the number of such cases. |
| 44 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; | 44 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; |
| 45 if (m_layoutBlock.hasOverflowClip() && !m_layoutBlock.hasControlClip() && | 45 if (m_layoutBlock.shouldClipOverflow() && !m_layoutBlock.hasControlClip() && |
| 46 !m_layoutBlock.hasCaret()) | 46 !m_layoutBlock.hasCaret()) |
| 47 contentsClipBehavior = SkipContentsClipIfPossible; | 47 contentsClipBehavior = SkipContentsClipIfPossible; |
| 48 | 48 |
| 49 if (originalPhase == PaintPhaseOutline) { | 49 if (originalPhase == PaintPhaseOutline) { |
| 50 localPaintInfo.phase = PaintPhaseDescendantOutlinesOnly; | 50 localPaintInfo.phase = PaintPhaseDescendantOutlinesOnly; |
| 51 } else if (shouldPaintSelfBlockBackground(originalPhase)) { | 51 } else if (shouldPaintSelfBlockBackground(originalPhase)) { |
| 52 localPaintInfo.phase = PaintPhaseSelfBlockBackgroundOnly; | 52 localPaintInfo.phase = PaintPhaseSelfBlockBackgroundOnly; |
| 53 m_layoutBlock.paintObject(localPaintInfo, adjustedPaintOffset); | 53 m_layoutBlock.paintObject(localPaintInfo, adjustedPaintOffset); |
| 54 if (shouldPaintDescendantBlockBackgrounds(originalPhase)) | 54 if (shouldPaintDescendantBlockBackgrounds(originalPhase)) |
| 55 localPaintInfo.phase = PaintPhaseDescendantBlockBackgroundsOnly; | 55 localPaintInfo.phase = PaintPhaseDescendantBlockBackgroundsOnly; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 void BlockPainter::paintContents(const PaintInfo& paintInfo, | 304 void BlockPainter::paintContents(const PaintInfo& paintInfo, |
| 305 const LayoutPoint& paintOffset) { | 305 const LayoutPoint& paintOffset) { |
| 306 DCHECK(!m_layoutBlock.childrenInline()); | 306 DCHECK(!m_layoutBlock.childrenInline()); |
| 307 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 307 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 308 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 308 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace blink | 311 } // namespace blink |
| OLD | NEW |