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

Unified Diff: ui/views/view.cc

Issue 1566693002: Moved parent_->SchedulePaint() to Views::SetFillsBoundsOpaquely() and Views::SchedulePaint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 fc2d03ec6d3fcf8c6f51c2165c2311a8c2b35da1..375cff4a2ca640a14dbf42c59b3b04411e253b28 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1769,6 +1769,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,
@@ -2082,6 +2090,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