| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "chrome/browser/renderer_host/backing_store_win.h" |
| 6 | 6 |
| 7 #include "app/surface/transport_dib.h" | 7 #include "app/surface/transport_dib.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/renderer_host/render_process_host.h" | 9 #include "chrome/browser/renderer_host/render_process_host.h" |
| 10 #include "chrome/browser/renderer_host/render_widget_host.h" | 10 #include "chrome/browser/renderer_host/render_widget_host.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 | 110 |
| 111 size_t BackingStoreWin::MemorySize() { | 111 size_t BackingStoreWin::MemorySize() { |
| 112 return size().GetArea() * (color_depth_ / 8); | 112 return size().GetArea() * (color_depth_ / 8); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void BackingStoreWin::PaintToBackingStore( | 115 void BackingStoreWin::PaintToBackingStore( |
| 116 RenderProcessHost* process, | 116 RenderProcessHost* process, |
| 117 TransportDIB::Id bitmap, | 117 TransportDIB::Id bitmap, |
| 118 const gfx::Rect& bitmap_rect, | 118 const gfx::Rect& bitmap_rect, |
| 119 const std::vector<gfx::Rect>& copy_rects, | 119 const std::vector<gfx::Rect>& copy_rects) { |
| 120 bool* painted_synchronously) { | |
| 121 // Our paints are always synchronous and the TransportDIB can be freed when | |
| 122 // we're done (even on error). | |
| 123 *painted_synchronously = true; | |
| 124 | |
| 125 if (!backing_store_dib_) { | 120 if (!backing_store_dib_) { |
| 126 backing_store_dib_ = CreateDIB(hdc_, size().width(), | 121 backing_store_dib_ = CreateDIB(hdc_, size().width(), |
| 127 size().height(), color_depth_); | 122 size().height(), color_depth_); |
| 128 if (!backing_store_dib_) { | 123 if (!backing_store_dib_) { |
| 129 NOTREACHED(); | 124 NOTREACHED(); |
| 130 return; | 125 return; |
| 131 } | 126 } |
| 132 original_bitmap_ = SelectObject(hdc_, backing_store_dib_); | 127 original_bitmap_ = SelectObject(hdc_, backing_store_dib_); |
| 133 } | 128 } |
| 134 | 129 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 166 |
| 172 void BackingStoreWin::ScrollBackingStore(int dx, int dy, | 167 void BackingStoreWin::ScrollBackingStore(int dx, int dy, |
| 173 const gfx::Rect& clip_rect, | 168 const gfx::Rect& clip_rect, |
| 174 const gfx::Size& view_size) { | 169 const gfx::Size& view_size) { |
| 175 RECT damaged_rect, r = clip_rect.ToRECT(); | 170 RECT damaged_rect, r = clip_rect.ToRECT(); |
| 176 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 171 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 177 | 172 |
| 178 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 173 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
| 179 DCHECK(dx == 0 || dy == 0); | 174 DCHECK(dx == 0 || dy == 0); |
| 180 } | 175 } |
| OLD | NEW |