Index: third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp |
diff --git a/third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp b/third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp |
index caf6483657acd2bb2b4e5c294fea6c1f5ceaf8ef..679508e31296dcf766004ad5ecab44537e777f82 100644 |
--- a/third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp |
+++ b/third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp |
@@ -51,31 +51,30 @@ BoxReflection BoxReflectionForPaintLayer(const PaintLayer& layer, |
break; |
} |
- sk_sp<PaintRecord> mask; |
const NinePieceImage& mask_nine_piece = reflect_style->Mask(); |
- if (mask_nine_piece.HasImage()) { |
- LayoutRect mask_rect(LayoutPoint(), frame_layout_rect.Size()); |
- LayoutRect mask_bounding_rect(mask_rect); |
- mask_bounding_rect.Expand(style.ImageOutsets(mask_nine_piece)); |
- FloatRect mask_bounding_float_rect(mask_bounding_rect); |
+ if (!mask_nine_piece.HasImage()) |
+ return BoxReflection(direction, offset, nullptr, FloatRect()); |
- // TODO(jbroman): PaintRecordBuilder + DrawingRecorder seems excessive. |
- // If NinePieceImagePainter operated on SkCanvas, we'd only need a |
- // PictureRecorder here. |
- PaintRecordBuilder builder(mask_bounding_float_rect); |
- { |
- GraphicsContext& context = builder.Context(); |
- DrawingRecorder drawing_recorder(context, layer.GetLayoutObject(), |
- DisplayItem::kReflectionMask, |
- mask_bounding_float_rect); |
- NinePieceImagePainter().Paint(builder.Context(), layer.GetLayoutObject(), |
- mask_rect, style, mask_nine_piece, |
- SkBlendMode::kSrcOver); |
- } |
- mask = builder.EndRecording(); |
- } |
+ LayoutRect mask_rect(LayoutPoint(), frame_layout_rect.Size()); |
+ LayoutRect mask_bounding_rect(mask_rect); |
+ mask_bounding_rect.Expand(style.ImageOutsets(mask_nine_piece)); |
+ FloatRect mask_bounding_float_rect(mask_bounding_rect); |
- return BoxReflection(direction, offset, std::move(mask)); |
+ // TODO(jbroman): PaintRecordBuilder + DrawingRecorder seems excessive. |
+ // If NinePieceImagePainter operated on SkCanvas, we'd only need a |
+ // PictureRecorder here. |
+ PaintRecordBuilder builder(mask_bounding_float_rect); |
+ { |
+ GraphicsContext& context = builder.Context(); |
+ DrawingRecorder drawing_recorder(context, layer.GetLayoutObject(), |
+ DisplayItem::kReflectionMask, |
+ mask_bounding_float_rect); |
+ NinePieceImagePainter().Paint(builder.Context(), layer.GetLayoutObject(), |
+ mask_rect, style, mask_nine_piece, |
+ SkBlendMode::kSrcOver); |
+ } |
+ return BoxReflection(direction, offset, builder.EndRecording(), |
+ mask_bounding_float_rect); |
} |
} // namespace blink |