1 #ifndef __DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H__
2 #define __DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <base/interfaces/performance-interface.h>
23 #include <base/performance-logging/frame-time-stamp.h>
35 * Marker used to record an event with a time stamp in Dali
37 class PerformanceMarker
43 * Bitmask used to filter different types of markers based
44 * on what group they belong to.
48 FILTERING_DISABLED = 0, ///< disabled
49 V_SYNC_EVENTS = 1 << 0, ///< v-sync
50 UPDATE = 1 << 1, ///< update start / end
51 RENDER = 1 << 2, ///< render start / end
52 EVENT_PROCESS = 1 << 3, ///< process events start / end
53 SWAP_BUFFERS = 1 << 4, ///< swap buffers start / end
54 LIFE_CYCLE_EVENTS = 1 << 5, ///< pause / resume
55 RESOURCE_EVENTS = 1 << 6, ///< resource events
56 CUSTOM_EVENTS = 1 << 7
64 SINGLE_EVENT, ///< event is something that has no duration associated with it
65 START_TIMED_EVENT, ///< start of a timed event
66 END_TIMED_EVENT ///< end of a timed event
73 * @param[in] type marker type
75 PerformanceMarker( PerformanceInterface::MarkerType type );
79 * @param[in] type marker type
80 * @param[in] time time stamp
82 PerformanceMarker( PerformanceInterface::MarkerType type, FrameTimeStamp time );
85 * @return the time stamp
87 const FrameTimeStamp& GetTimeStamp() const
93 * @return the type of marker
95 PerformanceInterface::MarkerType GetType() const
101 * @return the event type of marker
103 MarkerEventType GetEventType() const;
106 * @return the filter type of marker
108 MarkerFilter GetFilterType() const;
112 * @return marker name
114 const char* GetName( ) const;
117 * @param start the start marker
118 * @param end the end marker
119 * @return difference in microseconds between two markers
121 static unsigned int MicrosecondDiff( const PerformanceMarker& start, const PerformanceMarker& end );
124 * @return if a marker is enabled as part of a group
126 bool IsFilterEnabled( MarkerFilter filter ) const;
129 PerformanceInterface::MarkerType mType; ///< marker type
130 FrameTimeStamp mTimeStamp; ///< frame time stamp
134 } // namespace Adaptor
136 } // namespace Internal
140 #endif // __DALI_INTERNAL_ADAPTOR_PERFORMANCE_MARKER_H__