OLD | NEW |
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 Loading... |
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 |
OLD | NEW |