diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 14:04:40 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 14:04:40 +0000 |
commit | 46537b9965921d79d1c866e9bfb0e07ccf8bff32 (patch) | |
tree | d993c5640c6b2b7dafa877fc0ee7091df1e3752b /content | |
parent | dccd0c3c932172c8b71810b78b22f6feee09a825 (diff) | |
download | chromium_src-46537b9965921d79d1c866e9bfb0e07ccf8bff32.zip chromium_src-46537b9965921d79d1c866e9bfb0e07ccf8bff32.tar.gz chromium_src-46537b9965921d79d1c866e9bfb0e07ccf8bff32.tar.bz2 |
aura: Scale the scroll-amount correctly for device-scale-factor.
BUG=133511
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/10636054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/backing_store_aura.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/content/browser/renderer_host/backing_store_aura.cc b/content/browser/renderer_host/backing_store_aura.cc index c995ea1..f797cdb 100644 --- a/content/browser/renderer_host/backing_store_aura.cc +++ b/content/browser/renderer_host/backing_store_aura.cc @@ -127,12 +127,15 @@ void BackingStoreAura::ScrollBackingStore(int dx, int dy, const gfx::Rect& clip_rect, const gfx::Size& view_size) { gfx::Rect pixel_rect = clip_rect.Scale(device_scale_factor_); - int x = std::min(pixel_rect.x(), pixel_rect.x() - dx); - int y = std::min(pixel_rect.y(), pixel_rect.y() - dy); - int w = pixel_rect.width() + abs(dx); - int h = pixel_rect.height() + abs(dy); + int pixel_dx = dx * device_scale_factor_; + int pixel_dy = dy * device_scale_factor_; + + int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx); + int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy); + int w = pixel_rect.width() + abs(pixel_dx); + int h = pixel_rect.height() + abs(pixel_dy); SkIRect rect = SkIRect::MakeXYWH(x, y, w, h); - bitmap_.scrollRect(&rect, dx, dy); + bitmap_.scrollRect(&rect, pixel_dx, pixel_dy); } bool BackingStoreAura::CopyFromBackingStore(const gfx::Rect& rect, |