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 #ifndef _TCUOHOSROSENNATIVEWINDOW_HPP 16 #define _TCUOHOSROSENNATIVEWINDOW_HPP 17 18 #include "egluGLContextFactory.hpp" 19 #include "eglwLibrary.hpp" 20 #include "eglwFunctions.hpp" 21 #include "eglwEnums.hpp" 22 #include "deUniquePtr.hpp" 23 24 #include "display/tcuOhosNativeDisplay.hpp" 25 26 namespace tcu 27 { 28 namespace OHOS_ROSEN 29 { 30 namespace egl 31 { 32 33 using std::string; 34 using de::MovePtr; 35 using de::UniquePtr; 36 using glu::ContextFactory; 37 using eglu::GLContextFactory; 38 using eglu::NativeDisplay; 39 using eglu::NativeDisplayFactory; 40 using eglu::NativeWindow; 41 using eglu::NativeWindowFactory; 42 using eglu::NativePixmap; 43 using eglu::NativePixmapFactory; 44 using eglu::WindowParams; 45 using tcu::TextureLevel; 46 47 class OhosWindow : public NativeWindow 48 { 49 public: 50 static const Capability CAPABILITIES = Capability(CAPABILITY_CREATE_SURFACE_LEGACY | 51 CAPABILITY_CREATE_SURFACE_PLATFORM | 52 CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION | 53 CAPABILITY_GET_SURFACE_SIZE | 54 CAPABILITY_SET_SURFACE_SIZE | 55 CAPABILITY_GET_SCREEN_SIZE); 56 57 OhosWindow (OhosDisplay& display, const WindowParams& params); 58 59 eglw::EGLNativeWindowType getLegacyNative (void); 60 void* getPlatformExtension (void); 61 void* getPlatformNative (void); 62 63 IVec2 getSurfaceSize (void) const; 64 void setSurfaceSize (IVec2 size); getScreenSize(void) const65 IVec2 getScreenSize (void) const { return getSurfaceSize(); } 66 67 }; 68 69 } // egl 70 } // OHOS 71 } // tcu 72 #endif // _TCUOHOSROSENNATIVEWINDOW_HPP