| 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" |
| 11 #include "core/paint/GraphicsContextAnnotator.h" | |
| 12 #include "core/paint/LayoutObjectDrawingRecorder.h" | 11 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 13 #include "core/paint/ObjectPainter.h" | 12 #include "core/paint/ObjectPainter.h" |
| 14 #include "core/paint/PaintInfo.h" | 13 #include "core/paint/PaintInfo.h" |
| 15 #include "core/paint/RoundedInnerRectClipper.h" | 14 #include "core/paint/RoundedInnerRectClipper.h" |
| 16 | 15 |
| 17 namespace blink { | 16 namespace blink { |
| 18 | 17 |
| 19 void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
Offset) | 18 void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
Offset) |
| 20 { | 19 { |
| 21 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutReplaced); | |
| 22 | |
| 23 if (!m_layoutReplaced.shouldPaint(paintInfo, paintOffset)) | 20 if (!m_layoutReplaced.shouldPaint(paintInfo, paintOffset)) |
| 24 return; | 21 return; |
| 25 | 22 |
| 26 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location(); | 23 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location(); |
| 27 LayoutRect paintRect(adjustedPaintOffset, m_layoutReplaced.size()); | 24 LayoutRect paintRect(adjustedPaintOffset, m_layoutReplaced.size()); |
| 28 | 25 |
| 29 LayoutRect visualOverflowRect(m_layoutReplaced.visualOverflowRect()); | 26 LayoutRect visualOverflowRect(m_layoutReplaced.visualOverflowRect()); |
| 30 visualOverflowRect.moveBy(adjustedPaintOffset); | 27 visualOverflowRect.moveBy(adjustedPaintOffset); |
| 31 | 28 |
| 32 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai
ntPhaseForeground || paintInfo.phase == PaintPhaseSelection)) | 29 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai
ntPhaseForeground || paintInfo.phase == PaintPhaseSelection)) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); | 95 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting
Rect); |
| 99 | 96 |
| 100 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); | 97 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout
Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); |
| 101 if (drawingRecorder.canUseCachedDrawing()) | 98 if (drawingRecorder.canUseCachedDrawing()) |
| 102 return; | 99 return; |
| 103 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); | 100 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s
electionBackgroundColor()); |
| 104 } | 101 } |
| 105 } | 102 } |
| 106 | 103 |
| 107 } // namespace blink | 104 } // namespace blink |
| OLD | NEW |