| 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); |
| 18 |
| 17 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) | 19 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) |
| 18 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffset); | 20 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffset); |
| 19 | 21 |
| 20 if (shouldPaintSelfOutline(paintInfo.phase) || | 22 if (shouldPaintSelfOutline(paintInfo.phase) || |
| 21 shouldPaintDescendantOutlines(paintInfo.phase)) { | 23 shouldPaintDescendantOutlines(paintInfo.phase)) { |
| 22 ObjectPainter painter(m_layoutInline); | 24 ObjectPainter painter(m_layoutInline); |
| 23 if (shouldPaintDescendantOutlines(paintInfo.phase)) | 25 if (shouldPaintDescendantOutlines(paintInfo.phase)) |
| 24 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); | 26 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); |
| 25 if (shouldPaintSelfOutline(paintInfo.phase) && | 27 if (shouldPaintSelfOutline(paintInfo.phase) && |
| 26 !m_layoutInline.isElementContinuation()) | 28 !m_layoutInline.isElementContinuation()) |
| 27 painter.paintOutline(paintInfo, paintOffset); | 29 painter.paintOutline(paintInfo, paintOffset); |
| 28 return; | 30 return; |
| 29 } | 31 } |
| 30 | 32 |
| 31 LineBoxListPainter(*m_layoutInline.lineBoxes()) | 33 LineBoxListPainter(*m_layoutInline.lineBoxes()) |
| 32 .paint(m_layoutInline, paintInfo, paintOffset); | 34 .paint(m_layoutInline, paintInfo, paintOffset); |
| 33 } | 35 } |
| 34 | 36 |
| 35 } // namespace blink | 37 } // namespace blink |
| OLD | NEW |