| Index: ui/base/x/x11_util.cc
|
| diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
|
| index 56e53f98b83c6bddfe88083a8433da8f93de997a..f95ed0d0e4152f24c88a630f42621214a1183b04 100644
|
| --- a/ui/base/x/x11_util.cc
|
| +++ b/ui/base/x/x11_util.cc
|
| @@ -692,54 +692,6 @@ bool GetWindowManagerName(std::string* wm_name) {
|
| return !got_error && result;
|
| }
|
|
|
| -static cairo_status_t SnapshotCallback(
|
| - void *closure, const unsigned char *data, unsigned int length) {
|
| - std::vector<unsigned char>* png_representation =
|
| - static_cast<std::vector<unsigned char>*>(closure);
|
| -
|
| - size_t old_size = png_representation->size();
|
| - png_representation->resize(old_size + length);
|
| - memcpy(&(*png_representation)[old_size], data, length);
|
| - return CAIRO_STATUS_SUCCESS;
|
| -}
|
| -
|
| -void GrabWindowSnapshot(GtkWindow* gtk_window,
|
| - std::vector<unsigned char>* png_representation) {
|
| - GdkWindow* gdk_window = GTK_WIDGET(gtk_window)->window;
|
| - Display* display = GDK_WINDOW_XDISPLAY(gdk_window);
|
| - XID win = GDK_WINDOW_XID(gdk_window);
|
| - XWindowAttributes attr;
|
| - if (XGetWindowAttributes(display, win, &attr) == 0) {
|
| - LOG(ERROR) << "Couldn't get window attributes";
|
| - return;
|
| - }
|
| - XImage* image = XGetImage(
|
| - display, win, 0, 0, attr.width, attr.height, AllPlanes, ZPixmap);
|
| - if (!image) {
|
| - LOG(ERROR) << "Couldn't get image";
|
| - return;
|
| - }
|
| - if (image->depth != 24) {
|
| - LOG(ERROR)<< "Unsupported image depth " << image->depth;
|
| - return;
|
| - }
|
| - cairo_surface_t* surface =
|
| - cairo_image_surface_create_for_data(
|
| - reinterpret_cast<unsigned char*>(image->data),
|
| - CAIRO_FORMAT_RGB24,
|
| - image->width,
|
| - image->height,
|
| - image->bytes_per_line);
|
| -
|
| - if (!surface) {
|
| - LOG(ERROR) << "Unable to create Cairo surface from XImage data";
|
| - return;
|
| - }
|
| - cairo_surface_write_to_png_stream(
|
| - surface, SnapshotCallback, png_representation);
|
| - cairo_surface_destroy(surface);
|
| -}
|
| -
|
| bool ChangeWindowDesktop(XID window, XID destination) {
|
| int desktop;
|
| if (!GetWindowDesktop(destination, &desktop))
|
|
|