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

Unified Diff: content/browser/renderer_host/backing_store_win.cc

Issue 12226127: Fix backing store scrolling on Windows in high-DPI mode. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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 | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/backing_store_win.cc
diff --git a/content/browser/renderer_host/backing_store_win.cc b/content/browser/renderer_host/backing_store_win.cc
index 59850e4a8143d6f49a3eda8243b354e2f13db835..77c03412805df0ef30561e8aade65f56a4c36ea8 100644
--- a/content/browser/renderer_host/backing_store_win.cc
+++ b/content/browser/renderer_host/backing_store_win.cc
@@ -192,8 +192,13 @@ void BackingStoreWin::ScrollBackingStore(const gfx::Vector2d& delta,
// TODO(darin): this doesn't work if delta x() and y() are both non-zero!
DCHECK(delta.x() == 0 || delta.y() == 0);
- RECT damaged_rect, r = clip_rect.ToRECT();
- ScrollDC(hdc_, delta.x(), delta.y(), NULL, &r, NULL, &damaged_rect);
+ float scale = ui::win::GetDeviceScaleFactor();
+ gfx::Rect screen_rect = gfx::ToEnclosingRect(
+ gfx::ScaleRect(clip_rect, scale));
+ int dx = static_cast<int>(delta.x() * scale);
+ int dy = static_cast<int>(delta.y() * scale);
+ RECT damaged_rect, r = screen_rect.ToRECT();
+ ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect);
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698