| 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 "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "content/browser/renderer_host/render_process_host.h" | 9 #include "content/browser/renderer_host/render_process_host.h" |
| 10 #include "content/browser/renderer_host/render_widget_host.h" | 10 #include "content/browser/renderer_host/render_widget_host.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 dib->memory(), | 151 dib->memory(), |
| 152 reinterpret_cast<BITMAPINFO*>(&hdr)); | 152 reinterpret_cast<BITMAPINFO*>(&hdr)); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool BackingStoreWin::CopyFromBackingStore(const gfx::Rect& rect, | 156 bool BackingStoreWin::CopyFromBackingStore(const gfx::Rect& rect, |
| 157 skia::PlatformCanvas* output) { | 157 skia::PlatformCanvas* output) { |
| 158 if (!output->initialize(rect.width(), rect.height(), true)) | 158 if (!output->initialize(rect.width(), rect.height(), true)) |
| 159 return false; | 159 return false; |
| 160 | 160 |
| 161 HDC temp_dc = output->beginPlatformPaint(); | 161 HDC temp_dc = skia::BeginPlatformPaint(output); |
| 162 BitBlt(temp_dc, 0, 0, rect.width(), rect.height(), | 162 BitBlt(temp_dc, 0, 0, rect.width(), rect.height(), |
| 163 hdc(), rect.x(), rect.y(), SRCCOPY); | 163 hdc(), rect.x(), rect.y(), SRCCOPY); |
| 164 output->endPlatformPaint(); | 164 skia::EndPlatformPaint(output); |
| 165 return true; | 165 return true; |
| 166 } | 166 } |
| 167 | 167 |
| 168 void BackingStoreWin::ScrollBackingStore(int dx, int dy, | 168 void BackingStoreWin::ScrollBackingStore(int dx, int dy, |
| 169 const gfx::Rect& clip_rect, | 169 const gfx::Rect& clip_rect, |
| 170 const gfx::Size& view_size) { | 170 const gfx::Size& view_size) { |
| 171 RECT damaged_rect, r = clip_rect.ToRECT(); | 171 RECT damaged_rect, r = clip_rect.ToRECT(); |
| 172 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 172 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 173 | 173 |
| 174 // TODO(darin): this doesn't work if dx and dy are both non-zero! | 174 // TODO(darin): this doesn't work if dx and dy are both non-zero! |
| 175 DCHECK(dx == 0 || dy == 0); | 175 DCHECK(dx == 0 || dy == 0); |
| 176 } | 176 } |
| OLD | NEW |