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-logger-impl.h>
22 #include <adaptor-impl.h>
36 PerformanceInterface* GetPerformanceInterface()
38 if( Adaptor::IsAvailable() )
40 return Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetPerformanceInterface();
46 } // Anonymous namespace
48 PerformanceLoggerPtr PerformanceLogger::New( const char* name )
50 PerformanceLoggerPtr logger = new PerformanceLogger( name );
54 PerformanceLogger::PerformanceLogger( const char* name )
57 PerformanceInterface* performance = GetPerformanceInterface();
60 mContext = performance->AddContext( name );
64 PerformanceLogger::~PerformanceLogger()
66 PerformanceInterface* performance = GetPerformanceInterface();
69 performance->RemoveContext( mContext );
73 void PerformanceLogger::AddMarker( Dali::PerformanceLogger::Marker markerType )
75 PerformanceInterface* performance = GetPerformanceInterface();
78 PerformanceInterface::MarkerType newMarkerType = PerformanceInterface::START;
81 case Dali::PerformanceLogger::START_EVENT:
83 newMarkerType = PerformanceInterface::START;
86 case Dali::PerformanceLogger::END_EVENT:
88 newMarkerType = PerformanceInterface::END;
93 performance->AddMarker( newMarkerType, mContext );
97 void PerformanceLogger::SetLoggingFrequency( unsigned int logFrequency)
99 PerformanceInterface* performance = GetPerformanceInterface();
102 performance->SetLoggingFrequency( logFrequency, mContext );
106 void PerformanceLogger::EnableLogging( bool enable )
108 PerformanceInterface* performance = GetPerformanceInterface();
111 performance->EnableLogging( enable, mContext );
115 } // namespace Adaptor
117 } // namespace Internal