| 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/FieldsetPainter.h" | 5 #include "core/paint/FieldsetPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutFieldset.h" | 7 #include "core/layout/LayoutFieldset.h" |
| 8 #include "core/paint/BoxDecorationData.h" | 8 #include "core/paint/BoxDecorationData.h" |
| 9 #include "core/paint/BoxPainter.h" | 9 #include "core/paint/BoxPainter.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } else { | 80 } else { |
| 81 LayoutUnit clip_left = paint_rect.X(); | 81 LayoutUnit clip_left = paint_rect.X(); |
| 82 LayoutUnit clip_width = max( | 82 LayoutUnit clip_width = max( |
| 83 static_cast<LayoutUnit>(layout_fieldset_.Style()->BorderLeftWidth()), | 83 static_cast<LayoutUnit>(layout_fieldset_.Style()->BorderLeftWidth()), |
| 84 legend->Size().Width()); | 84 legend->Size().Width()); |
| 85 graphics_context.ClipOut( | 85 graphics_context.ClipOut( |
| 86 PixelSnappedIntRect(clip_left, paint_rect.Y() + legend->Location().Y(), | 86 PixelSnappedIntRect(clip_left, paint_rect.Y() + legend->Location().Y(), |
| 87 clip_width, legend->Size().Height())); | 87 clip_width, legend->Size().Height())); |
| 88 } | 88 } |
| 89 | 89 |
| 90 BoxPainter::PaintBorder(layout_fieldset_, paint_info, paint_rect, | 90 Node* node = nullptr; |
| 91 const LayoutObject* layout_object = &layout_fieldset_; |
| 92 for (; layout_object && !node; layout_object = layout_object->Parent()) |
| 93 node = layout_object->GeneratingNode(); |
| 94 BoxPainter::PaintBorder(layout_fieldset_, layout_fieldset_.GetDocument(), |
| 95 node, paint_info, paint_rect, |
| 91 layout_fieldset_.StyleRef()); | 96 layout_fieldset_.StyleRef()); |
| 92 } | 97 } |
| 93 | 98 |
| 94 void FieldsetPainter::PaintMask(const PaintInfo& paint_info, | 99 void FieldsetPainter::PaintMask(const PaintInfo& paint_info, |
| 95 const LayoutPoint& paint_offset) { | 100 const LayoutPoint& paint_offset) { |
| 96 if (layout_fieldset_.Style()->Visibility() != EVisibility::kVisible || | 101 if (layout_fieldset_.Style()->Visibility() != EVisibility::kVisible || |
| 97 paint_info.phase != kPaintPhaseMask) | 102 paint_info.phase != kPaintPhaseMask) |
| 98 return; | 103 return; |
| 99 | 104 |
| 100 LayoutRect paint_rect = LayoutRect(paint_offset, layout_fieldset_.Size()); | 105 LayoutRect paint_rect = LayoutRect(paint_offset, layout_fieldset_.Size()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 124 paint_rect.Expand(-x_off, LayoutUnit()); | 129 paint_rect.Expand(-x_off, LayoutUnit()); |
| 125 paint_rect.Move(x_off, LayoutUnit()); | 130 paint_rect.Move(x_off, LayoutUnit()); |
| 126 } | 131 } |
| 127 | 132 |
| 128 LayoutObjectDrawingRecorder recorder(paint_info.context, layout_fieldset_, | 133 LayoutObjectDrawingRecorder recorder(paint_info.context, layout_fieldset_, |
| 129 paint_info.phase, paint_rect); | 134 paint_info.phase, paint_rect); |
| 130 BoxPainter(layout_fieldset_).PaintMaskImages(paint_info, paint_rect); | 135 BoxPainter(layout_fieldset_).PaintMaskImages(paint_info, paint_rect); |
| 131 } | 136 } |
| 132 | 137 |
| 133 } // namespace blink | 138 } // namespace blink |
| OLD | NEW |