uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp
branchRCL_3
changeset 24 f93c875b566e
parent 17 3ac8bf5c5014
child 34 3a60ebea00d0
equal deleted inserted replaced
22:7c5dd702d6d3 24:f93c875b566e
    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;
   551                 return;
   595                 return;
   552                 }
   596                 }
   553 
   597 
   554             if (iFramesDrawn == 1)
   598             if (iFramesDrawn == 1)
   555                 {
   599                 {
       
   600 #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF
       
   601 				// This is about the time when first frame from the effect is on screen
       
   602                 TTime endTime;
       
   603                 endTime.UniversalTime();
       
   604                 
       
   605                 AMT_ADD_TIME(iHandle, endTime.Int64(), ETrue);
       
   606 #endif
   556                 aElapsedTime = 0;
   607                 aElapsedTime = 0;
   557                 iFramesDrawn++;
   608                 iFramesDrawn++;
   558                 }
   609                 }
   559                 iRoot->AdvanceTime(aElapsedTime);
   610                 iRoot->AdvanceTime(aElapsedTime);
   560             }
   611             }