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/ReplacedPainter.h" | 6 #include "core/paint/ReplacedPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutReplaced.h" | 8 #include "core/layout/LayoutReplaced.h" |
9 #include "core/paint/BoxPainter.h" | 9 #include "core/paint/BoxPainter.h" |
10 #include "core/paint/DeprecatedPaintLayer.h" | 10 #include "core/paint/DeprecatedPaintLayer.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (paintInfo.phase == PaintPhaseClippingMask) { | 80 if (paintInfo.phase == PaintPhaseClippingMask) { |
81 BoxPainter(m_layoutReplaced).paintClippingMask(paintInfo, adjust
edPaintOffset); | 81 BoxPainter(m_layoutReplaced).paintClippingMask(paintInfo, adjust
edPaintOffset); |
82 } else { | 82 } else { |
83 m_layoutReplaced.paintReplaced(paintInfo, adjustedPaintOffset); | 83 m_layoutReplaced.paintReplaced(paintInfo, adjustedPaintOffset); |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 // The selection tint never gets clipped by border-radius rounding, since we
want it to run right up to the edges of | 88 // The selection tint never gets clipped by border-radius rounding, since we
want it to run right up to the edges of |
89 // surrounding content. | 89 // surrounding content. |
90 bool drawSelectionTint = paintInfo.phase == PaintPhaseForeground && m_layout
Replaced.selectionState() != LayoutObject::SelectionNone && !m_layoutReplaced.do
cument().printing(); | 90 bool drawSelectionTint = paintInfo.phase == PaintPhaseForeground && m_layout
Replaced.selectionState() != LayoutObject::SelectionNone && !paintInfo.isPrintin
g(); |
91 if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPos
sible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint)) { | 91 if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPos
sible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint)) { |
92 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect()
; | 92 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect()
; |
93 selectionPaintingRect.moveBy(adjustedPaintOffset); | 93 selectionPaintingRect.moveBy(adjustedPaintOffset); |
94 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); | 94 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); |
95 | 95 |
96 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); | 96 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); |
97 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); | 97 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
OLD | NEW |