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, const LayoutPoint&
paintOffset) | 16 void DetailsMarkerPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
17 { | 17 { |
18 if (paintInfo.phase != PaintPhaseForeground || m_layoutDetailsMarker.style()
->visibility() != VISIBLE) { | 18 if (paintInfo.phase != PaintPhaseForeground || m_layoutDetailsMarker.style()
->visibility() != EVisibility::Visible) { |
19 BlockPainter(m_layoutDetailsMarker).paint(paintInfo, paintOffset); | 19 BlockPainter(m_layoutDetailsMarker).paint(paintInfo, paintOffset); |
20 return; | 20 return; |
21 } | 21 } |
22 | 22 |
23 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutDetailsMarker, paintInfo.phase)) | 23 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutDetailsMarker, paintInfo.phase)) |
24 return; | 24 return; |
25 | 25 |
26 LayoutPoint boxOrigin(paintOffset + m_layoutDetailsMarker.location()); | 26 LayoutPoint boxOrigin(paintOffset + m_layoutDetailsMarker.location()); |
27 LayoutRect overflowRect(m_layoutDetailsMarker.visualOverflowRect()); | 27 LayoutRect overflowRect(m_layoutDetailsMarker.visualOverflowRect()); |
28 overflowRect.moveBy(boxOrigin); | 28 overflowRect.moveBy(boxOrigin); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 Path DetailsMarkerPainter::getPath(const LayoutPoint& origin) const | 86 Path DetailsMarkerPainter::getPath(const LayoutPoint& origin) const |
87 { | 87 { |
88 Path result = getCanonicalPath(); | 88 Path result = getCanonicalPath(); |
89 result.transform(AffineTransform().scale(m_layoutDetailsMarker.contentWidth(
).toFloat(), m_layoutDetailsMarker.contentHeight().toFloat())); | 89 result.transform(AffineTransform().scale(m_layoutDetailsMarker.contentWidth(
).toFloat(), m_layoutDetailsMarker.contentHeight().toFloat())); |
90 result.translate(FloatSize(origin.x().toFloat(), origin.y().toFloat())); | 90 result.translate(FloatSize(origin.x().toFloat(), origin.y().toFloat())); |
91 return result; | 91 return result; |
92 } | 92 } |
93 | 93 |
94 } // namespace blink | 94 } // namespace blink |
OLD | NEW |