Dali 3D User Interface Engine
test-gl-sync-abstraction.h
Go to the documentation of this file.
1 #ifndef __TEST_GL_SYNC_ABSTRACTION_H__
2 #define __TEST_GL_SYNC_ABSTRACTION_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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 // EXTERNAL INCLUDES
22 #include <sstream>
23 #include <string>
24 #include <map>
25 
26 // INTERNAL INCLUDES
29 #include "test-trace-call-stack.h"
30 
31 namespace Dali
32 {
33 
34 class DALI_IMPORT_API TestSyncObject : public Integration::GlSyncAbstraction::SyncObject
35 {
36 public:
37  TestSyncObject(TraceCallStack& trace);
38  ~TestSyncObject();
39  bool IsSynced();
40  bool synced;
41  TraceCallStack& mTrace;
42 };
43 
47 class DALI_IMPORT_API TestGlSyncAbstraction: public Integration::GlSyncAbstraction
48 {
49 public:
53  TestGlSyncAbstraction();
54 
58  ~TestGlSyncAbstraction();
59 
63  void Initialize();
64 
69  virtual Integration::GlSyncAbstraction::SyncObject* CreateSyncObject( );
70 
75  virtual void DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject );
76 
77 
78 public: // TEST FUNCTIONS
79  Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject( );
80 
86  void SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync );
87 
91  void EnableTrace(bool enable);
92 
96  void ResetTrace();
97 
101  TraceCallStack& GetTrace();
102 
108  int GetNumberOfSyncObjects();
109 
110 private:
111  typedef std::vector<TestSyncObject*> SyncContainer;
112  typedef SyncContainer::iterator SyncIter;
113  SyncContainer mSyncObjects;
114  TraceCallStack mTrace;
115 };
116 
117 } // Dali
118 
119 #endif // __TEST_GL_SYNC_ABSTRACTION_H__
Dali Docs Home
Read more about Dali