| Index: ui/snapshot/snapshot_aura.cc
|
| diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc
|
| index 25eb73ee1701457462b2648b9d8e6a00692e8ad1..94963f3602a8402288310efef7b230011af1397a 100644
|
| --- a/ui/snapshot/snapshot_aura.cc
|
| +++ b/ui/snapshot/snapshot_aura.cc
|
| @@ -177,26 +177,8 @@ bool GrabViewSnapshot(gfx::NativeView view,
|
| bool GrabWindowSnapshot(gfx::NativeWindow window,
|
| std::vector<unsigned char>* png_representation,
|
| const gfx::Rect& snapshot_bounds) {
|
| - gfx::Rect read_pixels_bounds_in_pixel =
|
| - GetTargetBoundsFromWindow(window, snapshot_bounds);
|
| -
|
| - ui::Compositor* compositor = window->layer()->GetCompositor();
|
| - SkBitmap bitmap;
|
| - if (!compositor->ReadPixels(&bitmap, read_pixels_bounds_in_pixel))
|
| - return false;
|
| -
|
| - gfx::Display display =
|
| - gfx::Screen::GetScreenFor(window)->GetDisplayNearestWindow(window);
|
| - RotateBitmap(&bitmap, display.rotation());
|
| -
|
| - unsigned char* pixels = reinterpret_cast<unsigned char*>(
|
| - bitmap.pixelRef()->pixels());
|
| - return gfx::PNGCodec::Encode(
|
| - pixels, gfx::PNGCodec::FORMAT_BGRA,
|
| - gfx::Size(bitmap.width(), bitmap.height()),
|
| - base::checked_numeric_cast<int>(bitmap.rowBytes()),
|
| - true, std::vector<gfx::PNGCodec::Comment>(),
|
| - png_representation);
|
| + // Not supported in Aura. Callers should fall back to the async version.
|
| + return false;
|
| }
|
|
|
| void MakeAsyncCopyRequest(
|
| @@ -261,4 +243,13 @@ void GrabWindowSnapshotAsync(
|
| background_task_runner));
|
| }
|
|
|
| +void GrabViewSnapshotAsync(
|
| + gfx::NativeView view,
|
| + const gfx::Rect& source_rect,
|
| + scoped_refptr<base::TaskRunner> background_task_runner,
|
| + const GrabWindowSnapshotAsyncPNGCallback& callback) {
|
| + GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback);
|
| +}
|
| +
|
| +
|
| } // namespace ui
|
|
|