1 #ifndef __TEST_GL_SYNC_ABSTRACTION_H__
2 #define __TEST_GL_SYNC_ABSTRACTION_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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
11 // http://floralicense.org/license/
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.
26 #include <dali/dali.h>
27 #include <dali/integration-api/core.h>
28 #include <dali/integration-api/gl-sync-abstraction.h>
29 #include "test-trace-call-stack.h"
34 class DALI_IMPORT_API TestSyncObject : public Integration::GlSyncAbstraction::SyncObject
37 TestSyncObject(TraceCallStack& trace);
41 TraceCallStack& mTrace;
45 * Class to emulate the GL sync functions with tracing
47 class DALI_IMPORT_API TestGlSyncAbstraction: public Integration::GlSyncAbstraction
53 TestGlSyncAbstraction();
58 ~TestGlSyncAbstraction();
61 * Initialize the sync objects - clear down the map
66 * Create a sync object
67 * @return the sync object
69 virtual Integration::GlSyncAbstraction::SyncObject* CreateSyncObject( );
72 * Destroy a sync object
73 * @param[in] syncObject The object to destroy
75 virtual void DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject );
78 public: // TEST FUNCTIONS
79 Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject( );
82 * Test method to trigger the object sync behaviour.
84 * @param[in] sync The sync value to set
86 void SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync );
91 void EnableTrace(bool enable);
94 * Reset the trace callstack
99 * Get the trace object (allows test case to find methods on it)
101 TraceCallStack& GetTrace();
104 typedef std::vector<TestSyncObject*> SyncContainer;
105 typedef SyncContainer::iterator SyncIter;
106 SyncContainer mSyncObjects; ///< The sync objects
107 TraceCallStack mTrace; ///< the trace call stack for testing
112 #endif // __TEST_GL_SYNC_ABSTRACTION_H__