Merge branch 'devel/master' into tizen
[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) 2016 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    * @return A pointer to a new RenderItem.
49    */
50   static RenderItem* New();
51
52   /**
53    * Non-virtual destructor; RenderItem is not suitable as a base class.
54    */
55   ~RenderItem();
56
57   /**
58    * Overriden delete operator.
59    * Deletes the RenderItem from its global memory pool
60    * @param[in] A pointer to the RenderItem to delete.
61    */
62   void operator delete( void* ptr );
63
64   Matrix            mModelMatrix;
65   Matrix            mModelViewMatrix;
66   Vector3           mSize;
67   Render::Renderer* mRenderer;
68   Node*             mNode;
69   const void*       mTextureSet;        //< Used for sorting only
70   int               mDepthIndex;
71   bool              mIsOpaque:1;
72
73 private:
74
75   /**
76    * Private constructor. See RenderItem::New
77    */
78   RenderItem();
79
80   // RenderItems should not be copied as they are heavy
81   RenderItem( const RenderItem& item );
82   RenderItem& operator = ( const RenderItem& item );
83
84 };
85
86 } // namespace SceneGraph
87
88 } // namespace Internal
89
90 } // namespace Dali
91
92 #endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H