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/PartPainter.h" | 6 #include "core/paint/PartPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutPart.h" | 8 #include "core/layout/LayoutPart.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/PaintInfo.h" | 12 #include "core/paint/PaintInfo.h" |
14 #include "core/paint/RoundedInnerRectClipper.h" | 13 #include "core/paint/RoundedInnerRectClipper.h" |
15 #include "core/paint/ScrollableAreaPainter.h" | 14 #include "core/paint/ScrollableAreaPainter.h" |
16 #include "core/paint/TransformRecorder.h" | 15 #include "core/paint/TransformRecorder.h" |
17 | 16 |
18 namespace blink { | 17 namespace blink { |
19 | 18 |
20 void PartPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 19 void PartPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
21 { | 20 { |
22 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutPart); | |
23 | |
24 if (!m_layoutPart.shouldPaint(paintInfo, paintOffset)) | 21 if (!m_layoutPart.shouldPaint(paintInfo, paintOffset)) |
25 return; | 22 return; |
26 | 23 |
27 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); | 24 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); |
28 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); | 25 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); |
29 | 26 |
30 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh
aseForeground || paintInfo.phase == PaintPhaseSelection)) | 27 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh
aseForeground || paintInfo.phase == PaintPhaseSelection)) |
31 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste
dPaintOffset); | 28 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste
dPaintOffset); |
32 | 29 |
33 if (paintInfo.phase == PaintPhaseMask) { | 30 if (paintInfo.phase == PaintPhaseMask) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 IntSize widgetPaintOffset = paintLocation - widgetLocation; | 92 IntSize widgetPaintOffset = paintLocation - widgetLocation; |
96 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 93 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, |
97 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plugin drawing. | 94 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plugin drawing. |
98 TransformRecorder transform(*paintInfo.context, m_layoutPart, | 95 TransformRecorder transform(*paintInfo.context, m_layoutPart, |
99 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); | 96 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); |
100 paintRect.move(-widgetPaintOffset); | 97 paintRect.move(-widgetPaintOffset); |
101 widget->paint(paintInfo.context, paintRect); | 98 widget->paint(paintInfo.context, paintRect); |
102 } | 99 } |
103 | 100 |
104 } // namespace blink | 101 } // namespace blink |
OLD | NEW |