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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 TransportDIB* dib = process->GetTransportDIB(bitmap); | 136 TransportDIB* dib = process->GetTransportDIB(bitmap); |
137 if (!dib) | 137 if (!dib) |
138 return; | 138 return; |
139 | 139 |
140 BITMAPINFOHEADER hdr; | 140 BITMAPINFOHEADER hdr; |
141 gfx::CreateBitmapHeader(bitmap_rect.width(), bitmap_rect.height(), &hdr); | 141 gfx::CreateBitmapHeader(bitmap_rect.width(), bitmap_rect.height(), &hdr); |
142 // Account for a bitmap_rect that exceeds the bounds of our view | 142 // Account for a bitmap_rect that exceeds the bounds of our view |
143 gfx::Rect view_rect(size()); | 143 gfx::Rect view_rect(size()); |
144 | 144 |
145 for (size_t i = 0; i < copy_rects.size(); i++) { | 145 for (size_t i = 0; i < copy_rects.size(); i++) { |
146 gfx::Rect paint_rect = view_rect.Intersect(copy_rects[i]); | 146 gfx::Rect paint_rect = view_rect; |
| 147 paint_rect.Intersect(copy_rects[i]); |
147 CallStretchDIBits(hdc_, | 148 CallStretchDIBits(hdc_, |
148 paint_rect.x(), | 149 paint_rect.x(), |
149 paint_rect.y(), | 150 paint_rect.y(), |
150 paint_rect.width(), | 151 paint_rect.width(), |
151 paint_rect.height(), | 152 paint_rect.height(), |
152 paint_rect.x() - bitmap_rect.x(), | 153 paint_rect.x() - bitmap_rect.x(), |
153 paint_rect.y() - bitmap_rect.y(), | 154 paint_rect.y() - bitmap_rect.y(), |
154 paint_rect.width(), | 155 paint_rect.width(), |
155 paint_rect.height(), | 156 paint_rect.height(), |
156 dib->memory(), | 157 dib->memory(), |
(...skipping 16 matching lines...) Expand all Loading... |
173 const gfx::Rect& clip_rect, | 174 const gfx::Rect& clip_rect, |
174 const gfx::Size& view_size) { | 175 const gfx::Size& view_size) { |
175 RECT damaged_rect, r = clip_rect.ToRECT(); | 176 RECT damaged_rect, r = clip_rect.ToRECT(); |
176 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 177 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
177 | 178 |
178 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 179 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
179 DCHECK(dx == 0 || dy == 0); | 180 DCHECK(dx == 0 || dy == 0); |
180 } | 181 } |
181 | 182 |
182 } // namespace content | 183 } // namespace content |
OLD | NEW |