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 "chrome/browser/ui/window_snapshot/window_snapshot.h" | 5 #include "chrome/browser/ui/window_snapshot/window_snapshot.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "gfx/rect.h" | |
12 #include "ui/base/x/x11_util.h" | 11 #include "ui/base/x/x11_util.h" |
| 12 #include "ui/gfx/rect.h" |
13 | 13 |
14 namespace browser { | 14 namespace browser { |
15 | 15 |
16 static cairo_status_t SnapshotCallback( | 16 static cairo_status_t SnapshotCallback( |
17 void *closure, const unsigned char *data, unsigned int length) { | 17 void *closure, const unsigned char *data, unsigned int length) { |
18 std::vector<unsigned char>* png_representation = | 18 std::vector<unsigned char>* png_representation = |
19 static_cast<std::vector<unsigned char>*>(closure); | 19 static_cast<std::vector<unsigned char>*>(closure); |
20 | 20 |
21 size_t old_size = png_representation->size(); | 21 size_t old_size = png_representation->size(); |
22 png_representation->resize(old_size + length); | 22 png_representation->resize(old_size + length); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 return gfx::Rect(); | 57 return gfx::Rect(); |
58 } | 58 } |
59 cairo_surface_write_to_png_stream( | 59 cairo_surface_write_to_png_stream( |
60 surface, SnapshotCallback, png_representation); | 60 surface, SnapshotCallback, png_representation); |
61 cairo_surface_destroy(surface); | 61 cairo_surface_destroy(surface); |
62 | 62 |
63 return gfx::Rect(image->width, image->height); | 63 return gfx::Rect(image->width, image->height); |
64 } | 64 } |
65 | 65 |
66 } // namespace browser | 66 } // namespace browser |
OLD | NEW |