Remove RenderSurface from Core
[platform/core/uifw/dali-core.git] / dali / internal / update / common / scene-graph-scene.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_SCENE_H
2 #define DALI_INTERNAL_SCENE_GRAPH_SCENE_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 // INTERNAL INCLUDES
21 #include <dali/integration-api/scene.h>
22 #include <dali/integration-api/gl-defines.h>
23 #include <dali/internal/render/gl-resources/context.h>
24 #include <dali/internal/render/common/render-instruction-container.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 class Context;
33
34 namespace SceneGraph
35 {
36 class RenderInstructionContainer;
37
38 class Scene
39 {
40 public:
41
42   /**
43    * Constructor
44    * @param[in] surface The render surface
45    */
46   Scene();
47
48   /**
49    * Destructor
50    */
51   virtual ~Scene();
52
53   /**
54    * Creates a scene object in the GPU.
55    * @param[in] context The GL context
56    */
57   void Initialize( Context& context );
58
59   /**
60    * Called by RenderManager to inform the scene that the context has been destroyed
61    */
62   void GlContextDestroyed();
63
64   /**
65    * Gets the context holding the GL state of rendering for the scene
66    * @return the context
67    */
68   Context* GetContext();
69
70   /**
71    * Gets the render instructions for the scene
72    * @return the render instructions
73    */
74   RenderInstructionContainer& GetRenderInstructions();
75
76 private:
77
78   Context*                    mContext;   ///< The context holding the GL state of rendering for the scene
79
80   // Render instructions describe what should be rendered during RenderManager::RenderScene()
81   // Update manager updates instructions for the next frame while we render the current one
82
83   RenderInstructionContainer  mInstructions;   ///< Render instructions for the scene
84 };
85
86
87 } // namespace SceneGraph
88
89 } // namespace Internal
90
91 } // namespace Dali
92
93
94 #endif // DALI_INTERNAL_SCENE_GRAPH_SCENE_H