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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/backing_store_win.h" 5 #include "content/browser/renderer_host/backing_store_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 hdc(), rect.x(), rect.y(), SRCCOPY); 185 hdc(), rect.x(), rect.y(), SRCCOPY);
186 return true; 186 return true;
187 } 187 }
188 188
189 void BackingStoreWin::ScrollBackingStore(const gfx::Vector2d& delta, 189 void BackingStoreWin::ScrollBackingStore(const gfx::Vector2d& delta,
190 const gfx::Rect& clip_rect, 190 const gfx::Rect& clip_rect,
191 const gfx::Size& view_size) { 191 const gfx::Size& view_size) {
192 // TODO(darin): this doesn't work if delta x() and y() are both non-zero! 192 // TODO(darin): this doesn't work if delta x() and y() are both non-zero!
193 DCHECK(delta.x() == 0 || delta.y() == 0); 193 DCHECK(delta.x() == 0 || delta.y() == 0);
194 194
195 RECT damaged_rect, r = clip_rect.ToRECT(); 195 float scale = ui::win::GetDeviceScaleFactor();
196 ScrollDC(hdc_, delta.x(), delta.y(), NULL, &r, NULL, &damaged_rect); 196 gfx::Rect screen_rect = gfx::ToEnclosingRect(
197 gfx::ScaleRect(clip_rect, scale));
198 int dx = static_cast<int>(delta.x() * scale);
199 int dy = static_cast<int>(delta.y() * scale);
200 RECT damaged_rect, r = screen_rect.ToRECT();
201 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect);
197 } 202 }
198 203
199 } // namespace content 204 } // namespace content
OLDNEW
« 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