| 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 24 matching lines...) Expand all Loading... |
| 35 if (paintInfo.phase == PaintPhaseMask) { | 35 if (paintInfo.phase == PaintPhaseMask) { |
| 36 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, paintInfo.phase, visualOverflowRect); | 36 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, paintInfo.phase, visualOverflowRect); |
| 37 if (!drawingRecorder.canUseCachedDrawing()) | 37 if (!drawingRecorder.canUseCachedDrawing()) |
| 38 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); | 38 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); |
| 39 return; | 39 return; |
| 40 } | 40 } |
| 41 | 41 |
| 42 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer
() || !m_layoutReplaced.layer()->hasCompositedClippingMask())) | 42 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer
() || !m_layoutReplaced.layer()->hasCompositedClippingMask())) |
| 43 return; | 43 return; |
| 44 | 44 |
| 45 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe
lfOutline) && m_layoutReplaced.style()->outlineWidth()) | 45 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline) { |
| 46 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, visua
lOverflowRect); | 46 if (m_layoutReplaced.styleRef().outlineWidth()) |
| 47 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, v
isualOverflowRect); |
| 48 return; |
| 49 } |
| 47 | 50 |
| 48 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas
eClippingMask) | 51 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas
eClippingMask) |
| 49 return; | 52 return; |
| 50 | 53 |
| 51 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) | 54 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) |
| 52 return; | 55 return; |
| 53 | 56 |
| 54 if (paintInfo.phase == PaintPhaseSelection) | 57 if (paintInfo.phase == PaintPhaseSelection) |
| 55 if (m_layoutReplaced.selectionState() == LayoutObject::SelectionNone) | 58 if (m_layoutReplaced.selectionState() == LayoutObject::SelectionNone) |
| 56 return; | 59 return; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); | 98 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); |
| 96 | 99 |
| 97 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); | 100 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); |
| 98 if (drawingRecorder.canUseCachedDrawing()) | 101 if (drawingRecorder.canUseCachedDrawing()) |
| 99 return; | 102 return; |
| 100 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); | 103 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); |
| 101 } | 104 } |
| 102 } | 105 } |
| 103 | 106 |
| 104 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |