Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: chrome/browser/ui/panels/taskbar_window_thumbnailer_win.cc

Issue 10790128: Revert 147915 - Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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), ui::SCALE_FACTOR_100P, false); 131 gfx::Canvas canvas(gfx::Size(width, height), 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.ExtractImageRep().sk_bitmap()); 137 return new SkBitmap(canvas.ExtractBitmap());
138 } 138 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_frame_view.cc ('k') | chrome/browser/ui/views/dropdown_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698