• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
createCTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize,glu::ApiType type)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 
createES2CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)49 JNIEXPORT void JNICALL createES2CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
50 {
51 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(2, 0));
52 }
53 
createES3CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)54 JNIEXPORT void JNICALL createES3CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
55 {
56 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 0));
57 }
58 
createES31CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)59 JNIEXPORT void JNICALL createES31CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
60 {
61 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 1));
62 }
63 
createES32CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)64 JNIEXPORT void JNICALL createES32CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
65 {
66 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::es(3, 2));
67 }
68 
createGL45CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)69 JNIEXPORT void JNICALL createGL45CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
70 {
71 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::core(4, 5));
72 }
73 
createGL46CTSActivity(ANativeActivity * activity,void * savedState,size_t savedStateSize)74 JNIEXPORT void JNICALL createGL46CTSActivity(ANativeActivity* activity, void* savedState, size_t savedStateSize)
75 {
76 	createCTSActivity(activity, savedState, savedStateSize, glu::ApiType::core(4, 6));
77 }
78 DE_END_EXTERN_C
79