| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 paint_rect.x() - bitmap_rect.x(), | 152 paint_rect.x() - bitmap_rect.x(), |
| 153 paint_rect.y() - bitmap_rect.y(), | 153 paint_rect.y() - bitmap_rect.y(), |
| 154 paint_rect.width(), | 154 paint_rect.width(), |
| 155 paint_rect.height(), | 155 paint_rect.height(), |
| 156 dib->memory(), | 156 dib->memory(), |
| 157 reinterpret_cast<BITMAPINFO*>(&hdr)); | 157 reinterpret_cast<BITMAPINFO*>(&hdr)); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool BackingStoreWin::CopyFromBackingStore(const gfx::Rect& rect, | 161 bool BackingStoreWin::CopyFromBackingStore(const gfx::Rect& rect, |
| 162 skia::PlatformCanvas* output) { | 162 skia::PlatformBitmap* output) { |
| 163 if (!output->initialize(rect.width(), rect.height(), true)) | 163 if (!output->Allocate(rect.width(), rect.height(), true)) |
| 164 return false; | 164 return false; |
| 165 | 165 |
| 166 skia::ScopedPlatformPaint scoped_platform_paint(output); | 166 skia::ScopedPlatformBitmap scoped_platform_bitmap(output); |
| 167 HDC temp_dc = scoped_platform_paint.GetPlatformSurface(); | 167 HDC temp_dc = scoped_platform_bitmap.GetPlatformSurface(); |
| 168 BitBlt(temp_dc, 0, 0, rect.width(), rect.height(), | 168 BitBlt(temp_dc, 0, 0, rect.width(), rect.height(), |
| 169 hdc(), rect.x(), rect.y(), SRCCOPY); | 169 hdc(), rect.x(), rect.y(), SRCCOPY); |
| 170 return true; | 170 return true; |
| 171 } | 171 } |
| 172 | 172 |
| 173 void BackingStoreWin::ScrollBackingStore(int dx, int dy, | 173 void BackingStoreWin::ScrollBackingStore(int dx, int dy, |
| 174 const gfx::Rect& clip_rect, | 174 const gfx::Rect& clip_rect, |
| 175 const gfx::Size& view_size) { | 175 const gfx::Size& view_size) { |
| 176 RECT damaged_rect, r = clip_rect.ToRECT(); | 176 RECT damaged_rect, r = clip_rect.ToRECT(); |
| 177 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); | 177 ScrollDC(hdc_, dx, dy, NULL, &r, NULL, &damaged_rect); |
| 178 | 178 |
| 179 // 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! |
| 180 DCHECK(dx == 0 || dy == 0); | 180 DCHECK(dx == 0 || dy == 0); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace content | 183 } // namespace content |
| OLD | NEW |