[dali_2.3.30] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / render / common / performance-monitor.h
1 #ifndef DALI_INTERNAL_PERFORMANCE_MONITOR_H
2 #define DALI_INTERNAL_PERFORMANCE_MONITOR_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 namespace Dali
22 {
23 namespace Internal
24 {
25 /**
26  * @brief PerformanceMonitor.
27  * Empty stubs should we decided to hook into monitoring counters
28  */
29 class PerformanceMonitor
30 {
31 public:
32   /*
33    * Metric enums
34    */
35   enum Metric
36   {
37     FRAME_RATE,
38     MATRIX_MULTIPLYS,
39     QUATERNION_TO_MATRIX,
40     FLOAT_POINT_MULTIPLY,
41     RESET_PROPERTIES,
42     PROCESS_MESSAGES,
43     ANIMATE_NODES,
44     ANIMATORS_APPLIED,
45     APPLY_CONSTRAINTS,
46     CONSTRAINTS_APPLIED,
47     CONSTRAINTS_SKIPPED,
48     UPDATE_NODES,
49     PREPARE_RENDERABLES,
50     PROCESS_RENDER_TASKS,
51     DRAW_NODES,
52   };
53 };
54
55 #define PERFORMANCE_MONITOR_INIT(x)
56 #define PERF_MONITOR_START(x)     // start of timed event
57 #define PERF_MONITOR_END(x)       // end of a timed event
58 #define INCREASE_COUNTER(x)       // increase a counter by 1
59 #define INCREASE_BY(x, y)         // increase a count by x
60 #define MATH_INCREASE_COUNTER(x)  // increase a math counter ( MATRIX_MULTIPLYS, QUATERNION_TO_MATRIX, FLOAT_POINT_MULTIPLY)
61 #define MATH_INCREASE_BY(x, y)    // increase a math counter by x
62 #define PERF_MONITOR_NEXT_FRAME() // update started rendering a new frame
63
64 } // namespace Internal
65
66 } // namespace Dali
67
68 #endif // DALI_INTERNAL_PERFORMANCE_MONITOR_H_