1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_FRAME_RATE_LINKER_COMMAND_H
17 #define ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_FRAME_RATE_LINKER_COMMAND_H
18 
19 #include "animation/rs_frame_rate_range.h"
20 #include "command/rs_command_templates.h"
21 #include "common/rs_macros.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 
26 enum RSFrameRateLinkerCommandType : uint16_t {
27     FRAME_RATE_LINKER_DESTROY,
28     FRAME_RATE_LINKER_UPDATE_RANGE,
29 };
30 
31 class RSB_EXPORT RSFrameRateLinkerCommandHelper {
32 public:
33     static void Destroy(RSContext& context, FrameRateLinkerId id);
34     static void UpdateRange(RSContext& context, FrameRateLinkerId id, FrameRateRange range,
35         int32_t animatorExpectedFrameRate);
36 };
37 
38 ADD_COMMAND(RSFrameRateLinkerDestroy,
39     ARG(FRAME_RATE_LINKER, FRAME_RATE_LINKER_DESTROY, RSFrameRateLinkerCommandHelper::Destroy, FrameRateLinkerId))
40 ADD_COMMAND(RSFrameRateLinkerUpdateRange,
41     ARG(FRAME_RATE_LINKER, FRAME_RATE_LINKER_UPDATE_RANGE, RSFrameRateLinkerCommandHelper::UpdateRange,
42         FrameRateLinkerId, FrameRateRange, int32_t))
43 } // namespace Rosen
44 } // namespace OHOS
45 
46 #endif // ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_FRAME_RATE_LINKER_COMMAND_H
47