forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapshot_async.h
39 lines (29 loc) · 1.04 KB
/
snapshot_async.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_SNAPSHOT_SNAPSHOT_ASYNC_H_
#define UI_SNAPSHOT_SNAPSHOT_ASYNC_H_
#include <memory>
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "ui/snapshot/snapshot.h"
namespace gfx {
class Size;
}
namespace ui {
// Helper methods for async snapshots to convert a viz::CopyOutputResult into a
// ui::GrabWindowSnapshot callback.
class SnapshotAsync {
public:
SnapshotAsync() = delete;
SnapshotAsync(const SnapshotAsync&) = delete;
SnapshotAsync& operator=(const SnapshotAsync&) = delete;
static void ScaleCopyOutputResult(
GrabWindowSnapshotAsyncCallback callback,
const gfx::Size& target_size,
std::unique_ptr<viz::CopyOutputResult> result);
static void RunCallbackWithCopyOutputResult(
GrabWindowSnapshotAsyncCallback callback,
std::unique_ptr<viz::CopyOutputResult> result);
};
} // namespace ui
#endif // UI_SNAPSHOT_SNAPSHOT_ASYNC_H_