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

Unified 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: get rid of GetXImage() 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/root_window_host_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_host_x11.cc
diff --git a/ui/aura/root_window_host_x11.cc b/ui/aura/root_window_host_x11.cc
index ad1b957d7b5f4c70b832b60c3b3e15d3394f695b..f69a54a889895c4b1f543a3c6be001f3f73880fd 100644
--- a/ui/aura/root_window_host_x11.cc
+++ b/ui/aura/root_window_host_x11.cc
@@ -822,12 +822,16 @@ void RootWindowHostX11::SetFocusWhenShown(bool focus_when_shown) {
bool RootWindowHostX11::CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
const gfx::Point& dest_offset,
SkCanvas* canvas) {
- scoped_ptr<ui::XScopedImage> scoped_image(GetXImage(source_bounds));
- if (!scoped_image)
+ ui::XScopedImage scoped_image(
+ XGetImage(xdisplay_, xwindow_,
+ source_bounds.x(), source_bounds.y(),
+ source_bounds.width(), source_bounds.height(),
+ AllPlanes, ZPixmap));
+ XImage* image = scoped_image.get();
+ if (!image) {
+ LOG(ERROR) << "XGetImage failed";
return false;
-
- XImage* image = scoped_image->get();
- DCHECK(image);
+ }
if (image->bits_per_pixel == 32) {
if ((0xff << SK_R32_SHIFT) != image->red_mask ||
@@ -1085,20 +1089,6 @@ void RootWindowHostX11::TranslateAndDispatchMouseEvent(
delegate_->OnHostMouseEvent(event);
}
-scoped_ptr<ui::XScopedImage> RootWindowHostX11::GetXImage(
- const gfx::Rect& snapshot_bounds) {
- scoped_ptr<ui::XScopedImage> image(new ui::XScopedImage(
- XGetImage(xdisplay_, xwindow_,
- snapshot_bounds.x(), snapshot_bounds.y(),
- snapshot_bounds.width(), snapshot_bounds.height(),
- AllPlanes, ZPixmap)));
- if (!image) {
- LOG(ERROR) << "XGetImage failed";
- image.reset();
- }
- return image.Pass();
-}
-
void RootWindowHostX11::UpdateIsInternalDisplay() {
RootWindow* root_window = GetRootWindow();
gfx::Screen* screen = gfx::Screen::GetScreenFor(root_window);
« no previous file with comments | « ui/aura/root_window_host_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698