| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/LineBoxListPainter.h" | 6 #include "core/paint/LineBoxListPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
| 9 #include "core/layout/line/InlineFlowBox.h" | 9 #include "core/layout/line/InlineFlowBox.h" |
| 10 #include "core/layout/line/LineBoxList.h" | 10 #include "core/layout/line/LineBoxList.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Only paint during the foreground/selection phases. | 30 // Only paint during the foreground/selection phases. |
| 31 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && paintInfo.phase != PaintPhaseOutline | 31 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && paintInfo.phase != PaintPhaseOutline |
| 32 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines && paintInfo.phase != PaintPhaseTextClip | 32 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines && paintInfo.phase != PaintPhaseTextClip |
| 33 && paintInfo.phase != PaintPhaseMask) | 33 && paintInfo.phase != PaintPhaseMask) |
| 34 return; | 34 return; |
| 35 | 35 |
| 36 ASSERT(layoutObject->isLayoutBlock() || (layoutObject->isLayoutInline() && l
ayoutObject->hasLayer())); // The only way an inline could paint like this is if
it has a layer. | 36 ASSERT(layoutObject->isLayoutBlock() || (layoutObject->isLayoutInline() && l
ayoutObject->hasLayer())); // The only way an inline could paint like this is if
it has a layer. |
| 37 | 37 |
| 38 // FIXME: When Skia supports annotation rect covering (https://code.google.c
om/p/skia/issues/detail?id=3872), | 38 // FIXME: When Skia supports annotation rect covering (https://code.google.c
om/p/skia/issues/detail?id=3872), |
| 39 // these rects may be covered line box drawings. Then we may need a dedicate
d paint phase. | 39 // these rects may be covered line box drawings. Then we may need a dedicate
d paint phase. |
| 40 if (paintInfo.phase == PaintPhaseForeground && paintInfo.context->printing()
) | 40 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) |
| 41 addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, pain
tOffset); | 41 addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, pain
tOffset); |
| 42 | 42 |
| 43 // If we have no lines then we have no work to do. | 43 // If we have no lines then we have no work to do. |
| 44 if (!m_lineBoxList.firstLineBox()) | 44 if (!m_lineBoxList.firstLineBox()) |
| 45 return; | 45 return; |
| 46 | 46 |
| 47 if (!m_lineBoxList.anyLineIntersectsRect(layoutObject, LayoutRect(paintInfo.
rect), paintOffset)) | 47 if (!m_lineBoxList.anyLineIntersectsRect(layoutObject, LayoutRect(paintInfo.
rect), paintOffset)) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 PaintInfo info(paintInfo); | 50 PaintInfo info(paintInfo); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline |
| info.phase == PaintPhaseChildOutlines) { | 64 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline |
| info.phase == PaintPhaseChildOutlines) { |
| 65 for (LayoutInline* flow : *info.outlineObjects()) | 65 for (LayoutInline* flow : *info.outlineObjects()) |
| 66 InlinePainter(*flow).paintOutline(info, paintOffset); | 66 InlinePainter(*flow).paintOutline(info, paintOffset); |
| 67 info.outlineObjects()->clear(); | 67 info.outlineObjects()->clear(); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| OLD | NEW |