| 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/InlinePainter.h" | 5 #include "core/paint/InlinePainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutInline.h" | 7 #include "core/layout/LayoutInline.h" |
| 8 #include "core/paint/LineBoxListPainter.h" | 8 #include "core/paint/LineBoxListPainter.h" |
| 9 #include "core/paint/ObjectPainter.h" | 9 #include "core/paint/ObjectPainter.h" |
| 10 #include "core/paint/PaintInfo.h" | 10 #include "core/paint/PaintInfo.h" |
| 11 #include "platform/geometry/LayoutPoint.h" | 11 #include "platform/geometry/LayoutPoint.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 void InlinePainter::paint(const PaintInfo& paintInfo, | 15 void InlinePainter::paint(const PaintInfo& paintInfo, |
| 16 const LayoutPoint& paintOffset) { | 16 const LayoutPoint& paintOffset) { |
| 17 ObjectPainter(m_layoutInline).checkPaintOffset(paintInfo, paintOffset); |
| 17 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) | 18 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) |
| 18 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffset); | 19 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffset); |
| 19 | 20 |
| 20 if (shouldPaintSelfOutline(paintInfo.phase) || | 21 if (shouldPaintSelfOutline(paintInfo.phase) || |
| 21 shouldPaintDescendantOutlines(paintInfo.phase)) { | 22 shouldPaintDescendantOutlines(paintInfo.phase)) { |
| 22 ObjectPainter painter(m_layoutInline); | 23 ObjectPainter painter(m_layoutInline); |
| 23 if (shouldPaintDescendantOutlines(paintInfo.phase)) | 24 if (shouldPaintDescendantOutlines(paintInfo.phase)) |
| 24 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); | 25 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); |
| 25 if (shouldPaintSelfOutline(paintInfo.phase) && | 26 if (shouldPaintSelfOutline(paintInfo.phase) && |
| 26 !m_layoutInline.isElementContinuation()) | 27 !m_layoutInline.isElementContinuation()) |
| 27 painter.paintOutline(paintInfo, paintOffset); | 28 painter.paintOutline(paintInfo, paintOffset); |
| 28 return; | 29 return; |
| 29 } | 30 } |
| 30 | 31 |
| 31 LineBoxListPainter(*m_layoutInline.lineBoxes()) | 32 LineBoxListPainter(*m_layoutInline.lineBoxes()) |
| 32 .paint(m_layoutInline, paintInfo, paintOffset); | 33 .paint(m_layoutInline, paintInfo, paintOffset); |
| 33 } | 34 } |
| 34 | 35 |
| 35 } // namespace blink | 36 } // namespace blink |
| OLD | NEW |