| 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" |
| 11 #include "core/paint/PaintLayer.h" | 11 #include "core/paint/PaintLayer.h" |
| 12 #include "core/paint/ReplacedPainter.h" | 12 #include "core/paint/ReplacedPainter.h" |
| 13 #include "core/paint/RoundedInnerRectClipper.h" | 13 #include "core/paint/RoundedInnerRectClipper.h" |
| 14 #include "core/paint/ScrollableAreaPainter.h" | 14 #include "core/paint/ScrollableAreaPainter.h" |
| 15 #include "core/paint/TransformRecorder.h" | 15 #include "core/paint/TransformRecorder.h" |
| 16 #include "wtf/Optional.h" | 16 #include "wtf/Optional.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 bool PartPainter::isSelected() const | 20 bool PartPainter::isSelected() const |
| 21 { | 21 { |
| 22 SelectionState s = m_layoutPart.selectionState(); | 22 SelectionState s = m_layoutPart.getSelectionState(); |
| 23 if (s == SelectionNone) | 23 if (s == SelectionNone) |
| 24 return false; | 24 return false; |
| 25 if (s == SelectionInside) | 25 if (s == SelectionInside) |
| 26 return true; | 26 return true; |
| 27 | 27 |
| 28 int selectionStart, selectionEnd; | 28 int selectionStart, selectionEnd; |
| 29 m_layoutPart.selectionStartEnd(selectionStart, selectionEnd); | 29 m_layoutPart.selectionStartEnd(selectionStart, selectionEnd); |
| 30 if (s == SelectionStart) | 30 if (s == SelectionStart) |
| 31 return selectionStart == 0; | 31 return selectionStart == 0; |
| 32 | 32 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |