| 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/PartPainter.h" | 5 #include "core/paint/PartPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutPart.h" | 7 #include "core/layout/LayoutPart.h" |
| 8 #include "core/paint/BoxPainter.h" | 8 #include "core/paint/BoxPainter.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" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())), | 76 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())), |
| 77 true, true); | 77 true, true); |
| 78 clipper.emplace(m_layoutPart, paintInfo, borderRect, roundedInnerRec
t, ApplyToDisplayList); | 78 clipper.emplace(m_layoutPart, paintInfo, borderRect, roundedInnerRec
t, ApplyToDisplayList); |
| 79 } | 79 } |
| 80 | 80 |
| 81 if (m_layoutPart.widget()) | 81 if (m_layoutPart.widget()) |
| 82 m_layoutPart.paintContents(paintInfo, paintOffset); | 82 m_layoutPart.paintContents(paintInfo, paintOffset); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Paint a partially transparent wash over selected widgets. | 85 // Paint a partially transparent wash over selected widgets. |
| 86 if (isSelected() && !paintInfo.isPrinting() && !LayoutObjectDrawingRecorder:
:useCachedDrawingIfPossible(paintInfo.context, m_layoutPart, paintInfo.phase, ad
justedPaintOffset)) { | 86 if (isSelected() && !paintInfo.isPrinting() && !LayoutObjectDrawingRecorder:
:useCachedDrawingIfPossible(paintInfo.context, m_layoutPart, paintInfo.phase)) { |
| 87 LayoutRect rect = m_layoutPart.localSelectionRect(); | 87 LayoutRect rect = m_layoutPart.localSelectionRect(); |
| 88 rect.moveBy(adjustedPaintOffset); | 88 rect.moveBy(adjustedPaintOffset); |
| 89 IntRect selectionRect = pixelSnappedIntRect(rect); | 89 IntRect selectionRect = pixelSnappedIntRect(rect); |
| 90 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutP
art, paintInfo.phase, selectionRect, adjustedPaintOffset); | 90 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutP
art, paintInfo.phase, selectionRect); |
| 91 paintInfo.context.fillRect(selectionRect, m_layoutPart.selectionBackgrou
ndColor()); | 91 paintInfo.context.fillRect(selectionRect, m_layoutPart.selectionBackgrou
ndColor()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 if (m_layoutPart.canResize()) | 94 if (m_layoutPart.canResize()) |
| 95 ScrollableAreaPainter(*m_layoutPart.layer()->scrollableArea()).paintResi
zer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.cullRect(
)); | 95 ScrollableAreaPainter(*m_layoutPart.layer()->scrollableArea()).paintResi
zer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.cullRect(
)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) | 98 void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) |
| 99 { | 99 { |
| 100 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); | 100 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 112 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 112 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, |
| 113 // not the root. In this case, shift the CTM and adjust the CullRect to be r
oot-relative to fix plugin drawing. | 113 // not the root. In this case, shift the CTM and adjust the CullRect to be r
oot-relative to fix plugin drawing. |
| 114 TransformRecorder transform(paintInfo.context, m_layoutPart, | 114 TransformRecorder transform(paintInfo.context, m_layoutPart, |
| 115 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); | 115 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); |
| 116 | 116 |
| 117 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset); | 117 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset); |
| 118 widget->paint(paintInfo.context, adjustedCullRect); | 118 widget->paint(paintInfo.context, adjustedCullRect); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |