| 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/layout/PaintInfo.h" | 9 #include "core/layout/PaintInfo.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Tell the widget to paint now. This is the only time the widget is allowed | 83 // Tell the widget to paint now. This is the only time the widget is allowed |
| 84 // to paint itself. That way it will composite properly with z-indexed layer
s. | 84 // to paint itself. That way it will composite properly with z-indexed layer
s. |
| 85 IntPoint widgetLocation = widget->frameRect().location(); | 85 IntPoint widgetLocation = widget->frameRect().location(); |
| 86 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + m_layoutPart.bor
derLeft() + m_layoutPart.paddingLeft()), | 86 IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + m_layoutPart.bor
derLeft() + m_layoutPart.paddingLeft()), |
| 87 roundToInt(adjustedPaintOffset.y() + m_layoutPart.borderTop() + m_layout
Part.paddingTop())); | 87 roundToInt(adjustedPaintOffset.y() + m_layoutPart.borderTop() + m_layout
Part.paddingTop())); |
| 88 IntRect paintRect = paintInfo.rect; | 88 IntRect paintRect = paintInfo.rect; |
| 89 | 89 |
| 90 IntSize widgetPaintOffset = paintLocation - widgetLocation; | 90 IntSize widgetPaintOffset = paintLocation - widgetLocation; |
| 91 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 91 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, |
| 92 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plug-in drawing. | 92 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plugin drawing. |
| 93 TransformRecorder transform(*paintInfo.context, m_layoutPart.displayItemClie
nt(), | 93 TransformRecorder transform(*paintInfo.context, m_layoutPart.displayItemClie
nt(), |
| 94 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); | 94 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); |
| 95 paintRect.move(-widgetPaintOffset); | 95 paintRect.move(-widgetPaintOffset); |
| 96 widget->paint(paintInfo.context, paintRect); | 96 widget->paint(paintInfo.context, paintRect); |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |