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_DISPLAY_NODE_COMMAND_H 17 #define ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_DISPLAY_NODE_COMMAND_H 18 19 #include "command/rs_command_templates.h" 20 #include "screen_manager/screen_types.h" 21 #include "common/rs_macros.h" 22 23 namespace OHOS { 24 namespace Rosen { 25 26 enum RSDisplayNodeCommandType : uint16_t { 27 DISPLAY_NODE_CREATE, 28 DISPLAY_NODE_SET_SCREEN_ID, 29 DISPLAY_NODE_SET_DISPLAY_OFFSET, 30 DISPLAY_NODE_SET_SECURITY_DISPLAY, 31 DISPLAY_NODE_SET_DISPLAY_MODE, 32 DISPLAY_NODE_SET_SCREEN_ROTATION, 33 DISPLAY_NODE_SET_BOOT_ANIMATION, 34 DISPLAY_NODE_SET_ROG_SIZE, 35 }; 36 37 class RSB_EXPORT DisplayNodeCommandHelper { 38 public: 39 static void Create(RSContext&, NodeId, const RSDisplayNodeConfig&); 40 static void SetScreenId(RSContext&, NodeId, uint64_t); 41 static void SetDisplayOffset(RSContext&, NodeId, int32_t, int32_t); 42 static void SetSecurityDisplay(RSContext&, NodeId, bool); 43 static void SetDisplayMode(RSContext&, NodeId, const RSDisplayNodeConfig&); 44 static void SetScreenRotation(RSContext&, NodeId, const ScreenRotation&); 45 static void SetBootAnimation(RSContext& context, NodeId nodeId, bool isBootAnimation); 46 static void SetRogSize(RSContext&, NodeId, uint32_t, uint32_t); 47 }; 48 49 ADD_COMMAND(RSDisplayNodeCreate, 50 ARG(DISPLAY_NODE, DISPLAY_NODE_CREATE, DisplayNodeCommandHelper::Create, NodeId, RSDisplayNodeConfig)) 51 ADD_COMMAND(RSDisplayNodeSetScreenId, 52 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_SCREEN_ID, DisplayNodeCommandHelper::SetScreenId, NodeId, uint64_t)) 53 ADD_COMMAND(RSDisplayNodeSetDisplayOffset, 54 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_DISPLAY_OFFSET, DisplayNodeCommandHelper::SetDisplayOffset, NodeId, 55 int32_t, int32_t)) 56 ADD_COMMAND(RSDisplayNodeSetSecurityDisplay, 57 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_SECURITY_DISPLAY, DisplayNodeCommandHelper::SetSecurityDisplay, NodeId, bool)) 58 ADD_COMMAND(RSDisplayNodeSetDisplayMode, 59 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_DISPLAY_MODE, DisplayNodeCommandHelper::SetDisplayMode, NodeId, 60 RSDisplayNodeConfig)) 61 ADD_COMMAND(RSDisplayNodeSetScreenRotation, 62 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_SCREEN_ROTATION, DisplayNodeCommandHelper::SetScreenRotation, NodeId, 63 ScreenRotation)) 64 ADD_COMMAND(RSDisplayNodeSetBootAnimation, 65 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_BOOT_ANIMATION, DisplayNodeCommandHelper::SetBootAnimation, 66 NodeId, bool)) 67 ADD_COMMAND(RSDisplayNodeSetRogSize, 68 ARG(DISPLAY_NODE, DISPLAY_NODE_SET_ROG_SIZE, DisplayNodeCommandHelper::SetRogSize, 69 NodeId, uint32_t, uint32_t)) 70 } // namespace Rosen 71 } // namespace OHOS 72 73 #endif // ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_DISPLAY_NODE_COMMAND_H 74