uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp
branchRCL_3
changeset 24 f93c875b566e
parent 22 7c5dd702d6d3
child 34 3a60ebea00d0
equal deleted inserted replaced
22:7c5dd702d6d3 24:f93c875b566e
   359         TInt aWindowNodeId, 
   359         TInt aWindowNodeId, 
   360         TInt aClientSideId, 
   360         TInt aClientSideId, 
   361         TInt aClientSideGroupId,
   361         TInt aClientSideGroupId,
   362         CHuiCanvasVisual* aVisual )
   362         CHuiCanvasVisual* aVisual )
   363     {
   363     {
   364     __ALFFXLOGSTRING1("CAlfBridge::AddVisual 0x%x", aWindowNodeId);
   364     __ALFFXLOGSTRING4("CAlfBridge::AddVisual id: %d (%d,%d), visual: 0x%x", aWindowNodeId, aClientSideId, aClientSideGroupId, aVisual);
   365     THashVisualStruct visualStruct( aVisual, aClientSideId, aClientSideGroupId);
   365     THashVisualStruct visualStruct( aVisual, aClientSideId, aClientSideGroupId);
   366     iWindowHashArray.Insert( aWindowNodeId, visualStruct );
   366     iWindowHashArray.Insert( aWindowNodeId, visualStruct );
   367     iPreviouslySearchedVisualId = aWindowNodeId;
   367     iPreviouslySearchedVisualId = aWindowNodeId;
   368     iPreviouslySearchedVisual = aVisual;
   368     iPreviouslySearchedVisual = aVisual;
   369 
   369 
   404         {
   404         {
   405         iPreviouslySearchedVisualId = aWindowNodeId;
   405         iPreviouslySearchedVisualId = aWindowNodeId;
   406         iPreviouslySearchedVisual = visualStruct->iVisual;
   406         iPreviouslySearchedVisual = visualStruct->iVisual;
   407         return iPreviouslySearchedVisual; 
   407         return iPreviouslySearchedVisual; 
   408         }
   408         }
   409     __ALFFXLOGSTRING1("CAlfBridge::FindVisual - Visual 0x%x not found", aWindowNodeId);
   409     __ALFLOGSTRING1("CAlfBridge::FindVisual - Visual 0x%x not found", aWindowNodeId);
   410     return NULL;
   410     return NULL;
   411     }
   411     }
   412 
   412 
   413 // ---------------------------------------------------------------------------
   413 // ---------------------------------------------------------------------------
   414 // FindVisualByClientSideId
   414 // FindVisualByClientSideId
   662                 RPointerArray<CHuiLayout> familyTree;
   662                 RPointerArray<CHuiLayout> familyTree;
   663                 ListFamilyTreeL(familyTree, layout); // recursively dig the family tree
   663                 ListFamilyTreeL(familyTree, layout); // recursively dig the family tree
   664                 TBool anyVisualHasEffect(EFalse);
   664                 TBool anyVisualHasEffect(EFalse);
   665                 TInt familyIndex(0);
   665                 TInt familyIndex(0);
   666                 TInt familySize = familyTree.Count();
   666                 TInt familySize = familyTree.Count();
       
   667                 TInt activeEffectIndex = KErrNotFound; 
   667                 while(familyIndex < familySize && !anyVisualHasEffect)
   668                 while(familyIndex < familySize && !anyVisualHasEffect)
   668                     {
   669                     {
   669                     anyVisualHasEffect = HasActiveEffect(familyTree[familyIndex++]);
   670                     anyVisualHasEffect = HasActiveEffect(familyTree[familyIndex++], activeEffectIndex); 
       
   671                     
   670                     }
   672                     }
   671                 
   673                 
   672                 if (anyVisualHasEffect)
   674                 if (anyVisualHasEffect)
   673                     {
   675                     {
       
   676                     TInt activeEffectHandle = iEffectCleanupStack[activeEffectIndex].iHandle;
   674                     __ALFFXLOGSTRING1("Layout 0x%x has external content", layout);
   677                     __ALFFXLOGSTRING1("Layout 0x%x has external content", layout);
   675                     // EHuiVisualFlagShouldDestroy destroy flag should have come for the windows in this layout already
   678                     // EHuiVisualFlagShouldDestroy destroy flag should have come for the windows in this layout already
   676                     layout->SetFlags(EHuiVisualFlagShouldDestroy);
   679                     layout->SetFlags(EHuiVisualFlagShouldDestroy);
   677                     // move this layout to effect control group, where it can still be shown. this control group may be deleted.
   680                     // move this layout to effect control group, where it can still be shown. this control group may be deleted.
   678                     CHuiControl& control = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup->Control(0);
   681                     CHuiControl& control = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup->Control(0);
   690                     CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
   693                     CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
   691                     // Transfers ownership of visuals. 
   694                     // Transfers ownership of visuals. 
   692                     effectControlGroup.AppendL(layout, effectControlGroupLayout); // this will remove it from the previous layout
   695                     effectControlGroup.AppendL(layout, effectControlGroupLayout); // this will remove it from the previous layout
   693                     layout->SetOwner(effectControlGroup);
   696                     layout->SetOwner(effectControlGroup);
   694                     
   697                     
   695                     for(TInt familyIndex = 0; familyIndex < familyTree.Count();familyIndex++)
   698                     for(TInt familyIndex = familyTree.Count() - 1; familyIndex >= 0; --familyIndex)
   696                         {
   699                        {
   697                         familyTree[familyIndex]->SetOwner(effectControlGroup);
   700                        familyTree[familyIndex]->SetOwner(effectControlGroup);                      
   698                         }
   701                        
       
   702                        if (!HasActiveEffect(familyTree[familyIndex]))
       
   703                            {
       
   704                            TInt dummy;
       
   705                            AddEffectItemL(activeEffectHandle, familyTree[familyIndex], NULL, NULL, EFalse, dummy, ETrue, EFalse);
       
   706                            }
       
   707                        }
   699                     }
   708                     }
   700                 else
   709                 else
   701                     {
   710                     {
   702                     // check once more, that the windows in this group are not having effects. 
   711                     // check once more, that the windows in this group are not having effects. 
   703                     // the layout is not have effect, but some child window might.
   712                     // the layout is not have effect, but some child window might.
   708                          RemoveTemporaryPresenterVisual(removedVisual);
   717                          RemoveTemporaryPresenterVisual(removedVisual);
   709           
   718           
   710                          if ( removedVisual != layout ) // let control group delete the layout
   719                          if ( removedVisual != layout ) // let control group delete the layout
   711 					         {
   720 					         {
   712 					         control.Remove(removedVisual); // remove ownership from the original control (group)
   721 					         control.Remove(removedVisual); // remove ownership from the original control (group)
       
   722 					         __ALFFXLOGSTRING1("CAlfBridge::DeleteControlGroupL - adding to orphonage 0x%x", layout);
       
   723 					         RemoveTemporaryPresenterVisual(removedVisual);
   713 					         if ( removedVisual->Layout() == layout ) 
   724 					         if ( removedVisual->Layout() == layout ) 
   714 					             {
   725 					             {
   715 					             iOrphanStorage->AppendL( removedVisual );
   726 					             iOrphanStorage->AppendL( removedVisual );
   716 					             } 
   727 					             } 
   717 					         else 
   728 					         else 
   760         CHuiLayout* layout = NULL;
   771         CHuiLayout* layout = NULL;
   761         
   772         
   762         cntrl->ConstructL();
   773         cntrl->ConstructL();
   763         group->AppendL(cntrl);
   774         group->AppendL(cntrl);
   764         CleanupStack::Pop(cntrl);
   775         CleanupStack::Pop(cntrl);
   765         cntrl->SetRole(EAlfWindowGroupContainer);
   776         cntrl->SetRole(EHuiWindowGroupContainer);
   766 
   777 
   767         layout = CHuiCanvasVisual::AddNewL(*cntrl);
   778         layout = CHuiCanvasVisual::AddNewL(*cntrl);
   768         layout->SetTagL(KAlfWindowGroupContainerControlTag);
   779         layout->SetTagL(KAlfWindowGroupContainerControlTag);
   769         layout->ClearFlag(EHuiVisualFlagClipping); // No need to clip, should be faster without clipping 
   780         layout->ClearFlag(EHuiVisualFlagClipping); // No need to clip, should be faster without clipping 
   770         // IsVisualOpaque should return true if there is no effect. 
   781         // IsVisualOpaque should return true if there is no effect. 
   814                 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - effect failed on layout 0x%x", layout);
   825                 __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - effect failed on layout 0x%x", layout);
   815                 HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData
   826                 HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData
   816                 }
   827                 }
   817             }     
   828             }     
   818         entry.iScreenNumber = aScreenNumber;
   829         entry.iScreenNumber = aScreenNumber;
   819 //        entry.iRole = EAlfWindowGroupContainer;
   830 //        entry.iRole = EHuiWindowGroupContainer;
   820 
   831 
   821         iAlfScreens[aScreenNumber]->iControlGroups.Append(entry);
   832         iAlfScreens[aScreenNumber]->iControlGroups.Append(entry);
   822         CleanupStack::Pop(group);                
   833         CleanupStack::Pop(group);                
   823 
   834 
   824         if (iAlfScreens[aScreenNumber]->iDisplay)
   835         if (iAlfScreens[aScreenNumber]->iDisplay)
   859 // when an application exits, it must be shown on top util the effect has run its course.
   870 // when an application exits, it must be shown on top util the effect has run its course.
   860 // But this tends to mess up the order of other groups, and application menu softkeys will
   871 // But this tends to mess up the order of other groups, and application menu softkeys will
   861 // disappear.
   872 // disappear.
   862     if ( aGroup.Control(0).Visual(0).Effect() )
   873     if ( aGroup.Control(0).Visual(0).Effect() )
   863         {
   874         {
   864         if ( aGroup.Control(0).Role() != EAlfWindowGroupContainer )
   875         if ( aGroup.Control(0).Role() != EHuiWindowGroupContainer )
   865             {
   876             {
   866             // The case where the application control group is deleted by window server
   877             // The case where the application control group is deleted by window server
   867             // has been solved by deleting the tag when window server wants to delete
   878             // has been solved by deleting the tag when window server wants to delete
   868             // the group. Window server no longer has it, but we keep it alive for a while
   879             // the group. Window server no longer has it, but we keep it alive for a while
   869             // to show the effect. The group will be deleted when the effect ends.
   880             // to show the effect. The group will be deleted when the effect ends.
   870             aWhere = aRoster.Count() - screen->FixedControlGroupCount();
   881             aWhere = aRoster.Count() - screen->FixedControlGroupCount();
   871             }
   882             }
   872         }
   883         }
   873 
   884 
   874     if (aGroup.Control(0).Role() == EAlfWindowGroupContainer)      
   885     if (aGroup.Control(0).Role() == EHuiWindowGroupContainer)      
   875         {
   886         {
   876         // Window group control groups
   887         // Window group control groups
   877         ShowWindowGroupControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
   888         ShowWindowGroupControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
   878         aGroup.SetAcceptInput(EFalse);
   889         aGroup.SetAcceptInput(EFalse);
   879         }
   890         }
   880     else if (aGroup.Control(0).Role() == EAlfSessionContainer)      
   891     else if (aGroup.Control(0).Role() == EHuiSessionContainer)      
   881         {
   892         {
   882         // ALF application control groups    
   893         // ALF application control groups    
   883         ShowSessionContainerControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
   894         ShowSessionContainerControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
   884         }
   895         }
   885     else
   896     else
   963             if( &aRoster.ControlGroup(i) == &aGroup )
   974             if( &aRoster.ControlGroup(i) == &aGroup )
   964                 {
   975                 {
   965                 move = ETrue;
   976                 move = ETrue;
   966                 }
   977                 }
   967             
   978             
   968             if (aRoster.ControlGroup(i).Control(0).Role() == EAlfSessionContainer)
   979             if (aRoster.ControlGroup(i).Control(0).Role() == EHuiSessionContainer)
   969                 {
   980                 {
   970                 index++;                                                
   981                 index++;                                                
   971                 }                    
   982                 }                    
   972             }
   983             }
   973         
   984         
  1037                 }
  1048                 }
  1038                 
  1049                 
  1039                 break;
  1050                 break;
  1040                 }
  1051                 }
  1041 
  1052 
  1042             if (aRoster.ControlGroup(i).Control(0).Role() == EAlfWindowGroupContainer &&
  1053             if (aRoster.ControlGroup(i).Control(0).Role() == EHuiWindowGroupContainer &&
  1043                 &aRoster.ControlGroup(i) != &aGroup)
  1054                 &aRoster.ControlGroup(i) != &aGroup)
  1044                 {
  1055                 {
  1045                 index++;                                                
  1056                 index++;                                                
  1046                 }                    
  1057                 }                    
  1047             }
  1058             }
  1050         if (!added)
  1061         if (!added)
  1051             {
  1062             {
  1052             // Topmost
  1063             // Topmost
  1053             for (TInt i=aRoster.Count() - screen->FixedControlGroupCount(); i >= 0; i--)
  1064             for (TInt i=aRoster.Count() - screen->FixedControlGroupCount(); i >= 0; i--)
  1054                 {
  1065                 {
  1055                 if (aRoster.ControlGroup(i).Control(0).Role() == EAlfWindowGroupContainer)
  1066                 if (aRoster.ControlGroup(i).Control(0).Role() == EHuiWindowGroupContainer)
  1056                     {
  1067                     {
  1057                     // increasing the count, assuming that WindowControlGroup is not in the Roster
  1068                     // increasing the count, assuming that WindowControlGroup is not in the Roster
  1058                     i++;
  1069                     i++;
  1059                     aRoster.ShowL(aGroup, i); 
  1070                     aRoster.ShowL(aGroup, i); 
  1060                     break;
  1071                     break;
  1068 // ---------------------------------------------------------------------------
  1079 // ---------------------------------------------------------------------------
  1069 // ---------------------------------------------------------------------------
  1080 // ---------------------------------------------------------------------------
  1070 // 
  1081 // 
  1071 void CAlfBridge::SetAlfWindowGroupId(TInt aAlfWindowGroupId)
  1082 void CAlfBridge::SetAlfWindowGroupId(TInt aAlfWindowGroupId)
  1072     {
  1083     {
  1073     iAlfWindowGroupId = aAlfWindowGroupId;        
  1084     iAlfWindowGroupId = aAlfWindowGroupId;
  1074     // check if hithcock window group was already there
  1085     // check if hithcock window group was already there
  1075     TInt secureId = RThread().SecureId(); 
  1086     TInt secureId = RThread().SecureId(); 
  1076     if (iAlfScreens.Count())
  1087     if (iAlfScreens.Count())
  1077         {
  1088         {
  1078         for ( TInt i = 0; i < iAlfScreens[0]->iControlGroups.Count(); i++ )
  1089         for ( TInt i = 0; i < iAlfScreens[0]->iControlGroups.Count(); i++ )
  1079             {
  1090             {
  1080             if ( iAlfScreens[0]->iControlGroups[i].iSecureId == secureId && 
  1091             if ( iAlfScreens[0]->iControlGroups[i].iSecureId == secureId && 
  1081                  iAlfScreens[0]->iControlGroups[i].iClientWindowGroupId != CHuiStatic::RootWin(0)->Identifier())
  1092                  iAlfScreens[0]->iControlGroups[i].iClientWindowGroupId != CHuiStatic::RootWin(0)->Identifier())
  1082                 {
  1093                 {
  1083                 iAlfWindowGroupNodeId = iAlfScreens[0]->iControlGroups[i].iWindowGroupNodeId;
  1094                 iAlfWindowGroupNodeId = iAlfScreens[0]->iControlGroups[i].iWindowGroupNodeId;
       
  1095                 
       
  1096                 CHuiControlGroup* controlGroup = FindControlGroup(iAlfWindowGroupNodeId, 0);
       
  1097                 CHuiControl& control = controlGroup->Control(0);
       
  1098                 CHuiVisual* layout = &control.Visual(0);
       
  1099                 iAlfScreens[0]->iDisplay->Roster().SetAlfEventWindow(layout);
  1084                 return;
  1100                 return;
  1085                 }
  1101                 }
  1086             }        
  1102             }        
  1087         }
  1103         }
  1088     }
  1104     }
  1113         RPointerArray<CHuiControlGroup> controlGroupOrder;
  1129         RPointerArray<CHuiControlGroup> controlGroupOrder;
  1114         CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
  1130         CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
  1115         for (TInt j=0; j<roster.Count();j++)
  1131         for (TInt j=0; j<roster.Count();j++)
  1116             {
  1132             {
  1117             CHuiControlGroup& controlGroup = roster.ControlGroup(j);
  1133             CHuiControlGroup& controlGroup = roster.ControlGroup(j);
  1118             if (controlGroup.Control(0).Role() == EAlfSessionContainer)
  1134             if (controlGroup.Control(0).Role() == EHuiSessionContainer)
  1119                 {
  1135                 {
  1120                 controlGroupOrder.Append(&controlGroup);
  1136                 controlGroupOrder.Append(&controlGroup);
  1121                 roster.Hide(controlGroup);
  1137                 roster.Hide(controlGroup);
  1122                 j--; // roster.Hide does remove controlGroup from the roster 
  1138                 j--; // roster.Hide does remove controlGroup from the roster 
  1123                 }
  1139                 }
  1141     if (iAlfScreens[aScreenNumber]->iDisplay)
  1157     if (iAlfScreens[aScreenNumber]->iDisplay)
  1142         {
  1158         {
  1143         CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
  1159         CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
  1144         for (TInt j=0; j<roster.Count();j++)
  1160         for (TInt j=0; j<roster.Count();j++)
  1145             {
  1161             {
  1146             if( roster.ControlGroup(j).Control(0).Role() == EAlfSessionContainer 
  1162             if( roster.ControlGroup(j).Control(0).Role() == EHuiSessionContainer 
  1147                 || roster.ControlGroup(j).ResourceId() == iAlfWindowGroupNodeId )
  1163                 || roster.ControlGroup(j).ResourceId() == iAlfWindowGroupNodeId )
  1148                 {
  1164                 {
  1149                 return j; // Alf groups positioned just above alf servers window group   
  1165                 return j; // Alf groups positioned just above alf servers window group   
  1150                 }
  1166                 }
  1151             }                                        
  1167             }                                        
  1425 #endif
  1441 #endif
  1426 
  1442 
  1427         CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j);
  1443         CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j);
  1428         CHuiControl& control = controlgroup.Control(0);
  1444         CHuiControl& control = controlgroup.Control(0);
  1429 
  1445 
  1430         if (control.Role() == EAlfFpsIndicatorContainer)
  1446         if (control.Role() == EHuiFpsIndicatorContainer)
  1431             {
  1447             {
  1432             // FPS container doesn't contain canvas visuals
  1448             // FPS container doesn't contain canvas visuals
  1433             continue;
  1449             continue;
  1434             }
  1450             }
  1435 
  1451 
  1452 #endif
  1468 #endif
  1453             }
  1469             }
  1454         
  1470         
  1455         
  1471         
  1456         // Dont mess with alf control group visuals, alf session handling does it for us
  1472         // Dont mess with alf control group visuals, alf session handling does it for us
  1457         if (control.Role() == EAlfSessionContainer)
  1473         if (control.Role() == EHuiSessionContainer)
  1458             {
  1474             {
  1459             CHuiLayout* hostContainer = control.ContainerLayout( NULL );
  1475             CHuiLayout* hostContainer = control.ContainerLayout( NULL );
  1460             TInt flags = hostContainer->Flags();            
  1476             TInt flags = hostContainer->Flags();   
  1461             if (!fullscreenCovered || alfClientWindowGroupVisible)
  1477             CAlfAppSrvSessionBase* activeSession = NULL;
       
  1478             if (iAppUi)
       
  1479                 {
       
  1480                 activeSession = iAppUi->ActiveSession();
       
  1481                 }
       
  1482             // !fullscreenCovered need to be checked because for fullscreen
       
  1483             // alf applications alf event window group could be on top of alf client windowgroup
       
  1484             if ( (alfClientWindowGroupVisible || !fullscreenCovered)  && activeSession)
  1462                 {
  1485                 {
  1463                 // clear inactive flag if client has not made this controlgroup hidden
  1486                 // clear inactive flag if client has not made this controlgroup hidden
  1464                 if(!(flags&EHuiVisualFlagUnderOpaqueHint))
  1487                 if(!(flags&EHuiVisualFlagUnderOpaqueHint))
  1465                     {
  1488                     {
  1466                     if(iAppUi)
  1489                     if(iAppUi)
  1606         
  1629         
  1607         TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive);        
  1630         TBool isLayoutActive = !(layout->Flags() & EHuiVisualFlagInactive);        
  1608         if (isLayoutActive && !hasActiveVisualsInVisualTree)
  1631         if (isLayoutActive && !hasActiveVisualsInVisualTree)
  1609             {
  1632             {
  1610             // Setting also the root visual (layout) as inactive, if it had none
  1633             // Setting also the root visual (layout) as inactive, if it had none
  1611 						// active children. This is because otherwise the Inactive checks won't
  1634 			// active children. This is because otherwise the Inactive checks won't
  1612 						// work correctly within RosterImpl ScanDirty & ClearChanged phases.
  1635 			// work correctly within RosterImpl ScanDirty & ClearChanged phases.
  1613             layout->SetFlag(EHuiVisualFlagInactive);
  1636             layout->SetFlag(EHuiVisualFlagInactive);
  1614             }
  1637             }
  1615         else if(!isLayoutActive && hasActiveVisualsInVisualTree)
  1638         else if(!isLayoutActive && hasActiveVisualsInVisualTree)
  1616             {
  1639             {
  1617             layout->ClearFlag(EHuiVisualFlagInactive);
  1640             layout->ClearFlag(EHuiVisualFlagInactive);
  1684             {
  1707             {
  1685             RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, value );
  1708             RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, value );
  1686             iHomeScreenPSValue = value;
  1709             iHomeScreenPSValue = value;
  1687             }
  1710             }
  1688         }
  1711         }
  1689 
  1712     if ( iSwRenderingEnabled )
  1690 	screen->iDisplay->SetForegroundTextureOptions( alfWindowGroupFoundVisible | alfClientWindowGroupVisible );
  1713         {
  1691 
  1714         screen->iDisplay->SetForegroundTextureOptions( alfWindowGroupFoundVisible | alfClientWindowGroupVisible );
       
  1715         }
       
  1716    
  1692     // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not
  1717     // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not
  1693     // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others
  1718     // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others
  1694     // would clear the screen areas where they do not really draw.
  1719     // would clear the screen areas where they do not really draw.
  1695     if (checkFadeEffectInScreen)
  1720     if (checkFadeEffectInScreen)
  1696         {
  1721         {
  1709                     layout->Effect()->SetEffectFlags(flags);
  1734                     layout->Effect()->SetEffectFlags(flags);
  1710                     }
  1735                     }
  1711                 
  1736                 
  1712                 if ((controlgroup.ResourceId() == iAlfWindowGroupNodeId))
  1737                 if ((controlgroup.ResourceId() == iAlfWindowGroupNodeId))
  1713                     {
  1738                     {
  1714                     // Special handling for ALF fading...fading happens via empty alf originated event window group
  1739 					// no special actions needed currently for alf content.
  1715                     TInt flags = layout->Effect()->EffectFlags();
       
  1716                     flags |= KHuiFxEnableBackgroundInAllLayers; // This forces effect to happen to background pixels that are read from surface. 
       
  1717                     flags |= KHuiFxFrozenBackground; // To get optimal UI performance, we ignore changes in ALF scene when it is faded.
       
  1718                     layout->Effect()->SetEffectFlags(flags);                            
       
  1719                     }                
  1740                     }                
  1720                 firstFadedWindowGroupFound = ETrue;
  1741                 firstFadedWindowGroupFound = ETrue;
  1721                 }
  1742                 }
  1722             }
  1743             }
  1723         }
  1744         }
  1957         visualIsActive = !(canvasVisual->Flags() & EHuiVisualFlagInactive);
  1978         visualIsActive = !(canvasVisual->Flags() & EHuiVisualFlagInactive);
  1958     
  1979     
  1959         // Sprites and effects as we consider them always as transparent and also
  1980         // Sprites and effects as we consider them always as transparent and also
  1960         // if controlgroup is transformed somehow    
  1981         // if controlgroup is transformed somehow    
  1961         
  1982         
  1962         if (aControl.Role() == EAlfFullScreenEffectContainer 
  1983         if (aControl.Role() == EHuiFullScreenEffectContainer 
  1963             || aControl.Role() == EAlfWindowFloatingSpriteContainer ||
  1984             || aControl.Role() == EHuiWindowFloatingSpriteContainer ||
  1964             aControlGroup.IsTransformed())
  1985             aControlGroup.IsTransformed())
  1965             {
  1986             {
  1966             visualIsOpaque = EFalse;    
  1987             visualIsOpaque = EFalse;    
  1967             }
  1988             }
  1968     
  1989     
  2158     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) // skip the topmost (effect) layer 
  2179     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) // skip the topmost (effect) layer 
  2159         {                
  2180         {                
  2160         CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j);
  2181         CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j);
  2161         CHuiControl& control = controlgroup.Control(0);
  2182         CHuiControl& control = controlgroup.Control(0);
  2162 
  2183 
  2163         if ( control.Role() == EAlfSessionContainer ||
  2184         if ( control.Role() == EHuiSessionContainer ||
  2164              control.Role() == EAlfFpsIndicatorContainer )
  2185              control.Role() == EHuiFpsIndicatorContainer )
  2165             {
  2186             {
  2166             continue;
  2187             continue;
  2167             }
  2188             }
  2168         
  2189         
  2169         CHuiVisual* layout = &control.Visual(0);
  2190         CHuiVisual* layout = &control.Visual(0);
  2709     for (TInt familyIndex = 1; familyIndex < familyTree.Count();familyIndex++)
  2730     for (TInt familyIndex = 1; familyIndex < familyTree.Count();familyIndex++)
  2710         {
  2731         {
  2711         CHuiLayout* lVisual = familyTree[familyIndex];
  2732         CHuiLayout* lVisual = familyTree[familyIndex];
  2712         lVisual->Owner().Remove(lVisual);
  2733         lVisual->Owner().Remove(lVisual);
  2713         iOrphanStorage->AppendL( lVisual );
  2734         iOrphanStorage->AppendL( lVisual );
       
  2735         RemoveTemporaryPresenterVisual(lVisual);
       
  2736         
       
  2737         __ALFLOGSTRING1("CAlfBridge::DestroyWindow - orphons: %d", iOrphanStorage->VisualCount());
  2714         }
  2738         }
  2715     familyTree.Close();
  2739     familyTree.Close();
  2716          
  2740          
  2717     __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual);
  2741     __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual);
  2718     // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then 
  2742     // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then 
  3122 			// Window server nodes are in inverted Z-order, we switch it here.
  3146 			// Window server nodes are in inverted Z-order, we switch it here.
  3123 			iAlfScreens[screenNumber]->iDisplay->Roster().Hide(*controlGroup);                            
  3147 			iAlfScreens[screenNumber]->iDisplay->Roster().Hide(*controlGroup);                            
  3124 			TInt wsWindowGroupCount = 0;
  3148 			TInt wsWindowGroupCount = 0;
  3125 			for (TInt i=0; i<iAlfScreens[screenNumber]->iDisplay->Roster().Count();i++)
  3149 			for (TInt i=0; i<iAlfScreens[screenNumber]->iDisplay->Roster().Count();i++)
  3126 				{
  3150 				{
  3127                 if (iAlfScreens[screenNumber]->iDisplay->Roster().ControlGroup(i).Control(0).Role()==EAlfWindowGroupContainer)
  3151                 if (iAlfScreens[screenNumber]->iDisplay->Roster().ControlGroup(i).Control(0).Role()==EHuiWindowGroupContainer)
  3128 					{
  3152 					{
  3129 					wsWindowGroupCount++;    
  3153 					wsWindowGroupCount++;    
  3130 					}
  3154 					}
  3131 				}
  3155 				}
  3132 			ordinalPosition = wsWindowGroupCount - windowAttributes->iOrdinalPosition;
  3156 			ordinalPosition = wsWindowGroupCount - windowAttributes->iOrdinalPosition;
  3198 			__ALFLOGSTRING("CAlfBridge::HandleReorderWindowL: Unknown window node type received !");    
  3222 			__ALFLOGSTRING("CAlfBridge::HandleReorderWindowL: Unknown window node type received !");    
  3199 			break;
  3223 			break;
  3200 			}
  3224 			}
  3201 		}
  3225 		}
  3202   
  3226   
  3203 	iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed   
  3227 	iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed
       
  3228 
       
  3229 	AMT_MAP_BRIDGE_SET_ORDINAL_POSITION();
  3204 	}
  3230 	}
  3205 
  3231 
  3206 // ---------------------------------------------------------------------------
  3232 // ---------------------------------------------------------------------------
  3207 // HandlePostCanvasBufferL
  3233 // HandlePostCanvasBufferL
  3208 // ---------------------------------------------------------------------------
  3234 // ---------------------------------------------------------------------------
  3253 		TPtrC8 commands((TUint8*)bufferAttributes->iBuffer, bufferAttributes->iBufferLength);
  3279 		TPtrC8 commands((TUint8*)bufferAttributes->iBuffer, bufferAttributes->iBufferLength);
  3254 		if ( bufferAttributes->iEmptyThisBuffer )
  3280 		if ( bufferAttributes->iEmptyThisBuffer )
  3255 			{
  3281 			{
  3256 			viz->ClearCommandSet();
  3282 			viz->ClearCommandSet();
  3257 			}
  3283 			}
       
  3284 #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF
       
  3285 		if (!(viz->Flags() & EHuiVisualFlagInactive))
       
  3286 		    {
       
  3287             TInt secureId = viz->Owner().ControlGroup()->SecureId();
       
  3288             TInt64 temp(KErrNotFound);
       
  3289             TBool effects(EFalse);
       
  3290             AMT_GET_TIME(temp, secureId, 0, effects);
       
  3291             if (temp != KErrNotFound && effects == EFalse)
       
  3292                 {
       
  3293                 TTime time;
       
  3294                 time.UniversalTime();
       
  3295                 TTime startTime(temp);
       
  3296                     
       
  3297                 TInt64 reactionTime = time.MicroSecondsFrom(startTime).Int64();
       
  3298                     
       
  3299                 RDebug::Printf("CAlfBridge::HandlePostCanvasBufferL - Reaction time \t0x%x\t%f", secureId, (TReal)reactionTime / 1000000.0f );
       
  3300                 AMT_RESET_TIME(secureId);
       
  3301                 }
       
  3302 		    }
       
  3303 #endif
       
  3304 		
  3258 		// If tracking has been enabled for this CHuiCanvasVisual object, the buffers will be marked for tracking aswell in CHuiCanvasVisual
  3305 		// If tracking has been enabled for this CHuiCanvasVisual object, the buffers will be marked for tracking aswell in CHuiCanvasVisual
  3259 		switch( bufferAttributes->iPartStatus )
  3306 		switch( bufferAttributes->iPartStatus )
  3260 			{
  3307 			{
  3261 			case TAlfWindowCommandBufferAttributes::EPartComplete:
  3308 			case TAlfWindowCommandBufferAttributes::EPartComplete:
  3262 				{
  3309 				{
  4084     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  4131     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  4085         {                
  4132         {                
  4086         CHuiControlGroup& controlgroup = screen->iDisplay->Roster().ControlGroup(j);
  4133         CHuiControlGroup& controlgroup = screen->iDisplay->Roster().ControlGroup(j);
  4087         CHuiControl& control = controlgroup.Control(0);
  4134         CHuiControl& control = controlgroup.Control(0);
  4088 
  4135 
  4089         if( control.Role() == EAlfWindowGroupContainer)
  4136         if( control.Role() == EHuiWindowGroupContainer)
  4090             {
  4137             {
  4091             // Only update layout which are made to correspond window groups. 
  4138             // Only update layout which are made to correspond window groups. 
  4092             // Layouts that fullscreen effects are applied to
  4139             // Layouts that fullscreen effects are applied to
  4093             CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0);
  4140             CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0);
  4094             layout->SetPos(fullscreen.iTl);
  4141             layout->SetPos(fullscreen.iTl);
  4167                     {
  4214                     {
  4168                     // All children in the tree are not faded, do not apply effect on children.
  4215                     // All children in the tree are not faded, do not apply effect on children.
  4169                     effectFlags |= KHuiFxEffectExcludeChildrenFlag;
  4216                     effectFlags |= KHuiFxEffectExcludeChildrenFlag;
  4170                     //RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - no children faded by parent"));
  4217                     //RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - no children faded by parent"));
  4171                     }
  4218                     }
       
  4219                 __ALFFXLOGSTRING1("CAlfBridge::SetupFadeEffectL - insert fade 0x%x", &aVisual);
  4172                 TRAP( err, engine->LoadEffectL(*iFadeEffectFile, effect, aVisual.Effectable(), NULL, NULL, 0, effectFlags ) );
  4220                 TRAP( err, engine->LoadEffectL(*iFadeEffectFile, effect, aVisual.Effectable(), NULL, NULL, 0, effectFlags ) );
  4173                 didFadeEffectLoad = ETrue;
  4221                 didFadeEffectLoad = ETrue;
  4174         		}
  4222         		}
  4175         	}
  4223         	}
  4176         }
  4224         }
  4178         {
  4226         {
  4179         // remove only an old fade effect, leave any others intact
  4227         // remove only an old fade effect, leave any others intact
  4180         if (alreadyFaded)
  4228         if (alreadyFaded)
  4181             {
  4229             {
  4182             aVisual.SetEffect( NULL );
  4230             aVisual.SetEffect( NULL );
       
  4231             __ALFFXLOGSTRING1("CAlfBridge::SetupFadeEffectL - remove fade: 0x%x", &aVisual);
  4183             alreadyFaded = EFalse;
  4232             alreadyFaded = EFalse;
  4184             }
  4233             }
  4185         }
  4234         }
  4186     
  4235     
  4187     // If we did load and fade children we must re-prepare the flags again
  4236     // If we did load and fade children we must re-prepare the flags again
  4263                 }
  4312                 }
  4264             }
  4313             }
  4265         else 
  4314         else 
  4266             {
  4315             {
  4267             __ALFLOGSTRING("CAlfBridge::HandleMoveWindowToNewGroupL cannot find new group! orphaning the visual");
  4316             __ALFLOGSTRING("CAlfBridge::HandleMoveWindowToNewGroupL cannot find new group! orphaning the visual");
  4268             iOrphanStorage->AppendL( viz );
  4317             
       
  4318             RemoveTemporaryPresenterVisual(viz);
       
  4319              iOrphanStorage->AppendL( viz );
  4269             }
  4320             }
  4270         }
  4321         }
  4271     else
  4322     else
  4272         {
  4323         {
  4273         __ALFLOGSTRING("CAlfBridge::HandleMoveWindowToNewGroupL cannot find moving visual!");
  4324         __ALFLOGSTRING("CAlfBridge::HandleMoveWindowToNewGroupL cannot find moving visual!");
  4516                     {
  4567                     {
  4517                     TInt dummy;
  4568                     TInt dummy;
  4518 					if (!HasActiveEffect(aToLayout, dummy))
  4569 					if (!HasActiveEffect(aToLayout, dummy))
  4519 						{
  4570 						{
  4520 						__ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Add layout 0x%x with handle %d to cleanupstack", aToLayout, aEvent.iHandle);
  4571 						__ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Add layout 0x%x with handle %d to cleanupstack", aToLayout, aEvent.iHandle);
  4521                     	AddEffectItemL(aEvent.iHandle, aToLayout, NULL, NULL, EFalse, dummy, EFalse);
  4572                     	AddEffectItemL(aEvent.iHandle, aToLayout, NULL, NULL, EFalse, dummy, ETrue, EFalse);
  4522 						}
  4573 						}
  4523                     }
  4574                     }
  4524 				// Screenshot was requested, but it could not be taken. Lets cancel the effect.	
  4575 				// Screenshot was requested, but it could not be taken. Lets cancel the effect.	
  4525 				if (!success)
  4576 				if (!success)
  4526 					{
  4577 					{
  4573                                 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout);
  4624                                 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout);
  4574                                 iEffectCleanupStack.Remove(index);
  4625                                 iEffectCleanupStack.Remove(index);
  4575                                 }
  4626                                 }
  4576                             // this will tag the visual, that they cannot be hidden by HandleVisualVisibility
  4627                             // this will tag the visual, that they cannot be hidden by HandleVisualVisibility
  4577                             // Initialize layout for the exit effect  
  4628                             // Initialize layout for the exit effect  
  4578                             iLayoutInitializedForExitEffect = SetupEffectLayoutContainerL(aEvent.iHandle, aToLayout, ETrue, aEvent.iCanDestroyOrHideImmediately);
  4629                             iLayoutInitializedForExitEffect = SetupEffectLayoutContainerL(aEvent.iHandle, aToLayout, ETrue, ETrue, aEvent.iCanDestroyOrHideImmediately);
  4579                             __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EBeginFullscreen - iLayoutInitializedForExitEffect: %d", iLayoutInitializedForExitEffect);
  4630                             __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EBeginFullscreen - iLayoutInitializedForExitEffect: %d", iLayoutInitializedForExitEffect);
  4580                             aEvent.iSetupDone = iLayoutInitializedForExitEffect; 
  4631                             aEvent.iSetupDone = iLayoutInitializedForExitEffect; 
  4581                             }
  4632                             }
  4582                         else
  4633                         else
  4583                             {
  4634                             {
  4623     	                        // for cleaning. SetupEffectLayoutContainerL will add the same layout 
  4674     	                        // for cleaning. SetupEffectLayoutContainerL will add the same layout 
  4624         	                    // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. 
  4675         	                    // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. 
  4625                                 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout);
  4676                                 __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout);
  4626                                 iEffectCleanupStack.Remove(index);
  4677                                 iEffectCleanupStack.Remove(index);
  4627                                 }
  4678                                 }
  4628                             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, EFalse, aEvent.iCanDestroyOrHideImmediately);
  4679                             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, ETrue, EFalse, aEvent.iCanDestroyOrHideImmediately);
  4629                             aEvent.iSetupDone = layoutEffectable; 
  4680                             aEvent.iSetupDone = layoutEffectable; 
  4630                             aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue);
  4681                             aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue);
  4631                             }
  4682                             }
  4632 
  4683 
  4633                         if (layoutEffectable)
  4684                         if (layoutEffectable)
  4693 		if (err == KErrNone)
  4744 		if (err == KErrNone)
  4694 			{
  4745 			{
  4695             // Freeze only, if buffer was reserved succesfully 
  4746             // Freeze only, if buffer was reserved succesfully 
  4696             aLayout->SetFreezeState(ETrue);
  4747             aLayout->SetFreezeState(ETrue);
  4697         	TBool itemsDestroyed;
  4748         	TBool itemsDestroyed;
  4698     	    AddEffectItemL(aHandle, aLayout, NULL, NULL, EFalse, itemsDestroyed, EFalse);
  4749     	    AddEffectItemL(aHandle, aLayout, NULL, NULL, EFalse, itemsDestroyed, ETrue, EFalse);
  4699 	        iFullScreenEffectData->iAppStartScreenshotItemHandle = aHandle;
  4750 	        iFullScreenEffectData->iAppStartScreenshotItemHandle = aHandle;
  4700 			}
  4751 			}
  4701         }
  4752         }
  4702     }
  4753     }
  4703 
  4754 
  4868             return ; 
  4919             return ; 
  4869             }
  4920             }
  4870         }
  4921         }
  4871     else // MAlfGfxEffectPlugin::EEndFullscreen
  4922     else // MAlfGfxEffectPlugin::EEndFullscreen
  4872         {
  4923         {
  4873         stream.Release();
       
  4874 
       
  4875         // End fullscreen signal received. We proceed only if there is really
  4924         // End fullscreen signal received. We proceed only if there is really
  4876         // effect ongoing and "end fullscreen" hasn't already been processed.
  4925         // effect ongoing and "end fullscreen" hasn't already been processed.
  4877         
  4926         
  4878         if ( !iFullScreenEffectData || iFullScreenEffectData->iEndFullScreen )
  4927         if ( !iFullScreenEffectData || iFullScreenEffectData->iEndFullScreen )
  4879             {
  4928             {
  4880             __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END: fx ready");
  4929             __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END: fx ready");
  4881             return;
  4930             return;
  4882             }
  4931             }
  4883 
  4932 			// Load the whole structure. If timeout was triggered then request effect name
       
  4933 			// is updated.
       
  4934             CFullScreenEffectState* fxData = new (ELeave) CFullScreenEffectState;
       
  4935             CleanupStack::PushL( fxData );
       
  4936             fxData->ConstructL( action, stream );
       
  4937             iFullScreenEffectData->iTimeoutTriggered = fxData->iTimeoutTriggered;    
       
  4938             if (fxData->iTimeoutTriggered)
       
  4939                 {
       
  4940                 delete iFullScreenEffectData->iEffectName;
       
  4941                 iFullScreenEffectData->iEffectName = NULL;
       
  4942                 iFullScreenEffectData->iEffectName = fxData->iEffectName->AllocL();
       
  4943                 
       
  4944                 }
       
  4945             CleanupStack::PopAndDestroy( fxData );
       
  4946             fxData = NULL;
       
  4947         
  4884         __ALFFXLOGSTRING("HandleGfxEffectsL - process end");
  4948         __ALFFXLOGSTRING("HandleGfxEffectsL - process end");
  4885         iFullScreenEffectData->iEndFullScreen = ETrue;
  4949         iFullScreenEffectData->iEndFullScreen = ETrue;
  4886 
  4950 
  4887 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT		
  4951 #ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT		
  4888         if (iFullScreenEffectData->iDrawingCompleteTimer)
  4952         if (iFullScreenEffectData->iDrawingCompleteTimer)
  4889             {
  4953             {
  4890             iFullScreenEffectData->iDrawingCompleteTimer->Cancel();
  4954             iFullScreenEffectData->iDrawingCompleteTimer->Cancel();
  4891             }
  4955             }
  4892 #endif			
  4956 #endif			
       
  4957         stream.Release();
  4893         }
  4958         }
  4894 
  4959 
  4895     CFullScreenEffectState* fxData = iFullScreenEffectData;
  4960     CFullScreenEffectState* fxData = iFullScreenEffectData;
  4896     fxData->iOperation = operation;
  4961     fxData->iOperation = operation;
  4897     fxData->iWaitingWindowGroup = EFalse;
  4962     fxData->iWaitingWindowGroup = EFalse;
  5076         {
  5141         {
  5077         HandleGfxControlEventL(*iControlEffectData, visual);
  5142         HandleGfxControlEventL(*iControlEffectData, visual);
  5078         }
  5143         }
  5079     else
  5144     else
  5080         {
  5145         {
  5081         __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle %d, iClientGroupHandle %d", 
  5146         __ALFFXLOGSTRING2("CAlfBridge::HandleSetDistractionWindowL - Control not found. iClientHandle %d, iClientGroupHandle %d. Cache request.", 
  5082                 fxData->iClientHandle, 
  5147                 fxData->iClientHandle, 
  5083                 fxData->iClientGroupHandle);
  5148                 fxData->iClientGroupHandle);
  5084         return;
  5149         return;
  5085         }
  5150         }
  5086     delete iControlEffectData;
  5151     delete iControlEffectData;
  5139         CHuiVisual* aSourceVisual, 
  5204         CHuiVisual* aSourceVisual, 
  5140         CHuiLayout* aTargetLayout, 
  5205         CHuiLayout* aTargetLayout, 
  5141         CHuiControl* aEffectControl, 
  5206         CHuiControl* aEffectControl, 
  5142         TBool aInsertTemporaryVisual,
  5207         TBool aInsertTemporaryVisual,
  5143         TInt& aItemDestroyed,
  5208         TInt& aItemDestroyed,
       
  5209         TBool aIsFullScreenEffect,
  5144         TBool aIsExitEffect,
  5210         TBool aIsExitEffect,
  5145         TBool aCanDestroyOrHideImmediately)
  5211         TBool aCanDestroyOrHideImmediately 
       
  5212         )
  5146     {
  5213     {
  5147     CHuiCanvasVisual* temporaryPresenterVisual = NULL;
  5214     CHuiCanvasVisual* temporaryPresenterVisual = NULL;
  5148     TInt enableEffect = ETrue;
  5215     TInt enableEffect = ETrue;
  5149     
  5216     
  5150     if (aSourceVisual->iOpacity.Now() >= 0.01 && !(aSourceVisual->Flags() & EHuiVisualFlagShouldBeHidden))
  5217     if (aSourceVisual->iOpacity.Now() >= 0.01 && !(aSourceVisual->Flags() & EHuiVisualFlagShouldBeHidden))
  5190                     aEffectHandle,
  5257                     aEffectHandle,
  5191                     aSourceVisual, 
  5258                     aSourceVisual, 
  5192                     temporaryPresenterVisual,
  5259                     temporaryPresenterVisual,
  5193                     ETrue,
  5260                     ETrue,
  5194                     aIsExitEffect,
  5261                     aIsExitEffect,
  5195                     aCanDestroyOrHideImmediately);
  5262                     aCanDestroyOrHideImmediately,
       
  5263                     aIsFullScreenEffect);
  5196             iEffectCleanupStack.AppendL(item);
  5264             iEffectCleanupStack.AppendL(item);
  5197             }
  5265             }
  5198         else
  5266         else
  5199             {
  5267             {
  5200             // this will be a child of another visual, and draw by its parent external content visual
  5268             // this will be a child of another visual, and draw by its parent external content visual
  5201             // aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5269             // aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5202             TEffectCleanupStruct item = TEffectCleanupStruct(aEffectHandle,
  5270             TEffectCleanupStruct item = TEffectCleanupStruct(aEffectHandle,
  5203                         aSourceVisual, NULL, EFalse,
  5271                         aSourceVisual, NULL, EFalse,
  5204                         aIsExitEffect,
  5272                         aIsExitEffect,
  5205                         aCanDestroyOrHideImmediately);
  5273                         aCanDestroyOrHideImmediately,
       
  5274                         aIsFullScreenEffect);
  5206             iEffectCleanupStack.AppendL(item);
  5275             iEffectCleanupStack.AppendL(item);
  5207             }
  5276             }
  5208      }
  5277      }
  5209     return temporaryPresenterVisual;
  5278     return temporaryPresenterVisual;
  5210     }
  5279     }
  5213         TInt aEffectHandle,
  5282         TInt aEffectHandle,
  5214         CHuiLayout* aSourceLayout, 
  5283         CHuiLayout* aSourceLayout, 
  5215         CHuiLayout* aTargetLayout, 
  5284         CHuiLayout* aTargetLayout, 
  5216         CHuiControl* aEffectControl,
  5285         CHuiControl* aEffectControl,
  5217         TInt& aItemsDestroyed,
  5286         TInt& aItemsDestroyed,
       
  5287         TBool aIsFullScreenEffect,
  5218         TBool aAddLayout,
  5288         TBool aAddLayout,
  5219         TBool aIsExitEffect,
  5289         TBool aIsExitEffect,
  5220         TBool aCanDestroyOrHideImmediately)
  5290         TBool aCanDestroyOrHideImmediately)
  5221     {
  5291     {
  5222     __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x is having %d children", aSourceLayout, aSourceLayout->Count());
  5292     __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x is having %d children", aSourceLayout, aSourceLayout->Count());
  5223     if (aAddLayout)
  5293     if (aAddLayout)
  5224         {
  5294         {
  5225         AddEffectItemL(aEffectHandle, aSourceLayout, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsExitEffect, aCanDestroyOrHideImmediately);
  5295         AddEffectItemL(aEffectHandle, aSourceLayout, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsFullScreenEffect, aIsExitEffect, aCanDestroyOrHideImmediately);
  5226         }
  5296         }
  5227         
  5297         
  5228     for (TInt i = 0; i < aSourceLayout->Count(); i++)
  5298     for (TInt i = 0; i < aSourceLayout->Count(); i++)
  5229            {
  5299            {
  5230            CHuiCanvasVisual& sourceVisual = static_cast<CHuiCanvasVisual&> (aSourceLayout->Visual(i));
  5300            CHuiCanvasVisual& sourceVisual = static_cast<CHuiCanvasVisual&> (aSourceLayout->Visual(i));
  5231            
  5301            
  5232            if (sourceVisual.Count())
  5302            if (sourceVisual.Count())
  5233                {
  5303                {
  5234                CHuiLayout& layout = static_cast<CHuiLayout&> (aSourceLayout->Visual(i));
  5304                CHuiLayout& layout = static_cast<CHuiLayout&> (aSourceLayout->Visual(i));
  5235                AddToEffectLayoutContainerL(aEffectHandle, &layout, NULL, aEffectControl, aItemsDestroyed, EFalse,aIsExitEffect, aCanDestroyOrHideImmediately );
  5305                AddToEffectLayoutContainerL(aEffectHandle, &layout, NULL, aEffectControl, aItemsDestroyed, aIsFullScreenEffect,  EFalse, aIsExitEffect, aCanDestroyOrHideImmediately );
  5236                }
  5306                }
  5237            TInt oldItemsDestroyed = aItemsDestroyed;
  5307            TInt oldItemsDestroyed = aItemsDestroyed;
  5238            AddEffectItemL(aEffectHandle, &sourceVisual, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsExitEffect, aCanDestroyOrHideImmediately);
  5308            AddEffectItemL(aEffectHandle, &sourceVisual, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsFullScreenEffect, aIsExitEffect, aCanDestroyOrHideImmediately);
  5239            if (oldItemsDestroyed != aItemsDestroyed)
  5309            if (oldItemsDestroyed != aItemsDestroyed)
  5240                {
  5310                {
  5241                // Visual was destroyed. If so, then we must adjust index.
  5311                // Visual was destroyed. If so, then we must adjust index.
  5242                --i;
  5312                --i;
  5243                }
  5313                }
  5244            }
  5314            }
  5245     __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x end of children", aSourceLayout, aSourceLayout->Count());
  5315     __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x end of children", aSourceLayout, aSourceLayout->Count());
  5246     }
  5316     }
  5247 
  5317 
  5248 TBool CAlfBridge::SetupEffectLayoutContainerL(TInt aHandle,CHuiLayout* aSourceLayout, TBool aIsExitEffect, TBool aCanDestroyOrHideImmediately)
  5318 TBool CAlfBridge::SetupEffectLayoutContainerL(TInt aHandle,CHuiLayout* aSourceLayout, TBool aIsFullScreenEffect, TBool aIsExitEffect, TBool aCanDestroyOrHideImmediately)
  5249     {
  5319     {
  5250     __ALFFXLOGSTRING4("CAlfBridge::SetupEffectLayoutContainerL - aHandle: %d, aSourceLayout: 0x%x, aIsExitEffect: % d, CanDestroyOrHideImmediately: %d >>", 
  5320     __ALFFXLOGSTRING4("CAlfBridge::SetupEffectLayoutContainerL - aHandle: %d, aSourceLayout: 0x%x, aIsExitEffect: % d, CanDestroyOrHideImmediately: %d >>", 
  5251             aHandle, 
  5321             aHandle, 
  5252             aSourceLayout, 
  5322             aSourceLayout, 
  5253             aIsExitEffect,
  5323             aIsExitEffect,
  5264     CHuiLayout& effectControlGroupLayout = (CHuiLayout&) effectControlGroup.Visual(0);
  5334     CHuiLayout& effectControlGroupLayout = (CHuiLayout&) effectControlGroup.Visual(0);
  5265 
  5335 
  5266     // CHuiCanvasVisual* temporaryPresenterLayout = CHuiCanvasVisual::AddNewL( effectControlGroup, &effectControlGroupLayout);
  5336     // CHuiCanvasVisual* temporaryPresenterLayout = CHuiCanvasVisual::AddNewL( effectControlGroup, &effectControlGroupLayout);
  5267     // create presenter visual and set bindings
  5337     // create presenter visual and set bindings
  5268     TInt itemsDestroyed(0);
  5338     TInt itemsDestroyed(0);
  5269     AddToEffectLayoutContainerL(aHandle, aSourceLayout, NULL, &effectControlGroup, itemsDestroyed, EFalse, aIsExitEffect, aCanDestroyOrHideImmediately);
  5339     AddToEffectLayoutContainerL(aHandle, aSourceLayout, NULL, &effectControlGroup, itemsDestroyed, aIsFullScreenEffect, EFalse, aIsExitEffect, aCanDestroyOrHideImmediately);
  5270 
  5340 
  5271     if (aIsExitEffect)
  5341     if (aIsExitEffect)
  5272         {
  5342         {
  5273         CHuiCanvasVisual* temporaryPresenterVisual = AddEffectItemL(aHandle, aSourceLayout, &effectControlGroupLayout, &effectControlGroup, ETrue, itemsDestroyed, aIsExitEffect, EFalse);
  5343         CHuiCanvasVisual* temporaryPresenterVisual = AddEffectItemL(aHandle, aSourceLayout, &effectControlGroupLayout, &effectControlGroup, ETrue, itemsDestroyed, aIsFullScreenEffect, aIsExitEffect, EFalse);
  5274         aSourceLayout->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5344         aSourceLayout->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5275         __ALFFXLOGSTRING3("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout)-> 0x%x (presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout, temporaryPresenterVisual);
  5345         __ALFFXLOGSTRING3("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout)-> 0x%x (presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout, temporaryPresenterVisual);
  5276         }
  5346         }
  5277     else
  5347     else
  5278         {
  5348         {
  5279         AddEffectItemL(aHandle, aSourceLayout, NULL, &effectControlGroup, EFalse, itemsDestroyed, EFalse, EFalse);
  5349         AddEffectItemL(aHandle, aSourceLayout, NULL, &effectControlGroup, EFalse, itemsDestroyed, aIsFullScreenEffect, EFalse, EFalse);
  5280         __ALFFXLOGSTRING2("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout), NO presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout);
  5350         __ALFFXLOGSTRING2("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout), NO presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout);
  5281         }
  5351         }
  5282     iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue;
  5352     iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue;
  5283     iAlfScreens[0]->iDisplay->SetDirty();
  5353     iAlfScreens[0]->iDisplay->SetDirty();
  5284     if (itemsDestroyed)
  5354     if (itemsDestroyed)
  5379     // Check if there is an effects engine in HuiEnv
  5449     // Check if there is an effects engine in HuiEnv
  5380     CHuiFxEffect* effect = NULL;
  5450     CHuiFxEffect* effect = NULL;
  5381     CHuiFxEngine* engine = NULL;
  5451     CHuiFxEngine* engine = NULL;
  5382     // engine is not owned by us, it is a member of HuiEnv
  5452     // engine is not owned by us, it is a member of HuiEnv
  5383     engine = iHuiEnv->EffectsEngine();
  5453     engine = iHuiEnv->EffectsEngine();
  5384     if (engine)
  5454     if (engine && aCanvasVisual)
  5385         {
  5455         {
  5386         if (NeedsStoredBuffers(engine, *aEvent.iEffectName))
  5456         if (NeedsStoredBuffers(engine, *aEvent.iEffectName))
  5387             {
  5457             {
  5388             RecursiveStoreRenderBufferL(aCanvasVisual);
  5458             RecursiveStoreRenderBufferL(aCanvasVisual);
  5389             }
  5459             }
  5408                 // Lets make it visible again, and ask it to be hidden in the end of the effect
  5478                 // Lets make it visible again, and ask it to be hidden in the end of the effect
  5409                 // this enables at least the notes disappear effects
  5479                 // this enables at least the notes disappear effects
  5410                 aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity);
  5480                 aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity);
  5411                 // visual->SetFlag(EHuiVisualFlagShouldBeHidden);
  5481                 // visual->SetFlag(EHuiVisualFlagShouldBeHidden);
  5412                 }*/
  5482                 }*/
  5413             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, ETrue, EFalse);
  5483             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, ETrue, EFalse);
  5414             }
  5484             }
  5415         else
  5485         else
  5416             {
  5486             {
  5417             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, EFalse);
  5487             layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse, EFalse, EFalse);
  5418             }
  5488             }
  5419         if (layoutEffectable)
  5489         if (layoutEffectable)
  5420             {
  5490             {
  5421             TInt effectFlags = 0;
  5491             TInt effectFlags = 0;
  5422             
  5492             
  5471     if (sourceViz2 && sourceViz2->Layout()) 
  5541     if (sourceViz2 && sourceViz2->Layout()) 
  5472         {
  5542         {
  5473         sourceViz2->FreeRenderBuffer();
  5543         sourceViz2->FreeRenderBuffer();
  5474         }
  5544         }
  5475     sourceViz->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5545     sourceViz->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
  5476     TBool hideVisual = sourceViz->Flags() & EHuiVisualFlagShouldBeHidden;
  5546     TBool hideVisual = EFalse;
  5477     TBool showVisual = sourceViz->Flags() & EHuiVisualFlagShouldBeShown;
  5547     TBool showVisual = ETrue;
       
  5548     if(!aEffectItem.iIsFullScreenEffect)
       
  5549         {
       
  5550         hideVisual = (sourceViz->Flags() & EHuiVisualFlagShouldBeHidden) || aEffectItem.iHideWhenFinished;
       
  5551         showVisual = (sourceViz->Flags() & EHuiVisualFlagShouldBeShown) && !aEffectItem.iHideWhenFinished;
       
  5552         }
       
  5553     else
       
  5554         {
       
  5555         hideVisual = (sourceViz->Flags() & EHuiVisualFlagShouldBeHidden);
       
  5556         showVisual = (sourceViz->Flags() & EHuiVisualFlagShouldBeShown);
       
  5557         }
  5478     TBool destroyVisual = sourceViz->Flags() & EHuiVisualFlagShouldDestroy;
  5558     TBool destroyVisual = sourceViz->Flags() & EHuiVisualFlagShouldDestroy;
  5479     TBool shouldInactivate = sourceViz->Flags() & EHuiVisualFlagShouldBeInactive;
  5559     TBool shouldInactivate = sourceViz->Flags() & EHuiVisualFlagShouldBeInactive;
  5480     TBool shouldBeUnderOpaqueHint = sourceViz->Flags() & EHuiVisualFlagShouldBeUnderOpaqueHint;
  5560     TBool shouldBeUnderOpaqueHint = sourceViz->Flags() & EHuiVisualFlagShouldBeUnderOpaqueHint;
  5481     __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - cleaning handle: %d, 0x%x -> 0x%x", aEffectItem.iHandle, aEffectItem.iEffectedVisual, aEffectItem.iTemporaryPresenterVisual);
  5561     __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - cleaning handle: %d, 0x%x -> 0x%x", aEffectItem.iHandle, aEffectItem.iEffectedVisual, aEffectItem.iTemporaryPresenterVisual);
  5482     __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - hide %d, destroy %d, should inactivate: %d", TBool(hideVisual), TBool(destroyVisual), TBool(shouldInactivate));
  5562     __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - hide %d, destroy %d, should inactivate: %d", TBool(hideVisual), TBool(destroyVisual), TBool(shouldInactivate));
  5835 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5915 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5836         TInt clientWindowGroupId = FindClientWindowGroupId( aScreen.iScreenNum, indexedGroup );
  5916         TInt clientWindowGroupId = FindClientWindowGroupId( aScreen.iScreenNum, indexedGroup );
  5837 
  5917 
  5838         TFileName processName = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() );
  5918         TFileName processName = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() );
  5839 #endif         
  5919 #endif         
  5840         if (indexedGroup.Control(0).Role() == EAlfWindowGroupContainer)
  5920         if (indexedGroup.Control(0).Role() == EHuiWindowGroupContainer)
  5841             {
  5921             {
  5842             if (aRoster.ControlGroup(i).ResourceId() == iAlfWindowGroupNodeId)
  5922             if (aRoster.ControlGroup(i).ResourceId() == iAlfWindowGroupNodeId)
  5843                 {
  5923                 {
  5844 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5924 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5845                 __ALFLOGSTRING2(">> %d WINDOW GROUP (ALF), %d", i, clientWindowGroupId);                                    
  5925                 __ALFLOGSTRING2(">> %d WINDOW GROUP (ALF), %d", i, clientWindowGroupId);                                    
  5854 #else
  5934 #else
  5855                 __ALFLOGSTRING1(">> %d WINDOW GROUP", i);            
  5935                 __ALFLOGSTRING1(">> %d WINDOW GROUP", i);            
  5856 #endif
  5936 #endif
  5857                 }                    
  5937                 }                    
  5858             }
  5938             }
  5859         else if (indexedGroup.Control(0).Role() == EAlfSessionContainer)
  5939         else if (indexedGroup.Control(0).Role() == EHuiSessionContainer)
  5860             {
  5940             {
  5861 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5941 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5862             __ALFLOGSTRING2(">> %d ALF GROUP, %d", i, clientWindowGroupId);                        
  5942             __ALFLOGSTRING2(">> %d ALF GROUP, %d", i, clientWindowGroupId);                        
  5863 #else
  5943 #else
  5864             __ALFLOGSTRING1(">> %d ALF GROUP", i);                                    
  5944             __ALFLOGSTRING1(">> %d ALF GROUP", i);                                    
  5865 #endif
  5945 #endif
  5866             }
  5946             }
  5867         else if (indexedGroup.Control(0).Role() == EAlfWindowFloatingSpriteContainer)
  5947         else if (indexedGroup.Control(0).Role() == EHuiWindowFloatingSpriteContainer)
  5868             {
  5948             {
  5869 #ifdef  HUI_DEBUG_TRACK_DRAWING			
  5949 #ifdef  HUI_DEBUG_TRACK_DRAWING			
  5870             __ALFLOGSTRING3(">> %d FLOATING SPRITE GROUP %S, %d", i, &processName, clientWindowGroupId);                                            
  5950             __ALFLOGSTRING3(">> %d FLOATING SPRITE GROUP %S, %d", i, &processName, clientWindowGroupId);                                            
  5871 #else
  5951 #else
  5872             __ALFLOGSTRING1(">> %d FLOATING SPRITE GROUP", i);                                            
  5952             __ALFLOGSTRING1(">> %d FLOATING SPRITE GROUP", i);                                            
  5873 #endif
  5953 #endif
  5874             }
  5954             }
  5875         else if (indexedGroup.Control(0).Role() == EAlfFullScreenEffectContainer)
  5955         else if (indexedGroup.Control(0).Role() == EHuiFullScreenEffectContainer)
  5876             {
  5956             {
  5877 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5957 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5878             __ALFLOGSTRING3(">> %d EFFECT GROUP %S, %d", i, &processName, clientWindowGroupId );                                                                
  5958             __ALFLOGSTRING3(">> %d EFFECT GROUP %S, %d", i, &processName, clientWindowGroupId );                                                                
  5879 #else
  5959 #else
  5880             __ALFLOGSTRING1(">> %d EFFECT GROUP", i);                                                                
  5960             __ALFLOGSTRING1(">> %d EFFECT GROUP", i);                                                                
  5881 #endif
  5961 #endif
  5882             }
  5962             }
  5883         else if (indexedGroup.Control(0).Role() == EAlfFpsIndicatorContainer)
  5963         else if (indexedGroup.Control(0).Role() == EHuiFpsIndicatorContainer)
  5884             {
  5964             {
  5885 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5965 #ifdef  HUI_DEBUG_TRACK_DRAWING
  5886             __ALFLOGSTRING3(">> %d FPS GROUP %S, %d", i, &processName, clientWindowGroupId );                                                                
  5966             __ALFLOGSTRING3(">> %d FPS GROUP %S, %d", i, &processName, clientWindowGroupId );                                                                
  5887 #else
  5967 #else
  5888             __ALFLOGSTRING1(">> %d FPS GROUP", i);                                                                
  5968             __ALFLOGSTRING1(">> %d FPS GROUP", i);                                                                
  6117         {
  6197         {
  6118         return;
  6198         return;
  6119         }
  6199         }
  6120     
  6200     
  6121     iSwRenderingEnabled = aEnable;    
  6201     iSwRenderingEnabled = aEnable;    
       
  6202     
       
  6203     AMT_MAP_SET_VALUE(
       
  6204             iBoolMap,
       
  6205             AMT_MAP_SW_ENABLED_HANDLE,
       
  6206             iSwRenderingEnabled,
       
  6207             EAlfModuleTestTypeBridgeGoom );
       
  6208     
  6122     for (TInt i=0; i<iAlfScreens.Count();i++)
  6209     for (TInt i=0; i<iAlfScreens.Count();i++)
  6123         {
  6210         {
  6124         PrepareSwRenderingTarget(iAlfScreens[i]);        
  6211         PrepareSwRenderingTarget(iAlfScreens[i]);        
  6125      
  6212      
  6126         if (iSwRenderingEnabled)
  6213         if (iSwRenderingEnabled)
  6225 // ---------------------------------------------------------------------------
  6312 // ---------------------------------------------------------------------------
  6226 // 
  6313 // 
  6227 void CAlfBridge::SetLowMemory(TBool aEnabled)
  6314 void CAlfBridge::SetLowMemory(TBool aEnabled)
  6228     {
  6315     {
  6229     iLowMemoryMode = aEnabled;
  6316     iLowMemoryMode = aEnabled;
       
  6317     
       
  6318     AMT_MAP_SET_VALUE(
       
  6319             iBoolMap,
       
  6320             AMT_MAP_LOW_MEMORY_MODE_HANDLE,
       
  6321             iLowMemoryMode,
       
  6322             EAlfModuleTestTypeBridgeGoom );
       
  6323     
  6230     DoUpdateMemoryLevel();
  6324     DoUpdateMemoryLevel();
  6231     }
  6325     }
  6232 
  6326 
  6233 // ---------------------------------------------------------------------------
  6327 // ---------------------------------------------------------------------------
  6234 // ---------------------------------------------------------------------------
  6328 // ---------------------------------------------------------------------------
  6235 // 
  6329 // 
  6236 TInt CAlfBridge::ForceSwRendering(TBool aEnabled)
  6330 TInt CAlfBridge::ForceSwRendering(TBool aEnabled)
  6237     {
  6331     {
  6238     iForcedSwRendering = aEnabled;
  6332     iForcedSwRendering = aEnabled;
       
  6333     
       
  6334     AMT_MAP_SET_VALUE(
       
  6335             iBoolMap,
       
  6336             AMT_MAP_FORCE_SW_HANDLE,
       
  6337             iForcedSwRendering,
       
  6338             EAlfModuleTestTypeBridgeGoom );
       
  6339     
  6239     DoUpdateMemoryLevel();
  6340     DoUpdateMemoryLevel();
  6240     return KErrNone;        
  6341     return KErrNone;        
  6241     }
  6342     }
  6242 
  6343 
  6243 // ---------------------------------------------------------------------------
  6344 // ---------------------------------------------------------------------------
  6482         CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j);
  6583         CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j);
  6483         CHuiControl& control = controlgroup.Control(0);
  6584         CHuiControl& control = controlgroup.Control(0);
  6484 		__ALFFXLOGSTRING1("CAlfBridge::IsFullScreenDrawn : Group owner 0x%x", controlgroup.SecureId());
  6585 		__ALFFXLOGSTRING1("CAlfBridge::IsFullScreenDrawn : Group owner 0x%x", controlgroup.SecureId());
  6485                 
  6586                 
  6486         
  6587         
  6487         if (control.Role() == EAlfFpsIndicatorContainer)
  6588         if (control.Role() == EHuiFpsIndicatorContainer)
  6488             {
  6589             {
  6489             // FPS container doesn't contain canvas visuals
  6590             // FPS container doesn't contain canvas visuals
  6490             continue;
  6591             continue;
  6491             }
  6592             }
  6492 
  6593 
  6505                 __ALFFXLOGSTRING4("CAlfBridge::IsFullScreenDrawn (%d,%d)-(%d,%d)", iTempRegion[ii].iTl.iX, iTempRegion[ii].iTl.iY , iTempRegion[ii].iBr.iX, iTempRegion[ii].iBr.iY );
  6606                 __ALFFXLOGSTRING4("CAlfBridge::IsFullScreenDrawn (%d,%d)-(%d,%d)", iTempRegion[ii].iTl.iX, iTempRegion[ii].iTl.iY , iTempRegion[ii].iBr.iX, iTempRegion[ii].iBr.iY );
  6506                 }
  6607                 }
  6507             }
  6608             }
  6508         
  6609         
  6509         // Dont mess with alf control group visuals, alf session handling does it for us
  6610         // Dont mess with alf control group visuals, alf session handling does it for us
  6510         if (control.Role() == EAlfSessionContainer)
  6611         if (control.Role() == EHuiSessionContainer)
  6511             {
  6612             {
  6512             CHuiLayout* hostContainer = control.ContainerLayout( NULL );
  6613             CHuiLayout* hostContainer = control.ContainerLayout( NULL );
  6513             TInt flags = hostContainer->Flags();            
  6614             TInt flags = hostContainer->Flags();            
  6514             if (alfClientWindowGroupVisible)
  6615             if (alfClientWindowGroupVisible)
  6515                 {
  6616                 {
  6664         
  6765         
  6665         visualIsActive = canvasVisual->iOpacity.Now() > 0.01; // in fact this does not mean that visual should be drawn, but this atleast prevents disabled "on top" windows to be considered as visible.
  6766         visualIsActive = canvasVisual->iOpacity.Now() > 0.01; // in fact this does not mean that visual should be drawn, but this atleast prevents disabled "on top" windows to be considered as visible.
  6666         
  6767         
  6667         // Sprites and effects as we consider them always as transparent and also
  6768         // Sprites and effects as we consider them always as transparent and also
  6668         // if controlgroup is transformed somehow    
  6769         // if controlgroup is transformed somehow    
  6669         if (aControl.Role() == EAlfFullScreenEffectContainer 
  6770         if (aControl.Role() == EHuiFullScreenEffectContainer 
  6670             || aControl.Role() == EAlfWindowFloatingSpriteContainer ||
  6771             || aControl.Role() == EHuiWindowFloatingSpriteContainer ||
  6671             aControlGroup.IsTransformed())
  6772             aControlGroup.IsTransformed())
  6672             {
  6773             {
  6673             visualIsOpaque = EFalse;    
  6774             visualIsOpaque = EFalse;    
  6674             }
  6775             }
  6675     
  6776     
  6707     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  6808     for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--)
  6708         {                
  6809         {                
  6709         CHuiControlGroup& controlgroup = screen->iDisplay->Roster().ControlGroup(j);
  6810         CHuiControlGroup& controlgroup = screen->iDisplay->Roster().ControlGroup(j);
  6710         CHuiControl& control = controlgroup.Control(0);
  6811         CHuiControl& control = controlgroup.Control(0);
  6711 
  6812 
  6712         if (control.Role() == EAlfFpsIndicatorContainer || control.Role() == EAlfSessionContainer)
  6813         if (control.Role() == EHuiFpsIndicatorContainer || control.Role() == EHuiSessionContainer)
  6713             {
  6814             {
  6714             // FPS container doesn't contain canvas visuals and alfsession containers cannot have surfaces
  6815             // FPS container doesn't contain canvas visuals and alfsession containers cannot have surfaces
  6715             continue;
  6816             continue;
  6716             }
  6817             }
  6717         
  6818