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 "core/paint/DetailsMarkerPainter.h" | 5 #include "core/paint/DetailsMarkerPainter.h" |
6 | 6 |
7 #include "core/layout/LayoutDetailsMarker.h" | 7 #include "core/layout/LayoutDetailsMarker.h" |
8 #include "core/paint/BlockPainter.h" | 8 #include "core/paint/BlockPainter.h" |
9 #include "core/paint/LayoutObjectDrawingRecorder.h" | 9 #include "core/paint/LayoutObjectDrawingRecorder.h" |
10 #include "core/paint/PaintInfo.h" | 10 #include "core/paint/PaintInfo.h" |
11 #include "platform/geometry/LayoutPoint.h" | 11 #include "platform/geometry/LayoutPoint.h" |
12 #include "platform/graphics/Path.h" | 12 #include "platform/graphics/Path.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 void DetailsMarkerPainter::paint(const PaintInfo& paintInfo, | 16 void DetailsMarkerPainter::paint(const PaintInfo& paintInfo, |
17 const LayoutPoint& paintOffset) { | 17 const LayoutPoint& paintOffset) { |
18 if (paintInfo.phase != PaintPhaseForeground || | 18 if (paintInfo.phase != PaintPhaseForeground || |
19 m_layoutDetailsMarker.style()->visibility() != EVisibility::Visible) { | 19 m_layoutDetailsMarker.style()->visibility() != EVisibility::kVisible) { |
20 BlockPainter(m_layoutDetailsMarker).paint(paintInfo, paintOffset); | 20 BlockPainter(m_layoutDetailsMarker).paint(paintInfo, paintOffset); |
21 return; | 21 return; |
22 } | 22 } |
23 | 23 |
24 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( | 24 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( |
25 paintInfo.context, m_layoutDetailsMarker, paintInfo.phase)) | 25 paintInfo.context, m_layoutDetailsMarker, paintInfo.phase)) |
26 return; | 26 return; |
27 | 27 |
28 LayoutPoint boxOrigin(paintOffset + m_layoutDetailsMarker.location()); | 28 LayoutPoint boxOrigin(paintOffset + m_layoutDetailsMarker.location()); |
29 LayoutRect overflowRect(m_layoutDetailsMarker.visualOverflowRect()); | 29 LayoutRect overflowRect(m_layoutDetailsMarker.visualOverflowRect()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 Path DetailsMarkerPainter::getPath(const LayoutPoint& origin) const { | 93 Path DetailsMarkerPainter::getPath(const LayoutPoint& origin) const { |
94 Path result = getCanonicalPath(); | 94 Path result = getCanonicalPath(); |
95 result.transform( | 95 result.transform( |
96 AffineTransform().scale(m_layoutDetailsMarker.contentWidth().toFloat(), | 96 AffineTransform().scale(m_layoutDetailsMarker.contentWidth().toFloat(), |
97 m_layoutDetailsMarker.contentHeight().toFloat())); | 97 m_layoutDetailsMarker.contentHeight().toFloat())); |
98 result.translate(FloatSize(origin.x().toFloat(), origin.y().toFloat())); | 98 result.translate(FloatSize(origin.x().toFloat(), origin.y().toFloat())); |
99 return result; | 99 return result; |
100 } | 100 } |
101 | 101 |
102 } // namespace blink | 102 } // namespace blink |
OLD | NEW |