| 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/ListMarkerPainter.h" | 6 #include "core/paint/ListMarkerPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutListItem.h" | 8 #include "core/layout/LayoutListItem.h" |
| 9 #include "core/layout/LayoutListMarker.h" | 9 #include "core/layout/LayoutListMarker.h" |
| 10 #include "core/layout/TextRunConstructor.h" | 10 #include "core/layout/TextRunConstructor.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); | 32 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); |
| 33 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); | 33 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); |
| 34 if (m_layoutListMarker.selectionState() != SelectionNone) | 34 if (m_layoutListMarker.selectionState() != SelectionNone) |
| 35 overflowRect.unite(m_layoutListMarker.localSelectionRect()); | 35 overflowRect.unite(m_layoutListMarker.localSelectionRect()); |
| 36 overflowRect.moveBy(boxOrigin); | 36 overflowRect.moveBy(boxOrigin); |
| 37 | 37 |
| 38 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); | 38 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); |
| 39 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) | 39 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) |
| 40 return; | 40 return; |
| 41 | 41 |
| 42 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker,
paintInfo.phase, pixelSnappedOverflowRect); | 42 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker,
paintInfo.phase, LayoutRect(pixelSnappedOverflowRect)); |
| 43 | 43 |
| 44 LayoutRect box(boxOrigin, m_layoutListMarker.size()); | 44 LayoutRect box(boxOrigin, m_layoutListMarker.size()); |
| 45 | 45 |
| 46 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); | 46 IntRect marker = m_layoutListMarker.getRelativeMarkerRect(); |
| 47 marker.moveBy(roundedIntPoint(boxOrigin)); | 47 marker.moveBy(roundedIntPoint(boxOrigin)); |
| 48 | 48 |
| 49 GraphicsContext* context = paintInfo.context; | 49 GraphicsContext* context = paintInfo.context; |
| 50 | 50 |
| 51 if (m_layoutListMarker.isImage()) { | 51 if (m_layoutListMarker.isImage()) { |
| 52 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker
, marker.size()).get(), marker); | 52 context->drawImage(m_layoutListMarker.image()->image(&m_layoutListMarker
, marker.size()).get(), marker); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 if (m_layoutListMarker.style()->isLeftToRightDirection()) { | 183 if (m_layoutListMarker.style()->isLeftToRightDirection()) { |
| 184 context->drawText(font, textRunPaintInfo, textOrigin); | 184 context->drawText(font, textRunPaintInfo, textOrigin); |
| 185 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t
extRun), 0)); | 185 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.width(t
extRun), 0)); |
| 186 } else { | 186 } else { |
| 187 context->drawText(font, suffixRunInfo, textOrigin); | 187 context->drawText(font, suffixRunInfo, textOrigin); |
| 188 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt
h(suffixRun), 0)); | 188 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.widt
h(suffixRun), 0)); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace blink | 192 } // namespace blink |
| OLD | NEW |