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

Unified Diff: ui/views/view.cc

Issue 2514303004: WIP - mask a view's layer by its view coordinates
Patch Set: manual clip Created 4 years, 1 month 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
« no previous file with comments | « ui/views/controls/button/md_text_button.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index b6cd9d0e97f9345128f754a62f0b80e15fa2430f..3ef145ae65955ed8919eabcfc377555e43eb785c 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -821,6 +821,9 @@ void View::Paint(const ui::PaintContext& parent_context) {
clip_path_in_parent.offset(GetMirroredX(), y());
clip_recorder.ClipPathWithAntiAliasing(clip_path_in_parent);
}
+ } else {
+ DCHECK(layer());
+ clip_recorder.ClipRect(GetVisibleBounds());
sky 2016/11/29 18:08:13 Is this really enough? What happens if an animatio
Evan Stade 2016/11/29 18:38:01 when the layer is moved that affects the view's tr
sky 2016/11/29 20:27:09 That's assuming you end up here, right? If the lay
}
ui::TransformRecorder transform_recorder(context);
@@ -1379,10 +1382,12 @@ void View::PreferredSizeChanged() {
}
bool View::GetNeedsNotificationWhenVisibleBoundsChange() const {
- return false;
+ return true;
}
void View::OnVisibleBoundsChanged() {
+ if (layer())
+ SchedulePaint();
}
// Tree operations -------------------------------------------------------------
« no previous file with comments | « ui/views/controls/button/md_text_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698