• 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 #ifndef RENDER_SERVICE_CLIENT_CORE_UI_RS_DISPLAY_NODE_H
16 #define RENDER_SERVICE_CLIENT_CORE_UI_RS_DISPLAY_NODE_H
17 
18 #include "ui/rs_base_node.h"
19 
20 class SkCanvas;
21 namespace OHOS {
22 namespace Rosen {
23 
24 class RS_EXPORT RSDisplayNode : public RSBaseNode {
25 public:
26     using WeakPtr = std::weak_ptr<RSDisplayNode>;
27     using SharedPtr = std::shared_ptr<RSDisplayNode>;
28     static inline constexpr RSUINodeType Type = RSUINodeType::DISPLAY_NODE;
29 
30     virtual ~RSDisplayNode();
31 
32     static SharedPtr Create(const RSDisplayNodeConfig& displayNodeConfig);
33 
34     void SetScreenId(uint64_t screenId);
35 
36     void SetSecurityDisplay(bool isSecurityDisplay);
37 
38     bool GetSecurityDisplay() const;
39 
GetType()40     RSUINodeType GetType() const override
41     {
42         return RSUINodeType::DISPLAY_NODE;
43     }
44 
45 protected:
46     explicit RSDisplayNode(const RSDisplayNodeConfig& config);
47     RSDisplayNode(const RSDisplayNode&) = delete;
48     RSDisplayNode(const RSDisplayNode&&) = delete;
49     RSDisplayNode& operator=(const RSDisplayNode&) = delete;
50     RSDisplayNode& operator=(const RSDisplayNode&&) = delete;
51 
52 private:
53     uint64_t screenId_;
54     bool isSecurityDisplay_ = false;
55 };
56 } // namespace Rosen
57 } // namespace OHOS
58 
59 #endif // RENDER_SERVICE_CLIENT_CORE_UI_RS_DISPLAY_NODE_H
60