1 /*
2 * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 #include "tcuOhosNativeWindow.hpp"
17 #include "egluGLContextFactory.hpp"
18 #include "eglwLibrary.hpp"
19 #include "eglwFunctions.hpp"
20 #include "eglwEnums.hpp"
21 #include "deUniquePtr.hpp"
22
23 namespace tcu
24 {
25 namespace OHOS_ROSEN
26 {
27 namespace egl
28 {
29
30 using std::string;
31 using de::MovePtr;
32 using de::UniquePtr;
33 using glu::ContextFactory;
34 using eglu::GLContextFactory;
35 using eglu::NativeDisplay;
36 using eglu::NativeDisplayFactory;
37 using eglu::NativeWindow;
38 using eglu::NativeWindowFactory;
39 using eglu::NativePixmap;
40 using eglu::NativePixmapFactory;
41 using eglu::WindowParams;
42 using tcu::TextureLevel;
43
OhosWindow(OhosDisplay & display,const WindowParams & params)44 OhosWindow::OhosWindow (OhosDisplay& display, const WindowParams& params)
45 : NativeWindow (CAPABILITIES)
46 {
47 //TODO: 创建rosen window
48 if (display.getPlatformNative() != nullptr) {
49 printf("OhosWindow params: width=%d, height=%d\n", params.width, params.height);
50 }
51 printf("OhosWindow::OhosWindow\n");
52 }
53
getLegacyNative(void)54 eglw::EGLNativeWindowType OhosWindow::getLegacyNative (void)
55 {
56 //TODO: 创建rosen window
57 printf("OhosWindow::getLegacyNative\n");
58 return nullptr;
59 }
60
getPlatformExtension(void)61 void* OhosWindow::getPlatformExtension (void)
62 {
63 //TODO: 创建rosen window
64 printf("OhosWindow::getPlatformExtension\n");
65 return nullptr;
66 }
67
getPlatformNative(void)68 void* OhosWindow::getPlatformNative (void)
69 {
70 //TODO: 创建rosen window
71 printf("OhosWindow::getPlatformNative\n");
72 return nullptr;
73 }
74
getSurfaceSize(void) const75 IVec2 OhosWindow::getSurfaceSize (void) const
76 {
77 //TODO: 设置surface
78 IVec2 ret;
79 return ret;
80 }
81
setSurfaceSize(IVec2 size)82 void OhosWindow::setSurfaceSize (IVec2 size)
83 {
84 //TODO: 设置size
85 printf("setSurfaceSize IVec2: %d\n", size.x());
86 }
87
88 } // egl
89 } // OHOS
90 } // tcu