| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 rv = StretchDIBits(hdc, | 62 rv = StretchDIBits(hdc, |
| 63 dest_x, dest_y, dest_w, dest_h, | 63 dest_x, dest_y, dest_w, dest_h, |
| 64 src_x, bottom_up_src_y, src_w, src_h, | 64 src_x, bottom_up_src_y, src_w, src_h, |
| 65 pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY); | 65 pixels, bitmap_info, DIB_RGB_COLORS, SRCCOPY); |
| 66 } | 66 } |
| 67 DCHECK(rv != GDI_ERROR); | 67 DCHECK(rv != GDI_ERROR); |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace | 70 } // namespace |
| 71 | 71 |
| 72 BackingStoreWin::BackingStoreWin(RenderWidgetHost* widget, | 72 BackingStoreWin::BackingStoreWin(content::RenderWidgetHost* widget, |
| 73 const gfx::Size& size) | 73 const gfx::Size& size) |
| 74 : BackingStore(widget, size), | 74 : BackingStore(widget, size), |
| 75 backing_store_dib_(NULL), | 75 backing_store_dib_(NULL), |
| 76 original_bitmap_(NULL) { | 76 original_bitmap_(NULL) { |
| 77 HDC screen_dc = ::GetDC(NULL); | 77 HDC screen_dc = ::GetDC(NULL); |
| 78 color_depth_ = ::GetDeviceCaps(screen_dc, BITSPIXEL); | 78 color_depth_ = ::GetDeviceCaps(screen_dc, BITSPIXEL); |
| 79 // Color depths less than 16 bpp require a palette to be specified. Instead, | 79 // Color depths less than 16 bpp require a palette to be specified. Instead, |
| 80 // we specify the desired color depth as 16 which lets the OS to come up | 80 // we specify the desired color depth as 16 which lets the OS to come up |
| 81 // with an approximation. | 81 // with an approximation. |
| 82 if (color_depth_ < 16) | 82 if (color_depth_ < 16) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 void BackingStoreWin::ScrollBackingStore(int dx, int dy, | 171 void BackingStoreWin::ScrollBackingStore(int dx, int dy, |
| 172 const gfx::Rect& clip_rect, | 172 const gfx::Rect& clip_rect, |
| 173 const gfx::Size& view_size) { | 173 const gfx::Size& view_size) { |
| 174 RECT damaged_rect, r = clip_rect.ToRECT(); | 174 RECT damaged_rect, r = clip_rect.ToRECT(); |
| 175 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 175 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 176 | 176 |
| 177 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 177 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
| 178 DCHECK(dx == 0 || dy == 0); | 178 DCHECK(dx == 0 || dy == 0); |
| 179 } | 179 } |
| OLD | NEW |