Dali 3D User Interface Engine
render-thread.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_RENDER_THREAD_H__
2 #define __DALI_INTERNAL_RENDER_THREAD_H__
3 
4 /*
5  * Copyright (c) 2015 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 <pthread.h>
23 
24 // INTERNAL INCLUDES
25 #include <base/render-helper.h>
27 #include <egl-interface.h>
28 #include <render-surface.h> // needed for Dali::RenderSurface
29 
30 namespace Dali
31 {
32 
33 class RenderSurface;
34 
35 namespace Integration
36 {
37 class Core;
38 }
39 
40 namespace Internal
41 {
42 namespace Adaptor
43 {
44 
45 class AdaptorInternalServices;
46 class ThreadSynchronization;
47 class EnvironmentOptions;
48 
53 {
54 public:
55 
63  AdaptorInternalServices& adaptorInterfaces,
64  const EnvironmentOptions& environmentOptions );
65 
69  ~RenderThread();
70 
71 public:
72 
76  void Start();
77 
81  void Stop();
82 
83 private: // Render thread side helpers
84 
90  bool Run();
91 
96  void ProcessRequest( RenderRequest* request );
97 
102  static inline void* InternalThreadEntryFunc( void* This )
103  {
104  ( static_cast<RenderThread*>( This ) )->Run();
105  return NULL;
106  }
107 
108 private:
109 
110  // Undefined
111  RenderThread( const RenderThread& renderThread );
112 
113  // Undefined
114  RenderThread& operator=( const RenderThread& renderThread );
115 
116 private: // Data
117 
120  pthread_t* mThread;
123 };
124 
125 } // namespace Adaptor
126 
127 } // namespace Internal
128 
129 } // namespace Dali
130 
131 #endif // __DALI_INTERNAL_RENDER_THREAD_H__
Dali Docs Home
Read more about Dali