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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 2899133004: Reduce overdraw on bookmark bar (Closed)
Patch Set: Reduce overdraw on bookmark bar Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index ce37e63e3dbf78cae113307a1998cf5fb894aa80..c3e62f45dc1f17229926dff5097266ea1bba6122 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -601,12 +601,6 @@ BookmarkBarView::BookmarkBarView(Browser* browser, BrowserView* browser_view)
show_folder_method_factory_(this) {
set_id(VIEW_ID_BOOKMARK_BAR);
Init();
-
- // Don't let the bookmarks show on top of the location bar while animating.
- SetPaintToLayer();
- layer()->SetMasksToBounds(true);
- layer()->SetFillsBoundsOpaquely(false);
-
size_animation_.Reset(1);
}
@@ -653,12 +647,19 @@ void BookmarkBarView::SetBookmarkBarState(
BookmarkBar::AnimateChangeType animate_type) {
if (animate_type == BookmarkBar::ANIMATE_STATE_CHANGE &&
animations_enabled) {
+ if (!layer()) {
+ SetPaintToLayer();
+ layer()->SetMasksToBounds(true);
+ layer()->SetFillsBoundsOpaquely(false);
+ }
animating_detached_ = (state == BookmarkBar::DETACHED ||
bookmark_bar_state_ == BookmarkBar::DETACHED);
if (state == BookmarkBar::SHOW)
size_animation_.Show();
else
size_animation_.Hide();
+ if (layer())
+ DestroyLayer();
Evan Stade 2017/05/24 17:34:30 I am surprised this works. You're destroying the l
sky 2017/05/24 21:32:05 I think it would be better to key off whether any
} else {
size_animation_.Reset(state == BookmarkBar::SHOW ? 1 : 0);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698