| 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/FileUploadControlPainter.h" | 5 #include "core/paint/FileUploadControlPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutButton.h" | 7 #include "core/layout/LayoutButton.h" |
| 8 #include "core/layout/LayoutFileUploadControl.h" | 8 #include "core/layout/LayoutFileUploadControl.h" |
| 9 #include "core/layout/TextRunConstructor.h" | 9 #include "core/layout/TextRunConstructor.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 return; | 22 return; |
| 23 | 23 |
| 24 // Push a clip. | 24 // Push a clip. |
| 25 Optional<ClipRecorder> clipRecorder; | 25 Optional<ClipRecorder> clipRecorder; |
| 26 if (paintInfo.phase == PaintPhaseForeground || | 26 if (paintInfo.phase == PaintPhaseForeground || |
| 27 paintInfo.phase == PaintPhaseDescendantBlockBackgroundsOnly) { | 27 paintInfo.phase == PaintPhaseDescendantBlockBackgroundsOnly) { |
| 28 IntRect clipRect = enclosingIntRect(LayoutRect( | 28 IntRect clipRect = enclosingIntRect(LayoutRect( |
| 29 LayoutPoint(paintOffset.x() + m_layoutFileUploadControl.borderLeft(), | 29 LayoutPoint(paintOffset.x() + m_layoutFileUploadControl.borderLeft(), |
| 30 paintOffset.y() + m_layoutFileUploadControl.borderTop()), | 30 paintOffset.y() + m_layoutFileUploadControl.borderTop()), |
| 31 m_layoutFileUploadControl.size() + | 31 m_layoutFileUploadControl.size() + |
| 32 LayoutSize(0, -m_layoutFileUploadControl.borderWidth() + | 32 LayoutSize(LayoutUnit(), -m_layoutFileUploadControl.borderWidth() + |
| 33 buttonShadowHeight))); | 33 buttonShadowHeight))); |
| 34 if (clipRect.isEmpty()) | 34 if (clipRect.isEmpty()) |
| 35 return; | 35 return; |
| 36 clipRecorder.emplace(paintInfo.context, m_layoutFileUploadControl, | 36 clipRecorder.emplace(paintInfo.context, m_layoutFileUploadControl, |
| 37 DisplayItem::kClipFileUploadControlRect, clipRect); | 37 DisplayItem::kClipFileUploadControlRect, clipRect); |
| 38 } | 38 } |
| 39 | 39 |
| 40 if (paintInfo.phase == PaintPhaseForeground && | 40 if (paintInfo.phase == PaintPhaseForeground && |
| 41 !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( | 41 !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible( |
| 42 paintInfo.context, m_layoutFileUploadControl, paintInfo.phase)) { | 42 paintInfo.context, m_layoutFileUploadControl, paintInfo.phase)) { |
| 43 const String& displayedFilename = m_layoutFileUploadControl.fileTextValue(); | 43 const String& displayedFilename = m_layoutFileUploadControl.fileTextValue(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 font, textRunPaintInfo, | 103 font, textRunPaintInfo, |
| 104 FloatPoint(roundToInt(textX), roundToInt(textY))); | 104 FloatPoint(roundToInt(textX), roundToInt(textY))); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Paint the children. | 107 // Paint the children. |
| 108 m_layoutFileUploadControl.LayoutBlockFlow::paintObject(paintInfo, | 108 m_layoutFileUploadControl.LayoutBlockFlow::paintObject(paintInfo, |
| 109 paintOffset); | 109 paintOffset); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |