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

Side by Side Diff: ui/aura/root_window_host_x11.cc

Issue 22261009: aura: Fix crash in RootWindowHostX11::GetXImage(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/aura/root_window_host_x11.h" 5 #include "ui/aura/root_window_host_x11.h"
6 6
7 #include <strings.h> 7 #include <strings.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/Xfixes.h> 9 #include <X11/extensions/Xfixes.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 delegate_->OnHostMouseEvent(event); 1085 delegate_->OnHostMouseEvent(event);
1086 } 1086 }
1087 1087
1088 scoped_ptr<ui::XScopedImage> RootWindowHostX11::GetXImage( 1088 scoped_ptr<ui::XScopedImage> RootWindowHostX11::GetXImage(
1089 const gfx::Rect& snapshot_bounds) { 1089 const gfx::Rect& snapshot_bounds) {
1090 scoped_ptr<ui::XScopedImage> image(new ui::XScopedImage( 1090 scoped_ptr<ui::XScopedImage> image(new ui::XScopedImage(
1091 XGetImage(xdisplay_, xwindow_, 1091 XGetImage(xdisplay_, xwindow_,
1092 snapshot_bounds.x(), snapshot_bounds.y(), 1092 snapshot_bounds.x(), snapshot_bounds.y(),
1093 snapshot_bounds.width(), snapshot_bounds.height(), 1093 snapshot_bounds.width(), snapshot_bounds.height(),
1094 AllPlanes, ZPixmap))); 1094 AllPlanes, ZPixmap)));
1095 if (!image) { 1095 if (!image->get()) {
tfarina 2013/08/10 17:08:58 ok.
1096 LOG(ERROR) << "XGetImage failed"; 1096 LOG(ERROR) << "XGetImage failed";
1097 image.reset(); 1097 image.reset();
1098 } 1098 }
1099 return image.Pass(); 1099 return image.Pass();
1100 } 1100 }
1101 1101
1102 void RootWindowHostX11::UpdateIsInternalDisplay() { 1102 void RootWindowHostX11::UpdateIsInternalDisplay() {
1103 RootWindow* root_window = GetRootWindow(); 1103 RootWindow* root_window = GetRootWindow();
1104 gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window); 1104 gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window);
1105 gfx::Display display = screen->GetDisplayNearestWindow(root_window); 1105 gfx::Display display = screen->GetDisplayNearestWindow(root_window);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1146 }
1147 1147
1148 namespace test { 1148 namespace test {
1149 1149
1150 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 1150 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
1151 default_override_redirect = override_redirect; 1151 default_override_redirect = override_redirect;
1152 } 1152 }
1153 1153
1154 } // namespace test 1154 } // namespace test
1155 } // namespace aura 1155 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698