20 #include "HuiFxEffect.h" |
20 #include "HuiFxEffect.h" |
21 #include "HuiFxGroupLayer.h" |
21 #include "HuiFxGroupLayer.h" |
22 #include "HuiRenderPlugin.h" |
22 #include "HuiRenderPlugin.h" |
23 #include "HuiCmdBufferBrush.h" // MHuiEffectable |
23 #include "HuiCmdBufferBrush.h" // MHuiEffectable |
24 |
24 |
|
25 #include "alfmoduletestconf.h" |
|
26 #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF |
|
27 // Provides TLS object data for test cases. |
|
28 // This is used only if module test hooks are set on. |
|
29 #include "huistatictlsdata.h" |
|
30 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
|
31 // Provides module test hook defines. |
|
32 #include "alfmoduletestdefines.h" |
|
33 |
|
34 |
25 EXPORT_C CHuiFxEffect* CHuiFxEffect::NewL(CHuiFxEngine& aEngine) |
35 EXPORT_C CHuiFxEffect* CHuiFxEffect::NewL(CHuiFxEngine& aEngine) |
26 { |
36 { |
27 CHuiFxEffect* e = new (ELeave) CHuiFxEffect( aEngine ); |
37 CHuiFxEffect* e = new (ELeave) CHuiFxEffect( aEngine ); |
28 CleanupStack::PushL(e); |
38 CleanupStack::PushL(e); |
29 e->ConstructL(); |
39 e->ConstructL(); |
105 // fade effect should not have observers |
115 // fade effect should not have observers |
106 if (iFlags & KHuiFadeEffectFlag) |
116 if (iFlags & KHuiFadeEffectFlag) |
107 { |
117 { |
108 return ETrue; // fade effect does not have observer that would need notification |
118 return ETrue; // fade effect does not have observer that would need notification |
109 } |
119 } |
|
120 |
|
121 #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF |
|
122 TTime endTime; |
|
123 endTime.UniversalTime(); |
|
124 |
|
125 // There might be several BeginFullScreen for single effects. We want to calculate |
|
126 // reaction time from the first BeginFullScreen event to this point |
|
127 TInt timeStamps = 0; |
|
128 AMT_GET_TIME_POINT_COUNT(iHandle, timeStamps); |
|
129 |
|
130 TInt64 temp; |
|
131 TBool effects(EFalse); // dummy, 1 if effects were on for this time stamp |
|
132 AMT_GET_TIME(temp, iHandle, 0, effects); |
|
133 TTime startTime(temp); |
|
134 |
|
135 AMT_GET_TIME(temp, iHandle, timeStamps - 1, effects); |
|
136 TTime effectStartTime(temp); |
|
137 |
|
138 TInt64 effectTime = endTime.MicroSecondsFrom(effectStartTime).Int64(); |
|
139 TReal fps = (TReal)iFramesDrawn / ((TReal)effectTime / 1000000.0f) ; |
|
140 |
|
141 TInt64 totalEffectTime = endTime.MicroSecondsFrom(startTime).Int64(); |
|
142 TInt64 reactionTime = effectStartTime.MicroSecondsFrom(startTime).Int64(); |
|
143 |
|
144 RDebug::Printf("CHuiFxEffect::NotifyEffectEndObserver - Reaction time \t0x%x\t%f\tVisible effect time:\t%f\ts. (%f FPS). Total effect time:\t%f", |
|
145 iHandle, |
|
146 (TReal)reactionTime / 1000000.0f, |
|
147 ((TReal)effectTime)/1000000, |
|
148 fps, |
|
149 ((TReal)totalEffectTime)/1000000.0f |
|
150 ); |
|
151 AMT_RESET_TIME(iHandle); |
|
152 #endif |
|
153 |
110 if (iEffectEndObserver) |
154 if (iEffectEndObserver) |
111 { |
155 { |
112 // The callback can be called only once when the effect finishes |
156 // The callback can be called only once when the effect finishes |
113 MAlfGfxEffectObserver* effectEndObserver = iEffectEndObserver; |
157 MAlfGfxEffectObserver* effectEndObserver = iEffectEndObserver; |
114 iEffectEndObserver = NULL; |
158 iEffectEndObserver = NULL; |