| 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/RenderDrawingRecorder.h" | 9 #include "core/paint/RenderDrawingRecorder.h" |
| 10 #include "core/rendering/GraphicsContextAnnotator.h" | 10 #include "core/rendering/GraphicsContextAnnotator.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 return; | 29 return; |
| 30 | 30 |
| 31 LayoutPoint boxOrigin(paintOffset + m_renderListMarker.location()); | 31 LayoutPoint boxOrigin(paintOffset + m_renderListMarker.location()); |
| 32 LayoutRect overflowRect(m_renderListMarker.visualOverflowRect()); | 32 LayoutRect overflowRect(m_renderListMarker.visualOverflowRect()); |
| 33 overflowRect.moveBy(boxOrigin); | 33 overflowRect.moveBy(boxOrigin); |
| 34 | 34 |
| 35 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); | 35 IntRect pixelSnappedOverflowRect = pixelSnappedIntRect(overflowRect); |
| 36 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) | 36 if (!paintInfo.rect.intersects(pixelSnappedOverflowRect)) |
| 37 return; | 37 return; |
| 38 | 38 |
| 39 RenderDrawingRecorder recorder(paintInfo.context, &m_renderListMarker, paint
Info.phase, pixelSnappedOverflowRect); | 39 RenderDrawingRecorder recorder(paintInfo.context, m_renderListMarker, paintI
nfo.phase, pixelSnappedOverflowRect); |
| 40 if (recorder.canUseCachedDrawing()) |
| 41 return; |
| 42 |
| 40 LayoutRect box(boxOrigin, m_renderListMarker.size()); | 43 LayoutRect box(boxOrigin, m_renderListMarker.size()); |
| 41 | 44 |
| 42 IntRect marker = m_renderListMarker.getRelativeMarkerRect(); | 45 IntRect marker = m_renderListMarker.getRelativeMarkerRect(); |
| 43 marker.moveBy(roundedIntPoint(boxOrigin)); | 46 marker.moveBy(roundedIntPoint(boxOrigin)); |
| 44 | 47 |
| 45 GraphicsContext* context = paintInfo.context; | 48 GraphicsContext* context = paintInfo.context; |
| 46 | 49 |
| 47 if (m_renderListMarker.isImage()) { | 50 if (m_renderListMarker.isImage()) { |
| 48 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); |
| 49 if (m_renderListMarker.selectionState() != RenderObject::SelectionNone)
{ | 52 if (m_renderListMarker.selectionState() != RenderObject::SelectionNone)
{ |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 context->drawText(font, textRunPaintInfo, textOrigin); | 211 context->drawText(font, textRunPaintInfo, textOrigin); |
| 209 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); | 212 context->drawText(font, suffixRunInfo, textOrigin + IntSize(font.wid
th(textRun), 0)); |
| 210 } else { | 213 } else { |
| 211 context->drawText(font, suffixRunInfo, textOrigin); | 214 context->drawText(font, suffixRunInfo, textOrigin); |
| 212 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); | 215 context->drawText(font, textRunPaintInfo, textOrigin + IntSize(font.
width(suffixRun), 0)); |
| 213 } | 216 } |
| 214 } | 217 } |
| 215 } | 218 } |
| 216 | 219 |
| 217 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |