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/ListMarkerPainter.h" | 5 #include "core/paint/ListMarkerPainter.h" |
6 | 6 |
7 #include "core/layout/LayoutListItem.h" | 7 #include "core/layout/LayoutListItem.h" |
8 #include "core/layout/LayoutListMarker.h" | 8 #include "core/layout/LayoutListMarker.h" |
9 #include "core/layout/ListMarkerText.h" | 9 #include "core/layout/ListMarkerText.h" |
10 #include "core/layout/api/SelectionState.h" | 10 #include "core/layout/api/SelectionState.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 ASSERT_NOT_REACHED(); | 37 ASSERT_NOT_REACHED(); |
38 break; | 38 break; |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai
ntOffset) | 42 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai
ntOffset) |
43 { | 43 { |
44 if (paintInfo.phase != PaintPhaseForeground) | 44 if (paintInfo.phase != PaintPhaseForeground) |
45 return; | 45 return; |
46 | 46 |
47 if (m_layoutListMarker.style()->visibility() != VISIBLE) | 47 if (m_layoutListMarker.style()->visibility() != EVisibility::Visible) |
48 return; | 48 return; |
49 | 49 |
50 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutListMarker, paintInfo.phase)) | 50 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutListMarker, paintInfo.phase)) |
51 return; | 51 return; |
52 | 52 |
53 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); | 53 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); |
54 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); | 54 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); |
55 overflowRect.moveBy(boxOrigin); | 55 overflowRect.moveBy(boxOrigin); |
56 | 56 |
57 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); | 57 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (m_layoutListMarker.style()->isLeftToRightDirection()) { | 139 if (m_layoutListMarker.style()->isLeftToRightDirection()) { |
140 context.drawText(font, textRunPaintInfo, textOrigin); | 140 context.drawText(font, textRunPaintInfo, textOrigin); |
141 context.drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(te
xtRun), 0)); | 141 context.drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(te
xtRun), 0)); |
142 } else { | 142 } else { |
143 context.drawText(font, suffixRunInfo, textOrigin); | 143 context.drawText(font, suffixRunInfo, textOrigin); |
144 context.drawText(font, textRunPaintInfo, textOrigin + IntSize(font.width
(suffixRun), 0)); | 144 context.drawText(font, textRunPaintInfo, textOrigin + IntSize(font.width
(suffixRun), 0)); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 } // namespace blink | 148 } // namespace blink |
OLD | NEW |