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

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: Removed parent()->SchedulePaint() from ToolbarButton::AddInkDropLayer(). Created 5 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 | « chrome/browser/ui/views/toolbar/toolbar_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 0fc755972d6d57de055a7ea9d31fa11733eaf13b..f4d20dd5838d2f20dd50019bd5b592b62d03ea57 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -725,7 +725,9 @@ void View::SchedulePaintInRect(const gfx::Rect& rect) {
if (layer()) {
layer()->SchedulePaint(rect);
- } else if (parent_) {
+ }
+
+ if (parent_ && (!layer() || !layer()->fills_bounds_opaquely())) {
jonross 2015/11/18 16:55:45 This will trigger for all schedule paints on a non
bruthig 2015/11/18 17:02:48 Agreed, I just want to make sure the following sce
bruthig 2015/11/18 17:46:42 Discussed offline.
// Translate the requested paint rect to the parent's coordinate system
// then pass this notification up to the parent.
parent_->SchedulePaintInRect(ConvertRectToParent(rect));
@@ -1384,8 +1386,14 @@ 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()) {
layer()->SetFillsBoundsOpaquely(fills_bounds_opaquely);
+ if (!fills_bounds_opaquely && parent_) {
+ // Translate the requested paint rect to the parent's coordinate system
+ // then pass this notification up to the parent.
+ parent_->SchedulePaintInRect(ConvertRectToParent(bounds_));
+ }
+ }
}
gfx::Vector2d View::CalculateOffsetToAncestorWithLayer(
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698