| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 8 #include "base/command_line.h" |
| 8 #include "base/gfx/gdi_util.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" |
| 11 #include "chrome/common/transport_dib.h" | 11 #include "chrome/common/transport_dib.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 // Creates a dib conforming to the height/width/section parameters passed in. | 15 // Creates a dib conforming to the height/width/section parameters passed in. |
| 16 HANDLE CreateDIB(HDC dc, int width, int height, int color_depth) { | 16 HANDLE CreateDIB(HDC dc, int width, int height, int color_depth) { |
| 17 BITMAPV5HEADER hdr = {0}; | 17 BITMAPV5HEADER hdr = {0}; |
| 18 ZeroMemory(&hdr, sizeof(BITMAPV5HEADER)); | 18 ZeroMemory(&hdr, sizeof(BITMAPV5HEADER)); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 130 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 131 | 131 |
| 132 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 132 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
| 133 DCHECK(dx == 0 || dy == 0); | 133 DCHECK(dx == 0 || dy == 0); |
| 134 | 134 |
| 135 // We expect that damaged_rect should equal bitmap_rect. | 135 // We expect that damaged_rect should equal bitmap_rect. |
| 136 DCHECK(gfx::Rect(damaged_rect) == bitmap_rect); | 136 DCHECK(gfx::Rect(damaged_rect) == bitmap_rect); |
| 137 | 137 |
| 138 PaintRect(process, bitmap, bitmap_rect); | 138 PaintRect(process, bitmap, bitmap_rect); |
| 139 } | 139 } |
| OLD | NEW |