• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //Each command HAVE TO have UNIQUE ID in ALL HISTORY
27 //If a command is not used and you want to delete it,
28 //just COMMENT it - and never use this value anymore
29 enum RSFrameRateLinkerCommandType : uint16_t {
30     FRAME_RATE_LINKER_DESTROY = 0,
31     FRAME_RATE_LINKER_UPDATE_RANGE = 1,
32 };
33 
34 class RSB_EXPORT RSFrameRateLinkerCommandHelper {
35 public:
36     static void Destroy(RSContext& context, FrameRateLinkerId id);
37     static void UpdateRange(RSContext& context, FrameRateLinkerId id, FrameRateRange range,
38         int32_t animatorExpectedFrameRate);
39 };
40 
41 ADD_COMMAND(RSFrameRateLinkerDestroy,
42     ARG(PERMISSION_APP, FRAME_RATE_LINKER, FRAME_RATE_LINKER_DESTROY,
43         RSFrameRateLinkerCommandHelper::Destroy, FrameRateLinkerId))
44 ADD_COMMAND(RSFrameRateLinkerUpdateRange,
45     ARG(PERMISSION_APP, FRAME_RATE_LINKER, FRAME_RATE_LINKER_UPDATE_RANGE,
46         RSFrameRateLinkerCommandHelper::UpdateRange, FrameRateLinkerId, FrameRateRange, int32_t))
47 } // namespace Rosen
48 } // namespace OHOS
49 
50 #endif // ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_FRAME_RATE_LINKER_COMMAND_H
51