1 /*
2  * Copyright (c) 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_EXPORT_TEXTURE_INFO_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_EXPORT_TEXTURE_INFO_H
18 
19 #include <optional>
20 #include <string>
21 
22 #include "base/memory/ace_type.h"
23 #include "base/utils/macros.h"
24 #include "core/components/common/layout/constants.h"
25 
26 namespace OHOS::Ace::NG {
27 
28 class ACE_EXPORT ExportTextureInfo : public virtual AceType {
29 public:
30     ExportTextureInfo() = default;
31     ~ExportTextureInfo() override = default;
32 
GetSurfaceId()33     std::string GetSurfaceId() const
34     {
35         return surfaceId_.value_or("");
36     }
37 
SetSurfaceId(const std::string & surfaceId)38     void SetSurfaceId(const std::string& surfaceId)
39     {
40         surfaceId_ = surfaceId;
41     }
42 
GetCurrentRenderType()43     NodeRenderType GetCurrentRenderType() const
44     {
45         return curRenderType_;
46     }
47 
SetCurrentRenderType(NodeRenderType renderType)48     void SetCurrentRenderType(NodeRenderType renderType)
49     {
50         curRenderType_ = renderType;
51     }
52 
53 private:
54     std::optional<std::string> surfaceId_;
55     NodeRenderType curRenderType_ = NodeRenderType::RENDER_TYPE_DISPLAY;
56 };
57 } // namespace OHOS::Ace::NG
58 
59 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_EXPORT_TEXTURE_INFO_H
60