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 #ifndef OHOS_RENDER_3D_TEXTURE_LAYER_H
16 #define OHOS_RENDER_3D_TEXTURE_LAYER_H
17 
18 #include <cstdint>
19 
20 #include <render_service_client/core/ui/rs_node.h>
21 #include "texture_info.h"
22 
23 namespace OHOS::Render3D {
24 
25 class __attribute__((visibility("default"))) TextureLayer {
26 public:
27     explicit TextureLayer(int32_t key);
28     virtual ~TextureLayer();
29 
30     virtual void DestroyRenderTarget();
31     virtual TextureInfo GetTextureInfo();
32 
33     virtual void SetParent(std::shared_ptr<Rosen::RSNode>& parent);
34     virtual TextureInfo OnWindowChange(float offsetX, float offsetY, float width, float height, float scale,
35         bool recreateWindow, SurfaceType surfaceType = SurfaceType::SURFACE_WINDOW);
36     virtual TextureInfo OnWindowChange(const WindowChangeInfo& windowChangeInfo);
37 
38 protected:
39     TextureLayer() = default;
40 
41 private:
42     std::shared_ptr<TextureLayer> textureLayer_;
43 };
44 } // namespace OHOS::Render3D
45 #endif // OHOS_RENDER_3D_TEXTURE_LAYER_H
46