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

Unified Diff: ui/views/view.cc

Issue 1461673002: Moved parent_->SchedulePaint() to Views::SetFillsBoundsOpaquely() and Views::SchedulePaint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed doc comment in View::CreateLayer(). Created 4 years, 12 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
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | 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 e085544e1a524354f2a09cfd51a9e5e5b6ac5266..59281e3d68e33c9bb62d96e2cced3ad9b8574438 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1767,6 +1767,14 @@ void View::SchedulePaintBoundsChanged(SchedulePaintType type) {
}
}
+void View::SchedulePaintOnParent() {
+ if (parent_) {
+ // Translate the requested paint rect to the parent's coordinate system
+ // then pass this notification up to the parent.
+ parent_->SchedulePaintInRect(ConvertRectToParent(GetLocalBounds()));
+ }
+}
+
// Tree operations -------------------------------------------------------------
void View::DoRemoveChildView(View* view,
@@ -2080,6 +2088,12 @@ void View::CreateLayer() {
Widget* widget = GetWidget();
if (widget)
widget->UpdateRootLayers();
+
+ // Before having its own Layer, this View may have painted in to a Layer owned
+ // by an ancestor View. Scheduling a paint on the parent View will erase this
+ // View's painting effects on the ancestor View's Layer.
+ // (See crbug.com/551492)
+ SchedulePaintOnParent();
}
void View::UpdateParentLayers() {
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698