| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/backing_store.h" | 5 #include "chrome/browser/renderer_host/backing_store.h" |
| 6 | 6 |
| 7 #include "app/gfx/gdi_util.h" | 7 #include "app/gfx/gdi_util.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host.h" | 9 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 paint_rect.width(), | 139 paint_rect.width(), |
| 140 paint_rect.height(), | 140 paint_rect.height(), |
| 141 paint_rect.x() - bitmap_rect.x(), | 141 paint_rect.x() - bitmap_rect.x(), |
| 142 paint_rect.y() - bitmap_rect.y(), | 142 paint_rect.y() - bitmap_rect.y(), |
| 143 paint_rect.width(), | 143 paint_rect.width(), |
| 144 paint_rect.height(), | 144 paint_rect.height(), |
| 145 bitmap->memory(), | 145 bitmap->memory(), |
| 146 reinterpret_cast<BITMAPINFO*>(&hdr)); | 146 reinterpret_cast<BITMAPINFO*>(&hdr)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void BackingStore::ScrollRect(int dx, int dy, | 149 void BackingStore::ScrollRect(base::ProcessHandle process, |
| 150 TransportDIB* bitmap, |
| 151 const gfx::Rect& bitmap_rect, |
| 152 int dx, int dy, |
| 150 const gfx::Rect& clip_rect, | 153 const gfx::Rect& clip_rect, |
| 151 const gfx::Size& view_size) { | 154 const gfx::Size& view_size) { |
| 152 RECT damaged_rect, r = clip_rect.ToRECT(); | 155 RECT damaged_rect, r = clip_rect.ToRECT(); |
| 153 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 156 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 154 | 157 |
| 155 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 158 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
| 156 DCHECK(dx == 0 || dy == 0); | 159 DCHECK(dx == 0 || dy == 0); |
| 160 |
| 161 // We expect that damaged_rect should equal bitmap_rect. |
| 162 DCHECK(gfx::Rect(damaged_rect) == bitmap_rect); |
| 163 |
| 164 PaintRect(process, bitmap, bitmap_rect, bitmap_rect); |
| 157 } | 165 } |
| OLD | NEW |