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..fcf7497a48e99c5b7ac7b4ce56c96858eae43ede 100644 |
--- a/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
+++ b/chrome/browser/ui/window_snapshot/window_snapshot_aura.cc |
@@ -7,6 +7,7 @@ |
#include "base/logging.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
#include "ui/aura/window.h" |
+#include "ui/aura/root_window.h" |
Daniel Erat
2012/05/15 23:35:08
nit: alphabetize
Jun Mukai
2012/05/16 18:07:43
Done.
|
#include "ui/compositor/compositor.h" |
#include "ui/compositor/dip_util.h" |
#include "ui/compositor/layer.h" |
@@ -18,6 +19,12 @@ 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 |
+ return window->GetRootWindow()->GrabSnapshot( |
+ png_representation, snapshot_bounds); |
+#else |
ui::Compositor* compositor = window->layer()->GetCompositor(); |
gfx::Rect read_pixels_bounds = snapshot_bounds; |
@@ -46,6 +53,7 @@ bool GrabWindowSnapshot(gfx::NativeWindow window, |
std::vector<gfx::PNGCodec::Comment>(), |
png_representation); |
return true; |
+#endif |
} |
} // namespace browser |