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/InlinePainter.h" | 6 #include "core/paint/InlinePainter.h" |
7 | 7 |
8 #include "core/layout/LayoutBlock.h" | 8 #include "core/layout/LayoutBlock.h" |
9 #include "core/layout/LayoutInline.h" | 9 #include "core/layout/LayoutInline.h" |
10 #include "core/layout/LayoutTheme.h" | 10 #include "core/layout/LayoutTheme.h" |
11 #include "core/layout/line/RootInlineBox.h" | 11 #include "core/layout/line/RootInlineBox.h" |
12 #include "core/paint/BoxPainter.h" | 12 #include "core/paint/BoxPainter.h" |
13 #include "core/paint/LayoutObjectDrawingRecorder.h" | 13 #include "core/paint/LayoutObjectDrawingRecorder.h" |
14 #include "core/paint/LineBoxListPainter.h" | 14 #include "core/paint/LineBoxListPainter.h" |
15 #include "core/paint/ObjectPainter.h" | 15 #include "core/paint/ObjectPainter.h" |
16 #include "core/paint/PaintInfo.h" | 16 #include "core/paint/PaintInfo.h" |
17 #include "platform/geometry/LayoutPoint.h" | 17 #include "platform/geometry/LayoutPoint.h" |
18 #include <limits> | 18 #include <limits> |
19 | 19 |
20 namespace blink { | 20 namespace blink { |
21 | 21 |
22 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 22 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
23 { | 23 { |
| 24 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && m_layoutI
nline.paintOffsetChanged(paintOffset)) |
| 25 LineBoxListPainter(*m_layoutInline.lineBoxes()).invalidateLineBoxPaintOf
fsets(paintInfo); |
| 26 |
24 // FIXME: When Skia supports annotation rect covering (https://code.google.c
om/p/skia/issues/detail?id=3872), | 27 // FIXME: When Skia supports annotation rect covering (https://code.google.c
om/p/skia/issues/detail?id=3872), |
25 // this rect may be covered by foreground and descendant drawings. Then we m
ay need a dedicated paint phase. | 28 // this rect may be covered by foreground and descendant drawings. Then we m
ay need a dedicated paint phase. |
26 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) | 29 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) |
27 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs
et); | 30 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs
et); |
28 | 31 |
29 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline || paintInfo.phase == PaintPhaseChildOutlines) { | 32 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline || paintInfo.phase == PaintPhaseChildOutlines) { |
30 ObjectPainter painter(m_layoutInline); | 33 ObjectPainter painter(m_layoutInline); |
31 if (paintInfo.phase != PaintPhaseSelfOutline) | 34 if (paintInfo.phase != PaintPhaseSelfOutline) |
32 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); | 35 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); |
33 if (paintInfo.phase != PaintPhaseChildOutlines && !m_layoutInline.isElem
entContinuation()) | 36 if (paintInfo.phase != PaintPhaseChildOutlines && !m_layoutInline.isElem
entContinuation()) |
34 painter.paintOutline(paintInfo, paintOffset); | 37 painter.paintOutline(paintInfo, paintOffset); |
35 return; | 38 return; |
36 } | 39 } |
37 | 40 |
38 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(&m_layoutInline, paint
Info, paintOffset); | 41 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(&m_layoutInline, paint
Info, paintOffset); |
39 } | 42 } |
40 | 43 |
41 } // namespace blink | 44 } // namespace blink |
OLD | NEW |