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