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

Unified Diff: ui/views/view.cc

Issue 1773393002: Address some bubble clipping issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 3580d046a375bf6b231976a4ef91827425f6302c..755f964541fec15be94ee98640deb0859d87fa61 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -808,12 +808,11 @@ void View::Paint(const ui::PaintContext& parent_context) {
// position we pass to ClipRect takes into consideration whether or not the
// View uses a right-to-left layout so that we paint the View in its
// mirrored position if need be.
- gfx::Rect clip_rect_in_parent = bounds();
- clip_rect_in_parent.Inset(clip_insets_);
- if (parent_)
- clip_rect_in_parent.set_x(
- parent_->GetMirroredXForRect(clip_rect_in_parent));
- clip_recorder.ClipRect(clip_rect_in_parent);
+ gfx::Path clip_path_in_parent = clip_path_;
+ if (clip_path_in_parent.isEmpty())
+ clip_path_in_parent.addRect(gfx::RectToSkRect(GetLocalBounds()));
+ clip_path_in_parent.offset(GetMirroredX(), y());
+ clip_recorder.ClipPathWithAntiAliasing(clip_path_in_parent);
tapted 2016/03/22 07:38:04 I don't have a sense for how computationally expen
Evan Stade 2016/03/22 17:59:58 I was hoping it would be smart, i.e. if the path i
}
ui::TransformRecorder transform_recorder(context);

Powered by Google App Engine
This is Rietveld 408576698