• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _GLCANDROIDTESTACTIVITY_HPP
2 #define _GLCANDROIDTESTACTIVITY_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2016 Google Inc.
8  * Copyright (c) 2016 The Khronos Group Inc.
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */ /*!
23  * \file
24  * \brief CTS Android Activity.
25  */ /*-------------------------------------------------------------------*/
26 
27 #include "glcTestRunner.hpp"
28 #include "gluRenderContext.hpp"
29 #include "tcuAndroidAssets.hpp"
30 #include "tcuAndroidPlatform.hpp"
31 #include "tcuAndroidRenderActivity.hpp"
32 #include "tcuCommandLine.hpp"
33 #include "tcuDefs.hpp"
34 #include "tcuTestLog.hpp"
35 
36 namespace glcts
37 {
38 namespace Android
39 {
40 
41 class TestThread : public tcu::Android::RenderThread
42 {
43 public:
44 	TestThread(tcu::Android::NativeActivity& nativeActivity, tcu::Android::AssetArchive& archive,
45 			   const std::string& waiverPath, const std::string& logPath, glu::ApiType runType, deUint32 runFlags);
46 	~TestThread(void);
47 
48 	void run(void);
49 
50 protected:
51 	virtual void onWindowCreated(ANativeWindow* window);
52 	virtual void onWindowResized(ANativeWindow* window);
53 	virtual void onWindowDestroyed(ANativeWindow* window);
54 	virtual bool render(void);
55 
56 	tcu::Android::Platform		m_platform;
57 	tcu::Android::AssetArchive& m_archive;
58 	TestRunner					m_app;
59 	bool						m_finished; //!< Is execution finished.
60 };
61 
62 class TestActivity : public tcu::Android::RenderActivity
63 {
64 public:
65 	TestActivity(ANativeActivity* nativeActivity, glu::ApiType runType);
66 	~TestActivity(void);
67 
68 	virtual void onStart(void);
69 	virtual void onDestroy(void);
70 	virtual void onConfigurationChanged(void);
71 
72 private:
73 	tcu::Android::AssetArchive m_archive;
74 	tcu::CommandLine		   m_cmdLine;
75 	TestThread				   m_testThread;
76 	bool					   m_started;
77 };
78 
79 } // Android
80 } // glcts
81 
82 #endif // _GLCANDROIDTESTACTIVITY_HPP
83