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

Unified Diff: third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp

Issue 2889653002: Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: movecullrect2 rebase-once-and-for-all Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698