• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program Tester Core
3  * ----------------------------------------
4  *
5  * Copyright 2014 The Android Open Source Project
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 #ifndef TCU_ANGLE_WIN32_PLATFORM_H_
22 #define TCU_ANGLE_WIN32_PLATFORM_H_
23 
24 #include "gluPlatform.hpp"
25 #include "tcuDefs.hpp"
26 #include "tcuPlatform.hpp"
27 
28 #ifndef _EGLUPLATFORM_HPP
29 #    include "egluPlatform.hpp"
30 #endif
31 
32 #include "platform/PlatformMethods.h"
33 #include "tcuANGLENativeDisplayFactory.h"
34 
35 namespace tcu
36 {
37 
38 class ANGLEPlatform : public tcu::Platform, private glu::Platform, private eglu::Platform
39 {
40   public:
41     ANGLEPlatform(angle::LogErrorFunc logErrorFunc, uint32_t preRotation);
42     ~ANGLEPlatform();
43 
44     bool processEvents() override;
45 
getGLPlatform()46     const glu::Platform &getGLPlatform() const override
47     {
48         return static_cast<const glu::Platform &>(*this);
49     }
getEGLPlatform()50     const eglu::Platform &getEGLPlatform() const override
51     {
52         return static_cast<const eglu::Platform &>(*this);
53     }
54 
55   private:
56     // Note: -1 represents EGL_DONT_CARE, but we don't have the EGL headers here.
57     std::vector<eglw::EGLAttrib> initAttribs(eglw::EGLAttrib type,
58                                              eglw::EGLAttrib deviceType   = -1,
59                                              eglw::EGLAttrib majorVersion = -1,
60                                              eglw::EGLAttrib minorVersion = -1);
61 
62     EventState mEvents;
63     angle::PlatformMethods mPlatformMethods;
64     std::vector<const char *> mEnableFeatureOverrides;
65 };
66 
67 }  // namespace tcu
68 
69 #endif  // TCU_ANGLE_WIN32_PLATFORM_H_
70