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/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
9 #include "core/layout/LayoutTheme.h" | 9 #include "core/layout/LayoutTheme.h" |
10 #include "core/layout/line/RootInlineBox.h" | 10 #include "core/layout/line/RootInlineBox.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 21 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
22 { | 22 { |
23 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintInf
o.context.paintController().skippingCache()) { | 23 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintInf
o.context.paintController().skippingCache()) { |
24 if (m_layoutInline.paintOffsetChanged(paintOffset)) { | 24 if (m_layoutInline.paintOffsetChanged(paintOffset)) { |
25 paintInfo.context.paintController().invalidatePaintOffset(m_layoutIn
line); | 25 paintInfo.context.paintController().invalidatePaintOffset(m_layoutIn
line); |
26 LineBoxListPainter(*m_layoutInline.lineBoxes()).invalidateLineBoxPai
ntOffsets(paintInfo); | 26 LineBoxListPainter(*m_layoutInline.lineBoxes()).invalidateLineBoxPai
ntOffsets(paintInfo); |
27 } | 27 } |
28 // Set previousPaintOffset here in case that m_layoutInline paints nothi
ng and no | 28 // Set previousPaintOffset here in case that m_layoutInline paints nothi
ng and no |
29 // LayoutObjectDrawingRecorder updates its previousPaintOffset. | 29 // LayoutObjectDrawingRecorder updates its previousPaintOffset. |
30 // TODO(wangxianzhu): Integrate paint offset checking into new paint inv
alidation. | 30 // TODO(wangxianzhu): Integrate paint offset checking into new paint inv
alidation. |
31 m_layoutInline.mutableForPainting().setPreviousPaintOffset(paintOffset); | 31 m_layoutInline.getMutableForPainting().setPreviousPaintOffset(paintOffse
t); |
32 } | 32 } |
33 | 33 |
34 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) | 34 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting()) |
35 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs
et); | 35 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs
et); |
36 | 36 |
37 if (shouldPaintSelfOutline(paintInfo.phase) || shouldPaintDescendantOutlines
(paintInfo.phase)) { | 37 if (shouldPaintSelfOutline(paintInfo.phase) || shouldPaintDescendantOutlines
(paintInfo.phase)) { |
38 ObjectPainter painter(m_layoutInline); | 38 ObjectPainter painter(m_layoutInline); |
39 if (shouldPaintDescendantOutlines(paintInfo.phase)) | 39 if (shouldPaintDescendantOutlines(paintInfo.phase)) |
40 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); | 40 painter.paintInlineChildrenOutlines(paintInfo, paintOffset); |
41 if (shouldPaintSelfOutline(paintInfo.phase) && !m_layoutInline.isElement
Continuation()) | 41 if (shouldPaintSelfOutline(paintInfo.phase) && !m_layoutInline.isElement
Continuation()) |
42 painter.paintOutline(paintInfo, paintOffset); | 42 painter.paintOutline(paintInfo, paintOffset); |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(m_layoutInline, paintI
nfo, paintOffset); | 46 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(m_layoutInline, paintI
nfo, paintOffset); |
47 } | 47 } |
48 | 48 |
49 } // namespace blink | 49 } // namespace blink |
OLD | NEW |