| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_SNAPSHOT_SNAPSHOT_AURA_H_ | 5 #ifndef UI_SNAPSHOT_SNAPSHOT_AURA_H_ |
| 6 #define UI_SNAPSHOT_SNAPSHOT_AURA_H_ | 6 #define UI_SNAPSHOT_SNAPSHOT_AURA_H_ |
| 7 | 7 |
| 8 #include "ui/snapshot/snapshot.h" | 8 #include "ui/snapshot/snapshot.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 class Layer; |
| 13 |
| 12 // These functions are identical to those in snapshot.h, except they're | 14 // These functions are identical to those in snapshot.h, except they're |
| 13 // guaranteed to read the frame using an Aura CopyOutputRequest and not the | 15 // guaranteed to read the frame using an Aura CopyOutputRequest and not the |
| 14 // native windowing system. source_rect and target_size are in DIP. | 16 // native windowing system. source_rect and target_size are in DIP. |
| 15 | 17 |
| 16 SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsyncAura( | 18 SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsyncAura( |
| 17 aura::Window* window, | 19 aura::Window* window, |
| 18 const gfx::Rect& source_rect, | 20 const gfx::Rect& source_rect, |
| 19 const gfx::Size& target_size, | 21 const gfx::Size& target_size, |
| 20 scoped_refptr<base::TaskRunner> background_task_runner, | 22 scoped_refptr<base::TaskRunner> background_task_runner, |
| 21 const GrabWindowSnapshotAsyncCallback& callback); | 23 const GrabWindowSnapshotAsyncCallback& callback); |
| 22 | 24 |
| 23 SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncAura( | 25 SNAPSHOT_EXPORT void GrabWindowSnapshotAsyncAura( |
| 24 aura::Window* window, | 26 aura::Window* window, |
| 25 const gfx::Rect& source_rect, | 27 const gfx::Rect& source_rect, |
| 26 const GrabWindowSnapshotAsyncCallback& callback); | 28 const GrabWindowSnapshotAsyncCallback& callback); |
| 27 | 29 |
| 30 using GrabLayerSnapshotCallback = |
| 31 base::Callback<void(const gfx::Image& snapshot)>; |
| 32 |
| 33 // Grabs a snapshot of a |layer| and all its descendants. |
| 34 // |source_rect| is the bounds of the snapshot content relative to |layer|. |
| 35 SNAPSHOT_EXPORT void GrabLayerSnapshotAsync( |
| 36 Layer* layer, |
| 37 const gfx::Rect& source_rect, |
| 38 const GrabLayerSnapshotCallback& callback); |
| 39 |
| 28 } // namespace ui | 40 } // namespace ui |
| 29 | 41 |
| 30 #endif // UI_SNAPSHOT_SNAPSHOT_AURA_H_ | 42 #endif // UI_SNAPSHOT_SNAPSHOT_AURA_H_ |
| OLD | NEW |