OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/BoxReflectionUtils.h" | 5 #include "core/paint/BoxReflectionUtils.h" |
6 | 6 |
7 #include "core/layout/LayoutBox.h" | 7 #include "core/layout/LayoutBox.h" |
8 #include "core/paint/NinePieceImagePainter.h" | 8 #include "core/paint/NinePieceImagePainter.h" |
9 #include "core/paint/PaintLayer.h" | 9 #include "core/paint/PaintLayer.h" |
10 #include "platform/LengthFunctions.h" | 10 #include "platform/LengthFunctions.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // TODO(jbroman): PaintRecordBuilder + DrawingRecorder seems excessive. | 63 // TODO(jbroman): PaintRecordBuilder + DrawingRecorder seems excessive. |
64 // If NinePieceImagePainter operated on SkCanvas, we'd only need a | 64 // If NinePieceImagePainter operated on SkCanvas, we'd only need a |
65 // PictureRecorder here. | 65 // PictureRecorder here. |
66 PaintRecordBuilder builder(mask_bounding_float_rect); | 66 PaintRecordBuilder builder(mask_bounding_float_rect); |
67 { | 67 { |
68 GraphicsContext& context = builder.Context(); | 68 GraphicsContext& context = builder.Context(); |
69 DrawingRecorder drawing_recorder(context, layer.GetLayoutObject(), | 69 DrawingRecorder drawing_recorder(context, layer.GetLayoutObject(), |
70 DisplayItem::kReflectionMask, | 70 DisplayItem::kReflectionMask, |
71 mask_bounding_float_rect); | 71 mask_bounding_float_rect); |
72 NinePieceImagePainter().Paint(builder.Context(), layer.GetLayoutObject(), | 72 Node* node = nullptr; |
73 mask_rect, style, mask_nine_piece, | 73 const LayoutObject* layout_object = &layer.GetLayoutObject(); |
74 SkBlendMode::kSrcOver); | 74 for (; layout_object && !node; layout_object = layout_object->Parent()) |
| 75 node = layout_object->GeneratingNode(); |
| 76 NinePieceImagePainter::Paint(builder.Context(), layer.GetLayoutObject(), |
| 77 layer.GetLayoutObject().GetDocument(), node, |
| 78 mask_rect, style, mask_nine_piece, |
| 79 SkBlendMode::kSrcOver); |
75 } | 80 } |
76 return BoxReflection(direction, offset, builder.EndRecording(), | 81 return BoxReflection(direction, offset, builder.EndRecording(), |
77 mask_bounding_float_rect); | 82 mask_bounding_float_rect); |
78 } | 83 } |
79 | 84 |
80 } // namespace blink | 85 } // namespace blink |
OLD | NEW |