1 #ifndef __DALI_INTERNAL_RENDER_RENDER_TRACKER_H
2 #define __DALI_INTERNAL_RENDER_RENDER_TRACKER_H
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/integration-api/gl-sync-abstraction.h>
22 #include <dali/internal/common/message.h>
34 * This class is used to communicate with Fence Sync objects, keeping access solely in
35 * the RenderThread to avoid having mutual exclusion locks or messages back to the UpdateThread.
51 * Creates a sync object for this tracker. Will delete any existing sync object.
53 void CreateSyncObject( Integration::GlSyncAbstraction& glSyncAbstraction );
56 * Check the GL Sync objects. This is called from Render Thread.
57 * If the GlSyncObject has been triggered, then atomically set the sync trigger
59 void PollSyncObject();
62 * Check the sync trigger. This is called from Update Thread, so atomically reads the sync trigger
63 * It clears the sync trigger if it was set.
64 * @return true if the tracker has been synced
69 * Atomically reset the sync trigger. This may be called from any thread
74 * Atomically sets the sync trigger. This may be called from any thread
80 Integration::GlSyncAbstraction* mGlSyncAbstraction; // The sync abstraction
81 Integration::GlSyncAbstraction::SyncObject* mSyncObject; // Associated sync object
82 volatile std::atomic<int> mSyncTrigger; // Trigger that update thread can read
93 #endif // __DALI_INTERNAL_RENDER_RENDER_TRACKER_H