diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 21:29:06 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 21:29:06 +0000 |
commit | 8f8e5e4506f48f2d6067f4f29b32b0683e6e110a (patch) | |
tree | 5235f7e53ba9ce1515ca603f50aabcaea0ba52a4 /chrome | |
parent | daf27818e5b5d19fab8bee0da118fe387fe1a21c (diff) | |
download | chromium_src-8f8e5e4506f48f2d6067f4f29b32b0683e6e110a.zip chromium_src-8f8e5e4506f48f2d6067f4f29b32b0683e6e110a.tar.gz chromium_src-8f8e5e4506f48f2d6067f4f29b32b0683e6e110a.tar.bz2 |
Changes Mac behavior to reblit the entire RWHVCocoa when scrolling.
This fixes the trails left behind when scrolling with the findbar open.
BUG=16124
TEST=Scroll with the find bar or popup blocker open. Make sure there are
no trails left behind or other drawing issues.
Review URL: http://codereview.chromium.org/149556
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_mac.mm | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index a039497..0f0dc0e 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -220,23 +220,14 @@ void RenderWidgetHostViewMac::DidScrollRect( if (is_hidden_) return; - // Before asking the cocoa view to scroll, shorten the rect's bounds - // by the amount we are scrolling. This will prevent us from moving - // data beyond the bounds of the original rect, which in turn - // prevents us from accidentally drawing over other parts of the - // page (scrolbars, other frames, etc). - gfx::Rect scroll_rect = rect; - scroll_rect.Inset(dx < 0 ? -dx : 0, - dy < 0 ? -dy : 0, - dx > 0 ? dx : 0, - dy > 0 ? dy : 0); - [cocoa_view_ scrollRect:[cocoa_view_ RectToNSRect:scroll_rect] - by:NSMakeSize(dx, -dy)]; - - gfx::Rect new_rect = rect; - new_rect.Offset(dx, dy); - gfx::Rect dirty_rect = rect.Subtract(new_rect); - [cocoa_view_ setNeedsDisplayInRect:[cocoa_view_ RectToNSRect:dirty_rect]]; + // We've already modified the BackingStore to reflect the scroll, so + // simply ask the RWHVCocoa to redraw itself based on the new + // pixels. We cannot use -[NSView scrollRect:by:] here because the + // findbar and blocked popups will leave trails behind. + // TODO(rohitrao): Evaluate how slow this full redraw is. If it + // turns out to be a problem, consider scrolling only a portion of + // the view, based on where the findbar and blocked popups are. + [cocoa_view_ setNeedsDisplay:YES]; } void RenderWidgetHostViewMac::RenderViewGone() { |