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>
20 #include <adaptor-impl.h>
34 PerformanceInterface* GetPerformanceInterface()
36 if( Adaptor::IsAvailable() )
38 return Internal::Adaptor::Adaptor::GetImplementation( Adaptor::Get() ).GetPerformanceInterface();
44 } // Anonymous namespace
46 PerformanceLoggerPtr PerformanceLogger::New( const char* name )
48 PerformanceLoggerPtr logger = new PerformanceLogger( name );
52 PerformanceLogger::PerformanceLogger( const char* name )
55 PerformanceInterface* performance = GetPerformanceInterface();
58 mContext = performance->AddContext( name );
62 PerformanceLogger::~PerformanceLogger()
64 PerformanceInterface* performance = GetPerformanceInterface();
67 performance->RemoveContext( mContext );
71 void PerformanceLogger::AddMarker( Dali::PerformanceLogger::Marker markerType )
73 PerformanceInterface* performance = GetPerformanceInterface();
76 PerformanceInterface::MarkerType newMarkerType = PerformanceInterface::START;
79 case Dali::PerformanceLogger::START_EVENT:
81 newMarkerType = PerformanceInterface::START;
84 case Dali::PerformanceLogger::END_EVENT:
86 newMarkerType = PerformanceInterface::END;
91 performance->AddMarker( newMarkerType, mContext );
95 void PerformanceLogger::SetLoggingFrequency( unsigned int logFrequency)
97 PerformanceInterface* performance = GetPerformanceInterface();
100 performance->SetLoggingFrequency( logFrequency, mContext );
104 void PerformanceLogger::EnableLogging( bool enable )
106 PerformanceInterface* performance = GetPerformanceInterface();
109 performance->EnableLogging( enable, mContext );
113 } // namespace Adaptor
115 } // namespace Internal