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 #ifndef _TCUOHOSPLATFORM_HPP 17 #define _TCUOHOSPLATFORM_HPP 18 19 #include "tcuPlatform.hpp" 20 #include "gluPlatform.hpp" 21 #include "egluPlatform.hpp" 22 #include "vkPlatform.hpp" 23 #include "vkWsiPlatform.hpp" 24 25 namespace tcu 26 { 27 namespace OHOS_ROSEN 28 { 29 class OhosPlatform : public tcu::Platform, private eglu::Platform, private glu::Platform, private vk::Platform 30 { 31 public: 32 OhosPlatform (void); ~OhosPlatform(void)33 virtual ~OhosPlatform (void) {}; getGLPlatform(void) const34 const glu::Platform& getGLPlatform (void) const { return static_cast<const glu::Platform&>(*this); } getEGLPlatform(void) const35 const eglu::Platform& getEGLPlatform (void) const { return static_cast<const eglu::Platform&>(*this); } getVulkanPlatform(void) const36 const vk::Platform& getVulkanPlatform (void) const { return static_cast<const vk::Platform&>(*this); } 37 38 vk::wsi::Display* createWsiDisplay (vk::wsi::Type wsiType) const; 39 vk::Library* createLibrary (LibraryType libraryType = LIBRARY_TYPE_VULKAN, const char* libraryPath = DE_NULL) const; 40 bool hasDisplay (vk::wsi::Type wsiType) const; 41 void describePlatform (std::ostream& dst) const; 42 void getMemoryLimits (tcu::PlatformMemoryLimits& limits) const; 43 private: 44 }; 45 46 } 47 } 48 49 tcu::Platform* createOhosPlatform (void); 50 #endif // _TCUOHOSPLATFORM_HPP 51