summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 23:12:47 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 23:12:47 +0000
commit0217950dab7f780844613da58500424855c501d5 (patch)
tree8a491f772fdaa88fb53c1ab645ad0f52ab801d7a
parenta58d46fe3dc2b9ae8197566fe5b58a7f5df16e35 (diff)
downloadchromium_src-0217950dab7f780844613da58500424855c501d5.zip
chromium_src-0217950dab7f780844613da58500424855c501d5.tar.gz
chromium_src-0217950dab7f780844613da58500424855c501d5.tar.bz2
Mac: Draw entire Bookmark Bar every time to match API expectations.
NtpBackgroundUtil::PaintBackgroundDetachedMode() expects to draw the entire bookmark bar on every expose; all of its internal math is based on the assumption that the incoming area is zero-based and is the whole bookmark bar area. TEST=(Repo instructions in bug) BUG=25655 Review URL: http://codereview.chromium.org/401005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32115 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/bookmark_bar_toolbar_view.mm14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm
index 1a9b7ce..d327170 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]);