Merge branch 'devel/master' into sandbox/dkdk/tizen
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / adaptor-framework / thread-synchronization-interface.h
1 #ifndef DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H
2 #define DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H
3
4 /*
5  * Copyright (c) 2020 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 namespace Dali
22 {
23 /**
24  * @brief Interface for the ThreadSyncrhonization handler.
25  *
26  * This handler ensure the threads are synchronized properly.
27  */
28 class ThreadSynchronizationInterface
29 {
30 public:
31   /////////////////////////////////////////////////////////////////////////////////////////////////
32   // Called by the Event Thread if post-rendering is required
33   /////////////////////////////////////////////////////////////////////////////////////////////////
34
35   /**
36    * @brief Surface informs that the post-render has been completed.
37    *
38    * @note Should only be called by the Event Thread if post-rendering is required.
39    */
40   virtual void PostRenderComplete() = 0;
41
42   /////////////////////////////////////////////////////////////////////////////////////////////////
43   // Called by the Render Thread if post-rendering is required
44   /////////////////////////////////////////////////////////////////////////////////////////////////
45
46   /**
47    * @brief Called just before the post rendering is done by the surface.
48    *
49    * @note Should only be called by the Render Thread if post-rendering is required.
50    */
51   virtual void PostRenderStarted() = 0;
52
53   /**
54    * @brief Blocks the render thread until the post rendering has been completed by the surface.
55    *
56    * @note Should only be called by the Render Thread if post-rendering is required.
57    */
58   virtual void PostRenderWaitForCompletion() = 0;
59
60 protected:
61   /**
62    * @brief Protected constructor, no creation through this interface
63    */
64   ThreadSynchronizationInterface()
65   {
66   }
67
68   /**
69    * Virtual protected destructor, no deletion through this interface
70    */
71   virtual ~ThreadSynchronizationInterface()
72   {
73   }
74
75 private:
76   // Undefined copy constructor.
77   ThreadSynchronizationInterface(const ThreadSynchronizationInterface&);
78
79   // Undefined assignment operator.
80   ThreadSynchronizationInterface& operator=(const ThreadSynchronizationInterface&);
81 };
82
83 } // namespace Dali
84
85 #endif // DALI_INTEGRATION_THREAD_SYNCHRONIZATION_INTERFACE_H