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

Unified Diff: chrome/browser/cocoa/bookmark_bar_toolbar_view.mm

Issue 401005: Mac: Draw entire Bookmark Bar every time to match API expectations. (Closed)
Patch Set: Fix comment Created 11 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 | « 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/cocoa/bookmark_bar_toolbar_view.mm
diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
index 1a9b7ce39574d4b7631203fc464af9e48bd8813d..d327170518b0b2b32c81080d287ece4644466cfd 100644
--- a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
+++ b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
@@ -50,8 +50,18 @@ const CGFloat kBorderRadius = 3.0;
{
// CanvasPaint draws to the NSGraphicsContext during its destructor, so
// explicitly scope this.
- gfx::CanvasPaint canvas(rect, true);
- gfx::Rect area(0, 0, NSWidth(rect), NSHeight(rect));
+ //
+ // Paint the entire bookmark bar, even if the damage rect is much smaller
+ // because PaintBackgroundDetachedMode() assumes that area's origin is
+ // (0, 0) and that its size is the size of the bookmark bar.
+ //
+ // In practice, this sounds worse than it is because redraw time is still
+ // minimal compared to the pause between frames of animations. We were
+ // already repainting the rest of the bookmark bar below without setting a
+ // clip area, anyway. Also, the only time we weren't asked to redraw the
+ // whole bookmark bar is when the find bar is drawn over it.
+ gfx::CanvasPaint canvas(bounds, true);
+ gfx::Rect area(0, 0, NSWidth(bounds), NSHeight(bounds));
NtpBackgroundUtil::PaintBackgroundDetachedMode(themeProvider, &canvas,
area, [controller_ currentTabContentsHeight]);
« 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