Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp

Issue 2942123002: Break LayoutObject dependency for NinePieceImagePainter (Closed)
Patch Set: Pass document explicitly Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainterBase.cpp ('k') | third_party/WebKit/Source/core/paint/FieldsetPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698