| 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/paint/BlockPainter.h" | 8 #include "core/paint/BlockPainter.h" |
| 9 #include "core/paint/GraphicsContextAnnotator.h" | 9 #include "core/paint/GraphicsContextAnnotator.h" |
| 10 #include "core/paint/RenderDrawingRecorder.h" | 10 #include "core/paint/RenderDrawingRecorder.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 LayoutRect box(boxOrigin, m_renderListMarker.size()); | 43 LayoutRect box(boxOrigin, m_renderListMarker.size()); |
| 44 | 44 |
| 45 IntRect marker = m_renderListMarker.getRelativeMarkerRect(); | 45 IntRect marker = m_renderListMarker.getRelativeMarkerRect(); |
| 46 marker.moveBy(roundedIntPoint(boxOrigin)); | 46 marker.moveBy(roundedIntPoint(boxOrigin)); |
| 47 | 47 |
| 48 GraphicsContext* context = paintInfo.context; | 48 GraphicsContext* context = paintInfo.context; |
| 49 | 49 |
| 50 if (m_renderListMarker.isImage()) { | 50 if (m_renderListMarker.isImage()) { |
| 51 context->drawImage(m_renderListMarker.image()->image(&m_renderListMarker
, marker.size()).get(), marker); | 51 context->drawImage(m_renderListMarker.image()->image(&m_renderListMarker
, marker.size()).get(), marker); |
| 52 if (m_renderListMarker.selectionState() != RenderObject::SelectionNone)
{ | 52 if (m_renderListMarker.selectionState() != LayoutObject::SelectionNone)
{ |
| 53 LayoutRect selRect = m_renderListMarker.localSelectionRect(); | 53 LayoutRect selRect = m_renderListMarker.localSelectionRect(); |
| 54 selRect.moveBy(boxOrigin); | 54 selRect.moveBy(boxOrigin); |
| 55 context->fillRect(pixelSnappedIntRect(selRect), m_renderListMarker.s
electionBackgroundColor()); | 55 context->fillRect(pixelSnappedIntRect(selRect), m_renderListMarker.s
electionBackgroundColor()); |
| 56 } | 56 } |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 | 59 |
| 60 if (m_renderListMarker.selectionState() != RenderObject::SelectionNone) { | 60 if (m_renderListMarker.selectionState() != LayoutObject::SelectionNone) { |
| 61 LayoutRect selRect = m_renderListMarker.localSelectionRect(); | 61 LayoutRect selRect = m_renderListMarker.localSelectionRect(); |
| 62 selRect.moveBy(boxOrigin); | 62 selRect.moveBy(boxOrigin); |
| 63 context->fillRect(pixelSnappedIntRect(selRect), m_renderListMarker.selec
tionBackgroundColor()); | 63 context->fillRect(pixelSnappedIntRect(selRect), m_renderListMarker.selec
tionBackgroundColor()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 const Color color(m_renderListMarker.resolveColor(CSSPropertyColor)); | 66 const Color color(m_renderListMarker.resolveColor(CSSPropertyColor)); |
| 67 context->setStrokeColor(color); | 67 context->setStrokeColor(color); |
| 68 context->setStrokeStyle(SolidStroke); | 68 context->setStrokeStyle(SolidStroke); |
| 69 context->setStrokeThickness(1.0f); | 69 context->setStrokeThickness(1.0f); |
| 70 context->setFillColor(color); | 70 context->setFillColor(color); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 context->drawText(font, textRunPaintInfo, textOrigin); | 211 context->drawText(font, textRunPaintInfo, textOrigin); |
| 212 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); | 212 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); |
| 213 } else { | 213 } else { |
| 214 context->drawText(font, suffixRunInfo, textOrigin); | 214 context->drawText(font, suffixRunInfo, textOrigin); |
| 215 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); | 215 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |