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 SNAPSHOT_EXPORT void GrabLayerSnapshotAsync( | |
sky
2017/05/17 14:48:30
Please add description and use OnceCallback.
Muyuan
2017/05/17 19:25:35
I'm reusing the function in MakeAsyncCopyRequest,
| |
34 Layer* layer, | |
35 const gfx::Rect& source_rect, | |
36 const GrabLayerSnapshotCallback& callback); | |
37 | |
28 } // namespace ui | 38 } // namespace ui |
29 | 39 |
30 #endif // UI_SNAPSHOT_SNAPSHOT_AURA_H_ | 40 #endif // UI_SNAPSHOT_SNAPSHOT_AURA_H_ |
OLD | NEW |