Dali 3D User Interface Engine
performance-logger-impl.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 
18 // CLASS HEADER
20 
21 // INTERNAL INCLUDES
22 #include <adaptor-impl.h>
23 
24 namespace Dali
25 {
26 
27 namespace Internal
28 {
29 
30 namespace Adaptor
31 {
32 
33 namespace
34 {
35 
37 {
38  if( Adaptor::IsAvailable() )
39  {
41  }
42 
43  return NULL;
44 }
45 
46 } // Anonymous namespace
47 
49 {
50  PerformanceLoggerPtr logger = new PerformanceLogger( name );
51  return logger;
52 }
53 
55 : mContext( 0 )
56 {
58  if( performance )
59  {
60  mContext = performance->AddContext( name );
61  }
62 }
63 
65 {
67  if( performance )
68  {
69  performance->RemoveContext( mContext );
70  }
71 }
72 
73 void PerformanceLogger::AddMarker( Dali::PerformanceLogger::Marker markerType )
74 {
76  if( performance )
77  {
79  switch( markerType )
80  {
81  case Dali::PerformanceLogger::START_EVENT:
82  {
83  newMarkerType = PerformanceInterface::START;
84  break;
85  }
86  case Dali::PerformanceLogger::END_EVENT:
87  {
88  newMarkerType = PerformanceInterface::END;
89  break;
90  }
91  }
92 
93  performance->AddMarker( newMarkerType, mContext );
94  }
95 }
96 
97 void PerformanceLogger::SetLoggingFrequency( unsigned int logFrequency)
98 {
100  if( performance )
101  {
102  performance->SetLoggingFrequency( logFrequency, mContext );
103  }
104 }
105 
107 {
109  if( performance )
110  {
111  performance->EnableLogging( enable, mContext );
112  }
113 }
114 
115 } // namespace Adaptor
116 
117 } // namespace Internal
118 
119 } // namespace Dali
Dali Docs Home
Read more about Dali