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/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <InputScope.h> | 7 #include <InputScope.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 729 |
730 for (size_t i = 0; i < copy_rects.size(); ++i) { | 730 for (size_t i = 0; i < copy_rects.size(); ++i) { |
731 gfx::Rect pixel_rect = ui::win::DIPToScreenRect(copy_rects[i]); | 731 gfx::Rect pixel_rect = ui::win::DIPToScreenRect(copy_rects[i]); |
732 // Damage might not be DIP aligned. | 732 // Damage might not be DIP aligned. |
733 pixel_rect.Inset(-1, -1); | 733 pixel_rect.Inset(-1, -1); |
734 RECT bounds = pixel_rect.ToRECT(); | 734 RECT bounds = pixel_rect.ToRECT(); |
735 InvalidateRect(&bounds, false); | 735 InvalidateRect(&bounds, false); |
736 } | 736 } |
737 | 737 |
738 if (!scroll_rect.IsEmpty()) { | 738 if (!scroll_rect.IsEmpty()) { |
739 RECT clip_rect = scroll_rect.ToRECT(); | 739 gfx::Rect pixel_rect = ui::win::DIPToScreenRect(scroll_rect); |
740 ScrollWindowEx(scroll_delta.x(), scroll_delta.y(), NULL, &clip_rect, | 740 // Damage might not be DIP aligned. |
741 NULL, NULL, SW_INVALIDATE); | 741 pixel_rect.Inset(-1, -1); |
| 742 RECT clip_rect = pixel_rect.ToRECT(); |
| 743 float scale = ui::win::GetDeviceScaleFactor(); |
| 744 int dx = static_cast<int>(scale * scroll_delta.x()); |
| 745 int dy = static_cast<int>(scale * scroll_delta.y()); |
| 746 ScrollWindowEx(dx, dy, NULL, &clip_rect, NULL, NULL, SW_INVALIDATE); |
742 } | 747 } |
743 | 748 |
744 if (!about_to_validate_and_paint_) | 749 if (!about_to_validate_and_paint_) |
745 Redraw(); | 750 Redraw(); |
746 } | 751 } |
747 | 752 |
748 void RenderWidgetHostViewWin::RenderViewGone(base::TerminationStatus status, | 753 void RenderWidgetHostViewWin::RenderViewGone(base::TerminationStatus status, |
749 int error_code) { | 754 int error_code) { |
750 UpdateCursorIfOverSelf(); | 755 UpdateCursorIfOverSelf(); |
751 Destroy(); | 756 Destroy(); |
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 return new RenderWidgetHostViewWin(widget); | 3101 return new RenderWidgetHostViewWin(widget); |
3097 } | 3102 } |
3098 | 3103 |
3099 // static | 3104 // static |
3100 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3105 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3101 WebKit::WebScreenInfo* results) { | 3106 WebKit::WebScreenInfo* results) { |
3102 GetScreenInfoForWindow(results, 0); | 3107 GetScreenInfoForWindow(results, 0); |
3103 } | 3108 } |
3104 | 3109 |
3105 } // namespace content | 3110 } // namespace content |
OLD | NEW |