Index: chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
index 29a7417f1ff501866bfb1b4475a7e08eeb02a6fa..bb1c59477488047758a7a16f3d1772b7584e39c9 100644 |
--- a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
+++ b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
@@ -6,6 +6,7 @@ |
#include "base/logging.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
+#include "ui/aura/root_window.h" |
#include "ui/aura/window.h" |
#include "ui/compositor/compositor.h" |
#include "ui/compositor/dip_util.h" |
@@ -18,6 +19,14 @@ namespace browser { |
bool GrabWindowSnapshot(gfx::NativeWindow window, |
std::vector<unsigned char>* png_representation, |
const gfx::Rect& snapshot_bounds) { |
+#if defined(OS_LINUX) |
+ // We use XGetImage() for Linux/ChromeOS for performance reasons. |
+ // See crbug.com/122720 |
+ if (window->GetRootWindow()->GrabSnapshot( |
+ snapshot_bounds, png_representation)) |
+ return true; |
+#endif // OS_LINUX |
+ |
ui::Compositor* compositor = window->layer()->GetCompositor(); |
gfx::Rect read_pixels_bounds = snapshot_bounds; |