Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/src/tests/deqp_support/tcuANGLEPlatform.h
1693 views
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_PLATFORM_H_
22
#define TCU_ANGLE_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,
42
uint32_t preRotation,
43
bool enableDirectSPIRVGen);
44
~ANGLEPlatform();
45
46
bool processEvents() override;
47
48
const glu::Platform &getGLPlatform() const override
49
{
50
return static_cast<const glu::Platform &>(*this);
51
}
52
const eglu::Platform &getEGLPlatform() const override
53
{
54
return static_cast<const eglu::Platform &>(*this);
55
}
56
57
private:
58
// Note: -1 represents EGL_DONT_CARE, but we don't have the EGL headers here.
59
std::vector<eglw::EGLAttrib> initAttribs(eglw::EGLAttrib type,
60
eglw::EGLAttrib deviceType = -1,
61
eglw::EGLAttrib majorVersion = -1,
62
eglw::EGLAttrib minorVersion = -1);
63
64
EventState mEvents;
65
angle::PlatformMethods mPlatformMethods;
66
std::vector<const char *> mEnableFeatureOverrides;
67
};
68
69
} // namespace tcu
70
71
tcu::Platform *CreateANGLEPlatform(angle::LogErrorFunc logErrorFunc,
72
uint32_t preRotation,
73
bool enableDirectSPIRVGen);
74
75
#endif // TCU_ANGLE_PLATFORM_H_
76
77