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

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

Issue 12317157: Fix touch scaling for high dpi windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding extra safety logic to address XP failure. 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 | ui/base/win/dpi.h » ('j') | ui/base/win/dpi.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6500a8bb35bbce288e22f57bb33a52c7d7d7aa9f..048f3e4ade7ac2767d395d6a6ebbbb453701020d 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -2072,8 +2072,9 @@ WebKit::WebTouchPoint* WebTouchState::AddTouchPoint(
bool WebTouchState::UpdateTouchPoint(
WebKit::WebTouchPoint* touch_point,
TOUCHINPUT* touch_input) {
- CPoint coordinates(TOUCH_COORD_TO_PIXEL(touch_input->x),
- TOUCH_COORD_TO_PIXEL(touch_input->y));
+ CPoint coordinates(
+ TOUCH_COORD_TO_PIXEL(touch_input->x) / ui::win::GetDPIScaleFromRegistry(),
+ TOUCH_COORD_TO_PIXEL(touch_input->y) / ui::win::GetDPIScaleFromRegistry());
int radius_x = 1;
int radius_y = 1;
if (touch_input->dwMask & TOUCHINPUTMASKF_CONTACTAREA) {
@@ -2140,8 +2141,8 @@ LRESULT RenderWidgetHostViewWin::OnTouchEvent(UINT message, WPARAM wparam,
if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) {
pointer_down_context_ = true;
last_touch_location_ = gfx::Point(
- TOUCH_COORD_TO_PIXEL(points[0].x),
- TOUCH_COORD_TO_PIXEL(points[0].y));
+ TOUCH_COORD_TO_PIXEL(points[0].x) / ui::win::GetDPIScaleFromRegistry(),
+ TOUCH_COORD_TO_PIXEL(points[0].y) / ui::win::GetDPIScaleFromRegistry());
}
bool should_forward = render_widget_host_->ShouldForwardTouchEvent() &&
« no previous file with comments | « no previous file | ui/base/win/dpi.h » ('j') | ui/base/win/dpi.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698