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 #ifndef RENDER_SERVICE_CLIENT_CORE_UI_RS_SURFACE_CONVERTER_H
16 #define RENDER_SERVICE_CLIENT_CORE_UI_RS_SURFACE_CONVERTER_H
17 
18 #ifdef NEW_RENDER_CONTEXT
19 #include "render_backend/rs_render_surface.h"
20 #else
21 #include "platform/drawing/rs_surface.h"
22 #endif
23 #include "surface.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 
28 class RSB_EXPORT RSSurfaceConverter {
29 public:
30 #ifdef NEW_RENDER_CONTEXT
31     static RSB_EXPORT sptr<Surface> ConvertToOhosSurface(std::shared_ptr<RSRenderSurface> surface);
32 #else
33     static RSB_EXPORT sptr<Surface> ConvertToOhosSurface(std::shared_ptr<RSSurface> surface);
34 #endif
35 };
36 } // namespace Rosen
37 } // namespace OHOS
38 
39 #endif // RENDER_SERVICE_CLIENT_CORE_UI_RS_SURFACE_CONVERTER_H