Fix issues in pipeline.timestamp.transfer_tests am: 0f672f2a20 am: 9e85a126d2
[platform/upstream/VK-GL-CTS.git] / external / openglcts / modules / runner / glcAndroidMain.cpp
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2016 Google Inc.
6  * Copyright (c) 2016 The Khronos Group Inc.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */ /*!
21  * \file
22  * \brief CTS Android entry points.
23  */ /*-------------------------------------------------------------------*/
24
25 #include "glcAndroidTestActivity.hpp"
26
27 #if (DE_OS != DE_OS_ANDROID)
28 #error "Invalid OS"
29 #elif (DE_ANDROID_API < 9)
30 #error "CTS runner requires API level 9 or greater"
31 #endif
32
33 static void createCTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize, glu::ApiType type)
34 {
35         DE_UNREF(savedState && savedStateSize);
36         try
37         {
38                 glcts::Android::TestActivity* obj = new glcts::Android::TestActivity(activity, type);
39                 DE_UNREF(obj);
40         }
41         catch (const std::exception& e)
42         {
43                 tcu::die("Failed to create activity: %s", e.what());
44         }
45 }
46
47 DE_BEGIN_EXTERN_C
48
49 void createES2CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
50 {
51         createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(2, 0));
52 }
53
54 void createES3CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
55 {
56         createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 0));
57 }
58
59 void createES31CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
60 {
61         createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 1));
62 }
63
64 void createES32CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
65 {
66         createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 2));
67 }
68
69 void createGL45CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
70 {
71         createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::core(4, 5));
72 }
73
74 DE_END_EXTERN_C