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

Unified Diff: ui/aura/root_window_host_x11.cc

Issue 22846004: Merge 216933 "aura: Fix crash in RootWindowHostX11::GetXImage()." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/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 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
===================================================================
--- ui/aura/root_window_host_x11.cc (revision 217073)
+++ ui/aura/root_window_host_x11.cc (working copy)
@@ -792,13 +792,17 @@
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 ||
(0xff << SK_G32_SHIFT) != image->green_mask ||
@@ -1047,20 +1051,6 @@
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