608679c266e237cb9b6e6826cc70e13b9d9b3924
[platform/core/uifw/dali-adaptor.git] / adaptors / base / separate-update-render / render-request.h
1 #ifndef __DALI_INTERNAL_RENDER_REQUEST_H__
2 #define __DALI_INTERNAL_RENDER_REQUEST_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
23 // INTERNAL INCLUDES
24 #include <egl-interface.h>
25 #include <render-surface.h> // needed for Dali::RenderSurface
26
27 namespace Dali
28 {
29
30 class RenderSurface;
31 class DisplayConnection;
32
33 namespace Internal
34 {
35 namespace Adaptor
36 {
37
38 class RenderRequest
39 {
40 public:
41   enum Request
42   {
43     REPLACE_SURFACE, // Request to replace surface
44   };
45
46   /**
47    * Constructor.
48    * @param[in] type The type of the request
49    */
50   RenderRequest( Request type );
51
52   /**
53    * @return the type of the request
54    */
55   Request GetType();
56
57 private:
58   Request mRequestType;
59 };
60
61 class ReplaceSurfaceRequest : public RenderRequest
62 {
63 public:
64
65   /**
66    * Constructor
67    */
68   ReplaceSurfaceRequest();
69
70   /**
71    * Set the new surface
72    * @param[in] newSurface The new surface to use
73    */
74   void SetSurface(RenderSurface* newSurface);
75
76   /**
77    * @return the new surface
78    */
79   RenderSurface* GetSurface();
80
81   /**
82    * Called when the request has been completed to set the result.
83    */
84   void ReplaceCompleted();
85
86   /**
87    * @return true if the replace has completed.
88    */
89   bool GetReplaceCompleted();
90
91 private:
92   RenderSurface* mNewSurface;     ///< The new surface to use.
93   unsigned int mReplaceCompleted; ///< Set to true when the replace has completed.
94 };
95
96 } // namespace Adaptor
97
98 } // namespace Internal
99
100 } // namespace Dali
101
102 #endif // __DALI_INTERNAL_RENDER_REQUEST_H__