Fix the screen rotation issue
[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) 2021 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 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 #else // DALI_PRINT_RENDERERS
53 #define DALI_PRINT_RENDERER_COUNT(x, y)
54 #endif // DALI_PRINT_RENDERERS
55
56 namespace Dali
57 {
58 namespace Internal
59 {
60 class PropertyInputImpl;
61
62 namespace SceneGraph
63 {
64 class Node;
65 class RenderInstruction;
66 struct RenderList;
67 struct RenderItem;
68 } // namespace SceneGraph
69
70 namespace Render
71 {
72 /**
73  * Print a debug message at the start of the render-thread.
74  * @param[in] buffer The current render buffer index (previous update buffer)
75  */
76 void PrintFrameStart(BufferIndex bufferIndex);
77
78 /**
79  * Print a debug message at the end of the render-thread.
80  */
81 void PrintFrameEnd();
82
83 /**
84  * Print some information about a render-instruction.
85  * @param[in] instruction The render-instruction.
86  * @param[in] index to use
87  */
88 void PrintRenderInstruction(const SceneGraph::RenderInstruction& instruction, BufferIndex index);
89
90 /**
91  * Print some information about a render-list.
92  * @param[in] instruction The render-list.
93  */
94 void PrintRenderList(const SceneGraph::RenderList& list);
95
96 /**
97  * Print some information about a render-item.
98  * @param[in] instruction The render-item.
99  */
100 void PrintRenderItem(const SceneGraph::RenderItem& item);
101
102 /**
103  * Print the number of image renderers
104  * @param[in] frameCount The frame counter
105  * @param[in] rendererCount The number of image renderers
106  */
107 void PrintRendererCount(unsigned int frameCount, unsigned int rendererCount);
108
109 /**
110  * Recursively dumps a Node tree.
111  * @param[in] node The starting node to dump from
112  * @param[in] indent Optional. Leave unset for default indent (used internally while recursing)
113  */
114 void DumpNode(const SceneGraph::Node* node, unsigned int indent = 0);
115
116 } // namespace Render
117
118 } // namespace Internal
119
120 } // namespace Dali
121
122 #endif // DALI_INTERNAL_RENDER_DEBUG_H