| 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/layout/api/SelectionState.h" | 9 #include "core/layout/api/SelectionState.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (paintInfo.phase == PaintPhaseMask) { | 31 if (paintInfo.phase == PaintPhaseMask) { |
| 32 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); | 32 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); |
| 33 return; | 33 return; |
| 34 } | 34 } |
| 35 | 35 |
| 36 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer
() || !m_layoutReplaced.layer()->hasCompositedClippingMask())) | 36 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer
() || !m_layoutReplaced.layer()->hasCompositedClippingMask())) |
| 37 return; | 37 return; |
| 38 | 38 |
| 39 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline) { | 39 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline) { |
| 40 if (m_layoutReplaced.styleRef().outlineWidth()) | 40 if (m_layoutReplaced.styleRef().outlineWidth()) |
| 41 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, m_layoutRepl
aced.visualOverflowRect(), borderRect.size(), adjustedPaintOffset); | 41 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, adjustedPain
tOffset); |
| 42 return; | 42 return; |
| 43 } | 43 } |
| 44 | 44 |
| 45 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas
eClippingMask) | 45 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas
eClippingMask) |
| 46 return; | 46 return; |
| 47 | 47 |
| 48 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) | 48 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) |
| 49 return; | 49 return; |
| 50 | 50 |
| 51 if (paintInfo.phase == PaintPhaseSelection) | 51 if (paintInfo.phase == PaintPhaseSelection) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect()
; | 88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect()
; |
| 89 selectionPaintingRect.moveBy(adjustedPaintOffset); | 89 selectionPaintingRect.moveBy(adjustedPaintOffset); |
| 90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); | 90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); |
| 91 | 91 |
| 92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); | 92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); |
| 93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); | 93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace blink | 97 } // namespace blink |
| OLD | NEW |