| Index: chrome/browser/ui/views/ash/screenshot_taker.cc
|
| diff --git a/chrome/browser/ui/views/ash/screenshot_taker.cc b/chrome/browser/ui/views/ash/screenshot_taker.cc
|
| index e7659ec23dd08b66fd53ec8e6e80fef909f707e9..a0bda9ecae7e74d68beceaae063a8853b7a111e5 100644
|
| --- a/chrome/browser/ui/views/ash/screenshot_taker.cc
|
| +++ b/chrome/browser/ui/views/ash/screenshot_taker.cc
|
| @@ -24,6 +24,7 @@
|
| #include "chrome/browser/ui/window_snapshot/window_snapshot.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "ui/aura/root_window.h"
|
| #include "ui/aura/window.h"
|
|
|
| #if defined(OS_CHROMEOS)
|
| @@ -117,6 +118,20 @@ void SaveScreenshot(bool is_logged_in,
|
| }
|
| }
|
|
|
| +bool GrabWindowSnapshot(aura::Window* window,
|
| + const gfx::Rect& snapshot_bounds,
|
| + std::vector<unsigned char>* png_data) {
|
| +#if defined(OS_LINUX)
|
| + // We use XGetImage() for Linux/ChromeOS for performance reasons.
|
| + // See crbug.com/119492
|
| + // TODO(mukai): remove this when the performance issue has been fixed.
|
| + if (window->GetRootWindow()->GrabSnapshot(snapshot_bounds, png_data))
|
| + return true;
|
| +#endif // OS_LINUX
|
| +
|
| + return browser::GrabWindowSnapshot(window, png_data, snapshot_bounds);
|
| +}
|
| +
|
| // How opaque should the layer that we flash onscreen to provide visual
|
| // feedback after the screenshot is taken be?
|
| const float kVisualFeedbackLayerOpacity = 0.25f;
|
| @@ -145,7 +160,7 @@ void ScreenshotTaker::HandleTakePartialScreenshot(
|
|
|
| bool use_24hour_clock = ShouldUse24HourClock();
|
|
|
| - if (browser::GrabWindowSnapshot(window, &png_data->data(), rect)) {
|
| + if (GrabWindowSnapshot(window, rect, &png_data->data())) {
|
| DisplayVisualFeedback(rect);
|
| content::BrowserThread::PostTask(
|
| content::BrowserThread::FILE, FROM_HERE,
|
|
|