• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_CANVAS_NODE_COMMAND_H
17 #define ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_CANVAS_NODE_COMMAND_H
18 
19 #include "rs_command_templates.h"
20 
21 namespace OHOS {
22 namespace Rosen {
23 
24 enum RSCanvasNodeCommandType : uint16_t {
25     CANVAS_NODE_CREATE,
26     CANVAS_NODE_UPDATE_RECORDING,
27 };
28 
29 class DrawCmdList;
30 
31 class RSCanvasNodeCommandHelper {
32 public:
33     static void Create(RSContext& context, NodeId id);
34     static void UpdateRecording(
35         RSContext& context, NodeId id, std::shared_ptr<DrawCmdList> drawCmds, bool drawContentLast);
36 };
37 
38 ADD_COMMAND(RSCanvasNodeCreate, ARG(CANVAS_NODE, CANVAS_NODE_CREATE, RSCanvasNodeCommandHelper::Create, NodeId))
39 ADD_COMMAND(RSCanvasNodeUpdateRecording,
40     ARG(CANVAS_NODE, CANVAS_NODE_UPDATE_RECORDING, RSCanvasNodeCommandHelper::UpdateRecording, NodeId,
41         std::shared_ptr<DrawCmdList>, bool))
42 
43 } // namespace Rosen
44 } // namespace OHOS
45 
46 #endif // ROSEN_RENDER_SERVICE_BASE_COMMAND_RS_CANVAS_NODE_COMMAND_H
47