Fix thread contention issues in messages and pan gestures.
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-debug.h
1 #ifndef __DALI_INTERNAL_RENDER_DEBUG_H__
2 #define __DALI_INTERNAL_RENDER_DEBUG_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/internal/common/buffer-index.h>
23
24 // define this to print information about the items rendered each frame
25 #undef DALI_PRINT_RENDER_INFO
26
27 #ifdef DALI_PRINT_RENDER_INFO
28
29 #define DALI_PRINT_RENDER_START(x) Render::PrintFrameStart(x);
30 #define DALI_PRINT_RENDER_END() Render::PrintFrameEnd();
31 #define DALI_PRINT_RENDER_INSTRUCTION(x,index) Render::PrintRenderInstruction(x,index);
32 #define DALI_PRINT_RENDER_LIST(x) Render::PrintRenderList(x);
33 #define DALI_PRINT_RENDER_ITEM(x) Render::PrintRenderItem(x);
34
35 #else // DALI_PRINT_RENDER_INFO
36
37 #define DALI_PRINT_RENDER_START(x)
38 #define DALI_PRINT_RENDER_END()
39 #define DALI_PRINT_RENDER_INSTRUCTION(x,index)
40 #define DALI_PRINT_RENDER_LIST(x)
41 #define DALI_PRINT_RENDER_ITEM(x)
42
43 #endif // DALI_PRINT_RENDER_INFO
44
45 #undef DALI_PRINT_RENDERERS
46
47 // Turn this on to see a snapshot of # renderers and # culled renderers every 2 seconds
48 //#define DALI_PRINT_RENDERERS 1
49
50 #ifdef DALI_PRINT_RENDERERS
51 #define DALI_PRINT_RENDERER_COUNT(x, y)  Render::PrintRendererCount(x, y)
52 #define DALI_PRINT_CULL_COUNT(x, y)      Render::PrintCullCount(x, y)
53 #else // DALI_PRINT_RENDERERS
54 #define DALI_PRINT_RENDERER_COUNT(x, y)
55 #define DALI_PRINT_CULL_COUNT(x, y)
56 #endif // DALI_PRINT_RENDERERS
57
58
59 namespace Dali
60 {
61
62 namespace Internal
63 {
64
65 class PropertyInputImpl;
66
67 namespace SceneGraph
68 {
69 class RenderInstruction;
70 struct RenderList;
71 class RenderItem;
72 }
73
74 namespace Render
75 {
76
77 /**
78  * Print a debug message at the start of the render-thread.
79  * @param[in] buffer The current render buffer index (previous update buffer)
80  */
81 void PrintFrameStart( BufferIndex bufferIndex );
82
83 /**
84  * Print a debug message at the end of the render-thread.
85  */
86 void PrintFrameEnd();
87
88 /**
89  * Print some information about a render-instruction.
90  * @param[in] instruction The render-instruction.
91  * @param[in] index to use
92  */
93 void PrintRenderInstruction( const SceneGraph::RenderInstruction& instruction, BufferIndex index );
94
95 /**
96  * Print some information about a render-list.
97  * @param[in] instruction The render-list.
98  */
99 void PrintRenderList( const SceneGraph::RenderList& list );
100
101 /**
102  * Print some information about a render-item.
103  * @param[in] instruction The render-item.
104  */
105 void PrintRenderItem( const SceneGraph::RenderItem& item );
106
107 /**
108  * Print the number of culled renderers
109  * @param[in] frameCount The frame counter
110  * @param[in] culledCount The number of culled renderers
111  */
112 void PrintCullCount( unsigned int frameCount, unsigned int culledCount );
113
114 /**
115  * Print the number of image renderers
116  * @param[in] frameCount The frame counter
117  * @param[in] rendererCount The number of image renderers
118  */
119 void PrintRendererCount( unsigned int frameCount, unsigned int rendererCount );
120
121 } // Render
122
123 } // Internal
124
125 } // Dali
126
127 #endif // __DALI_INTERNAL_RENDER_DEBUG_H__