lin
2025-08-14 dae8bad597b6607a449b32bf76c523423f7720ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef _TCUPLATFORM_HPP
#define _TCUPLATFORM_HPP
/*-------------------------------------------------------------------------
 * drawElements Quality Program Tester Core
 * ----------------------------------------
 *
 * Copyright 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief Platform (OS) specific services.
 *//*--------------------------------------------------------------------*/
 
#include "tcuDefs.hpp"
 
namespace glu
{
class Platform;
}
 
namespace eglu
{
class Platform;
}
 
namespace vk
{
class Platform;
}
 
namespace tcu
{
 
class CommandLine;
class FunctionLibrary;
 
/*--------------------------------------------------------------------*//*!
 * \brief Base class for platform implementation.
 *
 * This class represents the minimum set of functionality for a platform
 * port.
 *
 * In addition to implementing Platform class, main entry point must be
 * created that takes care of parsing command line, creating log and
 * executing tcu::App. See tcuMain.cpp for reference on implementing
 * application stub.
 *
 * If the platform uses standard posix-style main() for application entry
 * point, tcuMain.cpp can be used as is. In that case you only have to
 * implement createPlatform().
 *
 * API-specific platform interfaces (glu::Platform and eglu::Platform)
 * can be provided by implementing get<API>Platform() functions.
 *//*--------------------------------------------------------------------*/
class Platform
{
public:
                                   Platform            (void);
   virtual                            ~Platform            (void);
 
   /*--------------------------------------------------------------------*//*!
    * \brief Process platform-specific events.
    *
    * Test framework will call this function between test cases and test case
    * iterations. Any event handling that must be done periodically should be
    * done here.
    *
    * Test framework will decide whether to continue test execution based on
    * return code. For instance if the application receives close event from OS,
    * it should communicate that to framework by returning false.
    *
    * \note Do not do rendering buffer swaps here.
    *       Do it in RenderContext::postIterate() instead.
    * \return true if test execution should continue, false otherwise.
    *//*--------------------------------------------------------------------*/
   virtual bool                    processEvents        (void);
 
   /*--------------------------------------------------------------------*//*!
    * \brief Get GL platform interface
    *
    * GL-specific platform interface is defined by glu::Platform. If your
    * platform port supports OpenGL (ES), you should implement this function.
    *
    * Default implementation throws tcu::NotSupportedError exception.
    *
    * \return Reference to GL platform interface.
    *//*--------------------------------------------------------------------*/
   virtual const glu::Platform&    getGLPlatform        (void) const;
 
   /*--------------------------------------------------------------------*//*!
    * \brief Get EGL platform interface
    *
    * EGL-specific platform interface is defined by eglu::Platform. If your
    * platform port supports EGL, you should implement this function.
    *
    * Default implementation throws tcu::NotSupportedError exception.
    *
    * \return Reference to EGL platform interface.
    *//*--------------------------------------------------------------------*/
   virtual const eglu::Platform&    getEGLPlatform        (void) const;
 
   virtual const vk::Platform&        getVulkanPlatform    (void) const;
};
 
} // tcu
 
#endif // _TCUPLATFORM_HPP