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

Side by Side Diff: chrome/browser/ui/window_snapshot/window_snapshot_win.cc

Issue 6312156: Change includes of gfx/* to ui/gfx/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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) 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 "chrome/browser/ui/window_snapshot/window_snapshot.h" 5 #include "chrome/browser/ui/window_snapshot/window_snapshot.h"
6 6
7 #include "base/win/scoped_gdi_object.h" 7 #include "base/win/scoped_gdi_object.h"
8 #include "base/win/scoped_hdc.h" 8 #include "base/win/scoped_hdc.h"
9 #include "gfx/codec/png_codec.h" 9 #include "ui/gfx/codec/png_codec.h"
10 #include "gfx/gdi_util.h" 10 #include "ui/gfx/gdi_util.h"
11 #include "gfx/rect.h" 11 #include "ui/gfx/rect.h"
12 12
13 namespace browser { 13 namespace browser {
14 14
15 gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window_handle, 15 gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window_handle,
16 std::vector<unsigned char>* png_representation) { 16 std::vector<unsigned char>* png_representation) {
17 // Create a memory DC that's compatible with the window. 17 // Create a memory DC that's compatible with the window.
18 HDC window_hdc = GetWindowDC(window_handle); 18 HDC window_hdc = GetWindowDC(window_handle);
19 base::win::ScopedHDC mem_hdc(CreateCompatibleDC(window_hdc)); 19 base::win::ScopedHDC mem_hdc(CreateCompatibleDC(window_hdc));
20 20
21 // Create a DIB that's the same size as the window. 21 // Create a DIB that's the same size as the window.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 gfx::PNGCodec::Encode(bit_ptr, gfx::PNGCodec::FORMAT_BGRA, 63 gfx::PNGCodec::Encode(bit_ptr, gfx::PNGCodec::FORMAT_BGRA,
64 width, height, width * 4, true, 64 width, height, width * 4, true,
65 png_representation); 65 png_representation);
66 66
67 ReleaseDC(window_handle, window_hdc); 67 ReleaseDC(window_handle, window_hdc);
68 68
69 return gfx::Rect(width, height); 69 return gfx::Rect(width, height);
70 } 70 }
71 71
72 } // namespace browser 72 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698