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

Unified Diff: content/browser/renderer_host/render_widget_host_view_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
Index: content/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 47dc3eaa664758dfd987a4565d2523d2ee276fd5..0d99895208d0ada454fac9d36b9af20c60bd0655 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -736,9 +736,14 @@ void RenderWidgetHostViewWin::DidUpdateBackingStore(
}
if (!scroll_rect.IsEmpty()) {
- RECT clip_rect = scroll_rect.ToRECT();
- ScrollWindowEx(scroll_delta.x(), scroll_delta.y(), NULL, &clip_rect,
- NULL, NULL, SW_INVALIDATE);
+ gfx::Rect pixel_rect = ui::win::DIPToScreenRect(scroll_rect);
+ // Damage might not be DIP aligned.
+ pixel_rect.Inset(-1, -1);
+ RECT clip_rect = pixel_rect.ToRECT();
+ float scale = ui::win::GetDeviceScaleFactor();
+ int dx = static_cast<int>(scale * scroll_delta.x());
+ int dy = static_cast<int>(scale * scroll_delta.y());
+ ScrollWindowEx(dx, dy, NULL, &clip_rect, NULL, NULL, SW_INVALIDATE);
}
if (!about_to_validate_and_paint_)
« no previous file with comments | « content/browser/renderer_host/backing_store_win.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698