Merge "RenderItem clean-up" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-item.h
1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__
3
4 /*
5  * Copyright (c) 2014 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 // INTERNAL INCLUDES
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/actors/layer.h>
24 #include <dali/public-api/math/matrix.h>
25 #include <dali/internal/update/nodes/node.h>
26
27 namespace Dali
28 {
29
30 namespace Internal
31 {
32
33 namespace Render
34 {
35 class Renderer;
36 }
37
38 namespace SceneGraph
39 {
40
41 /**
42  * A RenderItem contains all the data needed for rendering
43  */
44 struct RenderItem
45 {
46   /**
47    * Construct a new RenderItem
48    */
49   static RenderItem* New();
50
51   /**
52    * Non-virtual destructor; RenderItem is not suitable as a base class.
53    */
54   ~RenderItem();
55
56   /**
57    * Overriden delete operator.
58    * Deletes the RenderItem from its global memory pool
59    */
60   void operator delete( void* ptr );
61
62
63   Matrix            mModelMatrix;
64   Matrix            mModelViewMatrix;
65   Vector3           mSize;
66   Render::Renderer* mRenderer;
67   Node*             mNode;
68   int               mDepthIndex;
69   bool              mIsOpaque:1;
70
71 private:
72
73   /**
74    * Private constructor. See RenderItem::New
75    */
76   RenderItem();
77
78   // RenderItems should not be copied as they are heavy
79   RenderItem( const RenderItem& item );
80   RenderItem& operator = ( const RenderItem& item );
81 };
82
83 } // namespace SceneGraph
84
85 } // namespace Internal
86
87 } // namespace Dali
88
89 #endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__