2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "performance-marker.h"
35 PerformanceMarker::MarkerType type;
39 const NamePair MarkerLookup[] =
41 { PerformanceMarker::V_SYNC , "V_SYNC" },
42 { PerformanceMarker::UPDATE_START , "UPDATE_START" },
43 { PerformanceMarker::UPDATE_END , "UPDATE_END" },
44 { PerformanceMarker::RENDER_START , "RENDER_START" },
45 { PerformanceMarker::RENDER_END , "RENDER_END" },
46 { PerformanceMarker::SWAP_START , "SWAP_START" },
47 { PerformanceMarker::SWAP_END , "SWAP_END" },
48 { PerformanceMarker::PROCESS_EVENTS_START, "PROCESS_EVENT_START" },
49 { PerformanceMarker::PROCESS_EVENTS_END, "PROCESS_EVENT_END" },
50 { PerformanceMarker::PAUSED , "PAUSED" },
51 { PerformanceMarker::RESUME , "RESUMED" }
54 PerformanceMarker::PerformanceMarker( MarkerType type )
59 PerformanceMarker::PerformanceMarker( MarkerType type, FrameTimeStamp frameInfo )
65 const char* PerformanceMarker::GetName( ) const
67 return MarkerLookup[ mType ].name;
70 unsigned int PerformanceMarker::MicrosecondDiff( const PerformanceMarker& start,const PerformanceMarker& end )
72 return FrameTimeStamp::MicrosecondDiff( start.mTimeStamp, end.mTimeStamp );
75 } // namespace Adaptor
77 } // namespace Internal