uiacceltk/hitchcock/CommonInc/alfmoduletestdefines.h
branchRCL_3
changeset 12 f93c875b566e
parent 8 46927d61fef3
child 13 3a60ebea00d0
equal deleted inserted replaced
10:7c5dd702d6d3 12:f93c875b566e
    25     #define AMT_GET_VALUE(x, member)
    25     #define AMT_GET_VALUE(x, member)
    26     #define AMT_INC_COUNTER_IF(cond, member)
    26     #define AMT_INC_COUNTER_IF(cond, member)
    27     #define AMT_DEC_COUNTER_IF(cond, member)
    27     #define AMT_DEC_COUNTER_IF(cond, member)
    28     #define AMT_SET_VALUE_IF(cond, member, val)
    28     #define AMT_SET_VALUE_IF(cond, member, val)
    29     #define AMT_GET_VALUE_IF(cond, x, member)
    29     #define AMT_GET_VALUE_IF(cond, x, member)
       
    30 
       
    31     #define AMT_ADD_TIME(handle, member, effects)
       
    32     #define AMT_GET_TIME(x, handle, index, effects)
       
    33     #define AMT_GET_TIME_POINT_COUNT(handle, x)
       
    34     #define AMT_RESET_TIME(handle)
    30     
    35     
    31     #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr )
    36     #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr )
    32     #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr )
    37     #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr )
    33     #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type)
    38     #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type)
    34     #define AMT_MAP_APPEND(memberMap, key, defaultValue, type)
    39     #define AMT_MAP_APPEND(memberMap, key, defaultValue, type)
    88     // Conditional single operation macros, that will do lock/unlock.
    93     // Conditional single operation macros, that will do lock/unlock.
    89     #define AMT_INC_COUNTER_IF(cond, member)        AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++)
    94     #define AMT_INC_COUNTER_IF(cond, member)        AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++)
    90     #define AMT_DEC_COUNTER_IF(cond, member)        AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--)
    95     #define AMT_DEC_COUNTER_IF(cond, member)        AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--)
    91     #define AMT_SET_VALUE_IF(cond, member, val)     AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val))
    96     #define AMT_SET_VALUE_IF(cond, member, val)     AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val))
    92     #define AMT_GET_VALUE_IF(cond, x, member)       AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member)
    97     #define AMT_GET_VALUE_IF(cond, x, member)       AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member)
       
    98     
       
    99     #define AMT_ADD_TIME(handle, member, effects)   AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ TInt nextFreeIndex = AMT_DATA()->iTimeMap[timemapIndex].iCounter; AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[nextFreeIndex] = member; AMT_DATA()->iTimeMap[timemapIndex].iCounter++; timemapIndex = 100; break;} timemapIndex++; } if (timemapIndex == 10) { if (AMT_DATA()->iNextFreeMap == 10) { AMT_DATA()->iNextFreeMap = 0;} TInt nextFreeMap = AMT_DATA()->iNextFreeMap; AMT_DATA()->iTimeMap[nextFreeMap].iCounter = 1; AMT_DATA()->iTimeMap[nextFreeMap].iHandle = handle; AMT_DATA()->iTimeMap[nextFreeMap].iTimeStamp[0] = member; AMT_DATA()->iTimeMap[nextFreeMap].iEffects = effects; AMT_DATA()->iNextFreeMap++; /*RDebug::Printf("Handle: %d, %d %d %d", handle, timemapIndex, AMT_DATA()->iNextFreeMap, member)*/;})
       
   100     #define AMT_GET_TIME(x, handle, index, effects) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[index];(effects) = AMT_DATA()->iTimeMap[timemapIndex].iEffects;break;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;(effects) = EFalse;})
       
   101     #define AMT_GET_TIME_POINT_COUNT(handle, x)     AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iCounter;timemapIndex = 100;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;})
       
   102     #define AMT_RESET_TIME(handle)                  AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ AMT_DATA()->iTimeMap[timemapIndex].iHandle = 0; AMT_DATA()->iTimeMap[timemapIndex].iCounter = 0;AMT_DATA()->iTimeMap[timemapIndex].iEffects = 0;break;}timemapIndex++;})
    93     
   103     
    94     // Map operation macros, that will do lock/unlock
   104     // Map operation macros, that will do lock/unlock
    95     #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr )                                                   reinterpret_cast< TInt >( keyPtr )
   105     #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr )                                                   reinterpret_cast< TInt >( keyPtr )
    96     #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr )                                                 AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) )
   106     #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr )                                                 AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) )
    97     #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type)                         AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue))
   107     #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type)                         AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue))
   119 // General defines
   129 // General defines
   120 // Text cursor handle is defined as constant because correct handle is not provided
   130 // Text cursor handle is defined as constant because correct handle is not provided
   121 // from the window server for render stage.
   131 // from the window server for render stage.
   122 #define AMT_MAP_TEXT_CURSOR_HANDLE 0
   132 #define AMT_MAP_TEXT_CURSOR_HANDLE 0
   123 
   133 
       
   134 #define AMT_MAP_FORCE_SW_HANDLE 0
       
   135 #define AMT_MAP_SW_ENABLED_HANDLE 1
       
   136 #define AMT_MAP_LOW_MEMORY_MODE_HANDLE 2
       
   137 
       
   138 #define AMT_MAP_CANVAS_WS_GC_TYPE 0
       
   139 #define AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL 1
       
   140 #define AMT_MAP_CACHED_IMAGES_COUNT 2
       
   141 #define AMT_MAP_CACHED_TEXTS_COUNT 3
       
   142 #define AMT_MAP_CACHED_RENDER_BUFFERS_COUNT 4
       
   143 
   124 
   144 
   125 // Notice: 
   145 // Notice: 
   126 // Defines below will be empty if module test hook is not set.
   146 // Defines below will be empty if module test hook is not set.
   127 // If module test hook is set on, then these defines also use functionality defined above.  
   147 // If module test hook is set on, then these defines also use functionality defined above.  
   128 
   148 
   151         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorClipRect ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorClipRect ); \
   171         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorClipRect ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorClipRect ); \
   152         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorFlags ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorFlag ); \
   172         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorFlags ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorFlag ); \
   153         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorColor )
   173         AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorColor )
   154 
   174 
   155 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \
   175 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \
   156         AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeRenderStageCreateLayer ); \
   176         AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeCreateLayer ); \
   157         AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeRenderStageReleaseLayer )
   177         AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeReleaseLayer ); \
       
   178         AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeLayerOrdinalPosition )
   158 
   179 
   159 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \
   180 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \
   160         AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeRenderStageCreateLayer ); \
   181         AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeCreateLayer ); \
   161         AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeRenderStageReleaseLayer ); \
   182         AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeCreateLayer ); \
   162         \
   183         AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeReleaseLayer ); \
   163         AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeRenderStageCreateLayer )
   184         AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeReleaseLayer ); \
       
   185         AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeLayerOrdinalPosition ); \
       
   186         AMT_MAP_APPEND_LINK( iIntMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeLayerOrdinalPosition ); \
       
   187         \
       
   188         AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeCreateLayer )
       
   189 
       
   190 #define AMT_MAP_RENDER_STAGE_REMOVE_LAYER() \
       
   191         AMT_MAP_SET_VALUE_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), aLayer->Surface(), EAlfModuleTestTypeReleaseLayer )
   164 
   192 
   165 
   193 
   166 // Streamer defines
   194 // Streamer defines
   167                           
   195                           
   168 #define AMT_MAP_STREAMER_NODE_WINDOW_CONSTRUCT() \
   196 #define AMT_MAP_STREAMER_NODE_WINDOW_CONSTRUCT() \
   227         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorType ); \
   255         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorType ); \
   228         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorClipRect ); \
   256         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorClipRect ); \
   229         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorFlag ); \
   257         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorFlag ); \
   230         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorColor )
   258         AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorColor )
   231 
   259 
   232         
   260 #define AMT_MAP_BRIDGE_SET_ORDINAL_POSITION() \
       
   261         AMT_MAP_SET_VALUE_IF( windowAttributes, iIntMap, windowNodeId, windowAttributes->iOrdinalPosition, EAlfModuleTestTypeLayerOrdinalPosition )
       
   262 
       
   263 #ifndef USE_MODULE_TEST_HOOKS_FOR_ALF
       
   264 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC()
       
   265 #else
       
   266 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() \
       
   267         if ( iCanvasWsGc ) \
       
   268             { \
       
   269             AMT_MAP_SET_VALUE( \
       
   270                     iIntMap, \
       
   271                     AMT_MAP_CANVAS_WS_GC_TYPE, \
       
   272                     iCanvasWsGc->Type(), \
       
   273                     EAlfModuleTestTypeCoreToolkitGoom ); \
       
   274             } \
       
   275         else \
       
   276             { \
       
   277             AMT_MAP_SET_VALUE( \
       
   278                     iIntMap, \
       
   279                     AMT_MAP_CANVAS_WS_GC_TYPE, \
       
   280                     KErrNotFound, \
       
   281                     EAlfModuleTestTypeCoreToolkitGoom ); \
       
   282             }
       
   283 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF
       
   284 
       
   285 #define AMT_MAP_CANVAS_TEXTURE_CACHE_SET_MEMORY_LEVEL() \
       
   286         AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL, iMemoryLevel, EAlfModuleTestTypeCoreToolkitGoom ); \
       
   287         AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_IMAGES_COUNT, iCachedImages.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \
       
   288         AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_TEXTS_COUNT, iCachedTexts.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \
       
   289         AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_RENDER_BUFFERS_COUNT, iCachedRenderBuffers.Count(), EAlfModuleTestTypeCoreToolkitGoom )
       
   290 
       
   291 
   233 #endif // ALF_MODULE_TEST_DEFINES_H
   292 #endif // ALF_MODULE_TEST_DEFINES_H
   234 
   293 
   235 // End of File
   294 // End of File