Chromium Code Reviews| 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" |
| 11 #include "core/paint/BlockPainter.h" | 11 #include "core/paint/BlockPainter.h" |
| 12 #include "core/paint/LayoutObjectDrawingRecorder.h" | 12 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 13 #include "core/paint/PaintInfo.h" | 13 #include "core/paint/PaintInfo.h" |
| 14 #include "platform/geometry/LayoutPoint.h" | 14 #include "platform/geometry/LayoutPoint.h" |
| 15 #include "platform/graphics/GraphicsContextStateSaver.h" | 15 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 16 #include "wtf/unicode/CharacterNames.h" | 16 #include "wtf/unicode/CharacterNames.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai ntOffset) | 20 void ListMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& pai ntOffset) |
| 21 { | 21 { |
| 22 if (paintInfo.phase != PaintPhaseForeground) | 22 if (paintInfo.phase != PaintPhaseForeground) |
| 23 return; | 23 return; |
| 24 | 24 |
| 25 if (m_layoutListMarker.style()->visibility() != VISIBLE) | 25 if (m_layoutListMarker.style()->visibility() != VISIBLE) |
| 26 return; | 26 return; |
| 27 | 27 |
| 28 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); | 28 LayoutPoint boxOrigin(paintOffset + m_layoutListMarker.location()); |
| 29 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); | 29 LayoutRect overflowRect(m_layoutListMarker.visualOverflowRect()); |
| 30 if (m_layoutListMarker.selectionState() != LayoutObject::SelectionNone) | |
| 31 overflowRect.unite(m_layoutListMarker.localSelectionRect()); | |
|
chrishtr
2015/06/04 18:13:22
I wonder if the other classes that have a special
fs
2015/06/05 08:56:19
Most likely - I added one for InlineTextBox last w
| |
| 30 overflowRect.moveBy(boxOrigin); | 32 overflowRect.moveBy(boxOrigin); |
| 31 | 33 |
| 32 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); | 34 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); |
| 33 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) | 35 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) |
| 34 return; | 36 return; |
| 35 | 37 |
| 36 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect); | 38 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutListMarker, paintInfo.phase, pixelSnappedOverflowRect); |
| 37 if (recorder.canUseCachedDrawing()) | 39 if (recorder.canUseCachedDrawing()) |
| 38 return; | 40 return; |
| 39 | 41 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 context->drawText(font, textRunPaintInfo, textOrigin); | 210 context->drawText(font, textRunPaintInfo, textOrigin); |
| 209 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid th(textRun), 0)); | 211 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid th(textRun), 0)); |
| 210 } else { | 212 } else { |
| 211 context->drawText(font, suffixRunInfo, textOrigin); | 213 context->drawText(font, suffixRunInfo, textOrigin); |
| 212 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font. width(suffixRun), 0)); | 214 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font. width(suffixRun), 0)); |
| 213 } | 215 } |
| 214 } | 216 } |
| 215 } | 217 } |
| 216 | 218 |
| 217 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |