| 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 "chrome/browser/ui/panels/taskbar_window_thumbnailer_win.h" | 5 #include "chrome/browser/ui/panels/taskbar_window_thumbnailer_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "skia/ext/image_operations.h" | 10 #include "skia/ext/image_operations.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 *l_result = 0; | 121 *l_result = 0; |
| 122 return true; | 122 return true; |
| 123 } | 123 } |
| 124 | 124 |
| 125 SkBitmap* TaskbarWindowThumbnailerWin::CaptureWindowImage() const { | 125 SkBitmap* TaskbarWindowThumbnailerWin::CaptureWindowImage() const { |
| 126 RECT bounds; | 126 RECT bounds; |
| 127 ::GetWindowRect(hwnd_, &bounds); | 127 ::GetWindowRect(hwnd_, &bounds); |
| 128 int width = bounds.right - bounds.left; | 128 int width = bounds.right - bounds.left; |
| 129 int height = bounds.bottom - bounds.top; | 129 int height = bounds.bottom - bounds.top; |
| 130 | 130 |
| 131 gfx::Canvas canvas(gfx::Size(width, height), false); | 131 gfx::Canvas canvas(gfx::Size(width, height), ui::SCALE_FACTOR_100P, false); |
| 132 HDC target_dc = canvas.BeginPlatformPaint(); | 132 HDC target_dc = canvas.BeginPlatformPaint(); |
| 133 HDC source_dc = ::GetDC(hwnd_); | 133 HDC source_dc = ::GetDC(hwnd_); |
| 134 ::BitBlt(target_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY); | 134 ::BitBlt(target_dc, 0, 0, width, height, source_dc, 0, 0, SRCCOPY); |
| 135 ::ReleaseDC(hwnd_, source_dc); | 135 ::ReleaseDC(hwnd_, source_dc); |
| 136 canvas.EndPlatformPaint(); | 136 canvas.EndPlatformPaint(); |
| 137 return new SkBitmap(canvas.ExtractBitmap()); | 137 return new SkBitmap(canvas.ExtractImageRep().sk_bitmap()); |
| 138 } | 138 } |
| OLD | NEW |