1e0dac50fSopenharmony_ci/*
2e0dac50fSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License.
5e0dac50fSopenharmony_ci * You may obtain a copy of the License at
6e0dac50fSopenharmony_ci *
7e0dac50fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e0dac50fSopenharmony_ci *
9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and
13e0dac50fSopenharmony_ci * limitations under the License.
14e0dac50fSopenharmony_ci */
15e0dac50fSopenharmony_ci
16e0dac50fSopenharmony_ci#ifndef OHOS_ROSEN_SNAPSHOT_CONTROLLER_H
17e0dac50fSopenharmony_ci#define OHOS_ROSEN_SNAPSHOT_CONTROLLER_H
18e0dac50fSopenharmony_ci
19e0dac50fSopenharmony_ci#include <snapshot.h>
20e0dac50fSopenharmony_ci#include <transaction/rs_interfaces.h>
21e0dac50fSopenharmony_ci
22e0dac50fSopenharmony_ci#include "event_handler.h"
23e0dac50fSopenharmony_ci#include "future.h"
24e0dac50fSopenharmony_ci#include "snapshot_stub.h"
25e0dac50fSopenharmony_ci#include "wm_common_inner.h"
26e0dac50fSopenharmony_ci#include "window_root.h"
27e0dac50fSopenharmony_ci#include "window_manager_hilog.h"
28e0dac50fSopenharmony_ci#include "perform_reporter.h"
29e0dac50fSopenharmony_ci
30e0dac50fSopenharmony_cinamespace OHOS {
31e0dac50fSopenharmony_cinamespace Rosen {
32e0dac50fSopenharmony_ciclass SnapshotController : public SnapshotStub {
33e0dac50fSopenharmony_cipublic:
34e0dac50fSopenharmony_ci    SnapshotController(sptr<WindowRoot>& root, std::shared_ptr<AppExecFwk::EventHandler>& handler)
35e0dac50fSopenharmony_ci        : windowRoot_(root), handler_(handler),
36e0dac50fSopenharmony_ci        performReport_(new PerformReporter("GET_SNAPSHOT_TIME", {25, 35, 50, 200})) {};
37e0dac50fSopenharmony_ci    ~SnapshotController() = default;
38e0dac50fSopenharmony_ci    int32_t GetSnapshot(const sptr<IRemoteObject>& token, AAFwk::Snapshot& snapshot) override;
39e0dac50fSopenharmony_ci
40e0dac50fSopenharmony_ciprivate:
41e0dac50fSopenharmony_ci    sptr<WindowRoot> windowRoot_;
42e0dac50fSopenharmony_ci    std::shared_ptr<AppExecFwk::EventHandler> handler_;
43e0dac50fSopenharmony_ci    std::shared_ptr<PerformReporter> performReport_;
44e0dac50fSopenharmony_ci};
45e0dac50fSopenharmony_ci} // Rosen
46e0dac50fSopenharmony_ci} // OHOS
47e0dac50fSopenharmony_ci#endif // OHOS_ROSEN_SNAPSHOT_CONTROLLER_H
48