Chromium Code Reviews| Index: ui/views/view.cc |
| diff --git a/ui/views/view.cc b/ui/views/view.cc |
| index 0fc755972d6d57de055a7ea9d31fa11733eaf13b..844b1e6bdc775414c169abe35e13149ea0cceb32 100644 |
| --- a/ui/views/view.cc |
| +++ b/ui/views/view.cc |
| @@ -461,6 +461,7 @@ void View::SetPaintToLayer(bool paint_to_layer) { |
| paint_to_layer_ = paint_to_layer; |
| if (paint_to_layer_ && !layer()) { |
| CreateLayer(); |
| + SchedulePaintOnParent(); |
|
sky
2015/11/19 22:31:48
Why does this case necessitate a paint on the pare
bruthig
2015/12/22 22:32:40
Done.
|
| } else if (!paint_to_layer_ && layer()) { |
| DestroyLayer(); |
| } |
| @@ -1384,8 +1385,13 @@ void View::OnPaintBorder(gfx::Canvas* canvas) { |
| void View::SetFillsBoundsOpaquely(bool fills_bounds_opaquely) { |
| // This method should not have the side-effect of creating the layer. |
| - if (layer()) |
| + if (layer()) { |
| + bool schedule_paint_on_parent = |
|
sky
2015/11/19 22:31:48
Please add an early return to make this code easie
bruthig
2015/12/22 22:32:40
Done.
|
| + !fills_bounds_opaquely && layer()->fills_bounds_opaquely(); |
| layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely); |
| + if (schedule_paint_on_parent) |
| + SchedulePaintOnParent(); |
| + } |
| } |
| gfx::Vector2d View::CalculateOffsetToAncestorWithLayer( |
| @@ -1733,6 +1739,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(bounds_)); |
| + } |
| +} |
| + |
| // Tree operations ------------------------------------------------------------- |
| void View::DoRemoveChildView(View* view, |