# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273844773 -10800 # Node ID 6ce30188c5bfc96ee47f6c587cb498a1aba44245 # Parent f5bac0badc7e81ed1d4791136e0278219f8f2722 Revision: 201017 Kit: 201019 diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Fri May 14 16:46:13 2010 +0300 @@ -110,7 +110,9 @@ /** Flag to indicate whether surface is invisible (based on visibility calculation) */ EHuiCanvasFlagSurfaceInvisible = 0x400, /** Flag to indicate whether surface is visible (based on visibility calculation) */ - EHuiCanvasFlagSurfaceVisible = 0x800 + EHuiCanvasFlagSurfaceVisible = 0x800, + /** Flag to indicate avkon clearer window. This needs to be drawn, but excluded in the heuristics determining application screen coverage */ + EHuiCanvasFlagDistractionWindow = 0x1000 }; /** diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_core_toolkit_api/tsrc/bwins/testuiaifcoretoolkitu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiaccelerator_plat/alf_core_toolkit_api/tsrc/bwins/testuiaifcoretoolkitu.def Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_core_toolkit_api/tsrc/eabi/testuiaifcoretoolkitu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiaccelerator_plat/alf_core_toolkit_api/tsrc/eabi/testuiaifcoretoolkitu.def Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,31 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI28CTestUiAifBlocksManagerChild @ 2 NONAME + _ZTI28CTestUiAifBlocksTextureChild @ 3 NONAME + _ZTI31CTestUiAifBlocksHuiControlChild @ 4 NONAME + _ZTI35TTestUiAifBlocksHuiTextCommandChild @ 5 NONAME + _ZTI36TTestUiAifBlocksHuiGroupCommandChild @ 6 NONAME + _ZTI36TTestUiAifBlocksHuiImageCommandChild @ 7 NONAME + _ZTI36TTestUiAifBlocksHuiPointCommandChild @ 8 NONAME + _ZTI36TTestUiAifBlocksHuiTransCommandChild @ 9 NONAME + _ZTI36TTestUiAifBlocksHuiValueCommandChild @ 10 NONAME + _ZTI37TTestUiAifBlocksHuiActionCommandChild @ 11 NONAME + _ZTI37TTestUiAifBlocksHuiMarkerCommandChild @ 12 NONAME + _ZTI37TTestUiAifBlocksHuiVisualCommandChild @ 13 NONAME + _ZTI38TTestUiAifBlocksHuiControlCommandChild @ 14 NONAME + _ZTI42TTestUiAifBlocksHuiCustomEventCommandChild @ 15 NONAME + _ZTV28CTestUiAifBlocksManagerChild @ 16 NONAME + _ZTV28CTestUiAifBlocksTextureChild @ 17 NONAME + _ZTV31CTestUiAifBlocksHuiControlChild @ 18 NONAME + _ZTV35TTestUiAifBlocksHuiTextCommandChild @ 19 NONAME + _ZTV36TTestUiAifBlocksHuiGroupCommandChild @ 20 NONAME + _ZTV36TTestUiAifBlocksHuiImageCommandChild @ 21 NONAME + _ZTV36TTestUiAifBlocksHuiPointCommandChild @ 22 NONAME + _ZTV36TTestUiAifBlocksHuiTransCommandChild @ 23 NONAME + _ZTV36TTestUiAifBlocksHuiValueCommandChild @ 24 NONAME + _ZTV37TTestUiAifBlocksHuiActionCommandChild @ 25 NONAME + _ZTV37TTestUiAifBlocksHuiMarkerCommandChild @ 26 NONAME + _ZTV37TTestUiAifBlocksHuiVisualCommandChild @ 27 NONAME + _ZTV38TTestUiAifBlocksHuiControlCommandChild @ 28 NONAME + _ZTV42TTestUiAifBlocksHuiCustomEventCommandChild @ 29 NONAME + diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_extension_api/inc/alf/alfconstants.h --- a/uiaccelerator_plat/alf_extension_api/inc/alf/alfconstants.h Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfconstants.h Fri May 14 16:46:13 2010 +0300 @@ -1061,6 +1061,7 @@ { TFileName iFileName; TInt iGroupHandle; + TInt iHandle; }; /** * Use the following functions to serialize the RArray objects so diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h --- a/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h Fri May 14 16:46:13 2010 +0300 @@ -325,6 +325,13 @@ */ IMPORT_C void SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType = MAlfEffectObserver::EAlfEffectComplete ); + /** + * Define window, that should be considered transparent + * by fullscreen heuristic analysis. The window will + * be drawn normally. + */ + IMPORT_C void SetDistractionWindow(const RWindowTreeNode& aWindow, TInt aState = 1); + private: CAlfEffectObserver(); class CAlfEffectObserverData; diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/bwins/testplatalfvisualu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/bwins/testplatalfvisualu.def Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/eabi/testplatalfvisualu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/eabi/testplatalfvisualu.def Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,21 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI15CTestCAlfLayout @ 2 NONAME + _ZTI16CTestCAlfControl @ 3 NONAME + _ZTI19CTestCAlfDeckLayout @ 4 NONAME + _ZTI19CTestCAlfFlowLayout @ 5 NONAME + _ZTI19CTestCAlfGridLayout @ 6 NONAME + _ZTI19CTestCAlfLineVisual @ 7 NONAME + _ZTI19CTestCAlfMeshVisual @ 8 NONAME + _ZTI20CTestCAlfImageVisual @ 9 NONAME + _ZTI24CTestCAlfCurvePathLayout @ 10 NONAME + _ZTV15CTestCAlfLayout @ 11 NONAME + _ZTV16CTestCAlfControl @ 12 NONAME + _ZTV19CTestCAlfDeckLayout @ 13 NONAME + _ZTV19CTestCAlfFlowLayout @ 14 NONAME + _ZTV19CTestCAlfGridLayout @ 15 NONAME + _ZTV19CTestCAlfLineVisual @ 16 NONAME + _ZTV19CTestCAlfMeshVisual @ 17 NONAME + _ZTV20CTestCAlfImageVisual @ 18 NONAME + _ZTV24CTestCAlfCurvePathLayout @ 19 NONAME + diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.pkg --- a/uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.pkg Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.pkg Fri May 14 16:46:13 2010 +0300 @@ -73,8 +73,8 @@ "..\conf\ui_testplatalfvisualtextstyle.cfg"-"c:\Testframework\ui_testplatalfvisualtextstyle.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualtexture.cfg"-"c:\Testframework\tctestplatalfvisualtexture.cfg", FF ; FF stands for Normal file "..\conf\ui_testplatalfvisualtexture.cfg"-"c:\Testframework\ui_testplatalfvisualtexture.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatalfvisualtextureautosizeparams.cfg"-"c:\Testframework\tctestplatalfvisualtextureautosizeparams.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatalfvisualtextureautosizeparams.cfg"-"c:\Testframework\ui_testplatalfvisualtextureautosizeparams.cfg", FF ; FF stands for Normal file +"..\conf\tctestplatalfvisualtextureautosize.cfg"-"c:\Testframework\tctestplatalfvisualtextureautosize.cfg", FF ; FF stands for Normal file +"..\conf\ui_testplatalfvisualtextureautosize.cfg"-"c:\Testframework\ui_testplatalfvisualtextureautosize.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualshadowborderbrush.cfg"-"c:\Testframework\tctestplatalfvisualshadowborderbrush.cfg", FF ; FF stands for Normal file "..\conf\ui_testplatalfvisualshadowborderbrush.cfg"-"c:\Testframework\ui_testplatalfvisualshadowborderbrush.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualpropertyowner.cfg"-"c:\Testframework\tctestplatalfvisualpropertyowner.cfg", FF ; FF stands for Normal file @@ -89,8 +89,8 @@ "..\conf\ui_testplatalfvisualdecklayout.cfg"-"c:\Testframework\ui_testplatalfvisualdecklayout.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualdisplay.cfg"-"c:\Testframework\tctestplatalfvisualdisplay.cfg", FF ; FF stands for Normal file "..\conf\ui_testplatalfvisualdisplay.cfg"-"c:\Testframework\ui_testplatalfvisualdisplay.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatalfvisualdisplaybackgrounditem.cfg"-"c:\Testframework\tctestplatalfvisualdisplaybackgrounditem.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatalfvisualdisplaybackgrounditem.cfg"-"c:\Testframework\ui_testplatalfvisualdisplaybackgrounditem.cfg", FF ; FF stands for Normal file +"..\conf\tctestplatalfvisualdisplaybgitem.cfg"-"c:\Testframework\tctestplatalfvisualdisplaybgitem.cfg", FF ; FF stands for Normal file +"..\conf\ui_testplatalfvisualdisplaybgitem.cfg"-"c:\Testframework\ui_testplatalfvisualdisplaybgitem.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualdropsshadow.cfg"-"c:\Testframework\tctestplatalfvisualdropsshadow.cfg", FF ; FF stands for Normal file "..\conf\ui_testplatalfvisualdropsshadow.cfg"-"c:\Testframework\ui_testplatalfvisualdropsshadow.cfg", FF ; FF stands for Normal file "..\conf\tctestplatalfvisualdropsshadowbrush.cfg"-"c:\Testframework\tctestplatalfvisualdropsshadowbrush.cfg", FF ; FF stands for Normal file diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/init/testplatalfvisual.ini --- a/uiaccelerator_plat/alf_visual_api/tsrc/init/testplatalfvisual.ini Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/init/testplatalfvisual.ini Fri May 14 16:46:13 2010 +0300 @@ -94,7 +94,7 @@ TestCaseFile= c:\testframework\tctestplatalfvisualtextstylemanager.cfg TestCaseFile= c:\testframework\tctestplatalfvisualtextstyle.cfg TestCaseFile= c:\testframework\tctestplatalfvisualtexture.cfg -TestCaseFile= c:\testframework\tctestplatalfvisualtextureautosizeparams.cfg +TestCaseFile= c:\testframework\tctestplatalfvisualtextureautosize.cfg TestCaseFile= c:\testframework\tctestplatalfvisualshadowborderbrush.cfg TestCaseFile= c:\testframework\tctestplatalfvisualpropertyowner.cfg TestCaseFile= c:\testframework\tctestplatalfvisualroster.cfg @@ -104,7 +104,7 @@ TestCaseFile= c:\testframework\tctestplatalfvisualcurvepathlayout.cfg TestCaseFile= c:\testframework\tctestplatalfvisualdecklayout.cfg TestCaseFile= c:\testframework\tctestplatalfvisualdisplay.cfg -TestCaseFile= c:\testframework\tctestplatalfvisualdisplaybackgrounditem.cfg +TestCaseFile= c:\testframework\tctestplatalfvisualdisplaybgitem.cfg TestCaseFile= c:\testframework\tctestplatalfvisualdropsshadow.cfg TestCaseFile= c:\testframework\tctestplatalfvisualdropsshadowbrush.cfg TestCaseFile= c:\testframework\tctestplatalfvisualenv.cfg diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksm3gmesh.cpp --- a/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksm3gmesh.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksm3gmesh.cpp Fri May 14 16:46:13 2010 +0300 @@ -41,6 +41,11 @@ // Print to log file iLog->Log( KTestAlfM3GMeshLoadSceneL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); + return KErrNone; +/* Not supported at the moment CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); vVisual->CreateMeshL( EAlfMeshTypeM3G ); CAlfM3GMesh* vMesh = vVisual->M3GMesh(); @@ -55,7 +60,7 @@ { return KErrNone; } - +*/ } // End of file diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmesh.cpp --- a/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmesh.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmesh.cpp Fri May 14 16:46:13 2010 +0300 @@ -40,6 +40,10 @@ // Print to log file iLog->Log( KTestAlfMeshSetAndGetL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); vVisual->CreateMeshL( EAlfMeshTypeM3G ); CAlfMesh& vMesh = vVisual->Mesh(); @@ -51,7 +55,7 @@ vMesh.StartAnimationController( iAlfCtl->Id() ); vMesh.StopAnimationController( iAlfCtl->Id() ); vMesh.Reset(); - +*/ return KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmeshvisual.cpp --- a/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmeshvisual.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmeshvisual.cpp Fri May 14 16:46:13 2010 +0300 @@ -107,9 +107,13 @@ // Print to log file iLog->Log( KTestAlfMeshVisualAddNewL ); - CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment + CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); STIF_ASSERT_NOT_NULL( vVisual ); - +*/ return KErrNone; } @@ -125,6 +129,10 @@ // Print to log file iLog->Log( KTestAlfMeshVisualSetAndGetL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); vVisual->CreateMeshL( EAlfMeshTypeM3G ); TUid vUid = { 0x00000000 }; @@ -154,7 +162,7 @@ vVisual->PitchAngle(); vVisual->SetScale( vValue ); vVisual->Scale(); - +*/ return KErrNone; } @@ -170,13 +178,17 @@ // Print to log file iLog->Log( KTestAlfMeshVisualForVisualL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); _LIT8( KTest, "tset" ); TBuf8 vBuf( KTest ); vVisual->FindTag( vBuf ); vVisual->UpdateChildrenLayout(); vVisual->RemoveAndDestroyAllD(); - +*/ return KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksproceduralmesh.cpp --- a/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksproceduralmesh.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksproceduralmesh.cpp Fri May 14 16:46:13 2010 +0300 @@ -41,6 +41,10 @@ // Print to log file iLog->Log( KTestProMeshMakeMethodsL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment CAlfMeshVisual* meshVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); meshVisual->CreateMeshL( EAlfMeshTypeProcedural ); CAlfProceduralMesh* proMesh = meshVisual->ProceduralMesh(); @@ -48,7 +52,7 @@ proMesh->MakeCubeL( 1, 1, 1, 1 ); proMesh->MakeSphereL( 1, 1, 1 ); proMesh->MakeTorusL( 1, 1, 1, 1, 1 ); - +*/ return KErrNone; } @@ -65,13 +69,17 @@ // Print to log file iLog->Log( KTestProMeshMaterialMethodsL ); + // Mesh not supported at the moment + STIF_ASSERT_LEAVES_WITH( KErrNotSupported, + CAlfMeshVisual::AddNewL( *iAlfCtl ) ); +/* Not supported at the moment CAlfMeshVisual* meshVisual = CAlfMeshVisual::AddNewL( *iAlfCtl ); meshVisual->CreateMeshL( EAlfMeshTypeProcedural ); CAlfProceduralMesh* proMesh = meshVisual->ProceduralMesh(); STIF_ASSERT_NOT_NULL( proMesh ); TAlfMaterial material = proMesh->Material(); proMesh->SetMaterial( material ); - +*/ return KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockssymbiansbdrawer.cpp --- a/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockssymbiansbdrawer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockssymbiansbdrawer.cpp Fri May 14 16:46:13 2010 +0300 @@ -72,6 +72,14 @@ TPoint( KTestDisplayPosX, KTestDisplayPosY ), TSize( KTestDisplayWidth, KTestDisplayHeight ) ); + TRAPD( trapError, + iAlfEnv->NewDisplayL( + dispRect, 0, NULL, + CAlfDisplay::EDisplayOffScreenBuffer, + KTestScreenBufferUid ) ); + // CAlfDisplay::EDisplayOffScreenBuffer is not supported for new display. + STIF_ASSERT_EQUALS( KErrNotSupported, trapError ); +/** Deprecated test CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL( dispRect, 0, NULL, CAlfDisplay::EDisplayOffScreenBuffer, @@ -114,6 +122,7 @@ CleanupStack::PopAndDestroy( bitmap ); CleanupStack::PopAndDestroy( scrBuffer ); CleanupStack::PopAndDestroy( observer ); +*/ return KErrNone; } @@ -135,6 +144,14 @@ TPoint( KTestDisplayPosX, KTestDisplayPosY ), TSize( KTestDisplayWidth, KTestDisplayHeight ) ); + TRAPD( trapError, + iAlfEnv->NewDisplayL( + dispRect, 0, NULL, + CAlfDisplay::EDisplayOffScreenBuffer, + KTestScreenBufferUid ) ); + // CAlfDisplay::EDisplayOffScreenBuffer is not supported for new display. + STIF_ASSERT_EQUALS( KErrNotSupported, trapError ); +/** Deprecated test CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL( dispRect, 0, NULL, CAlfDisplay::EDisplayOffScreenBuffer, @@ -155,7 +172,7 @@ drawer->GetBufferBitmaps( bitmap, mask ); CleanupStack::PopAndDestroy( scrBuffer ); CleanupStack::PopAndDestroy( observer ); - +*/ return KErrNone; } @@ -176,6 +193,14 @@ TPoint( KTestDisplayPosX, KTestDisplayPosY ), TSize( KTestDisplayWidth, KTestDisplayHeight ) ); + TRAPD( trapError, + iAlfEnv->NewDisplayL( + dispRect, 0, NULL, + CAlfDisplay::EDisplayOffScreenBuffer, + KTestScreenBufferUid ) ); + // CAlfDisplay::EDisplayOffScreenBuffer is not supported for new display. + STIF_ASSERT_EQUALS( KErrNotSupported, trapError ); +/** Deprecated test CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL( dispRect, 0, NULL, CAlfDisplay::EDisplayOffScreenBuffer, @@ -195,7 +220,7 @@ drawer = NULL; CleanupStack::PopAndDestroy( scrBuffer ); CleanupStack::PopAndDestroy( observer ); - +*/ return KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def --- a/uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def Fri May 14 16:46:13 2010 +0300 @@ -49,4 +49,5 @@ ??1CAlfEffectObserver@@UAE@XZ @ 48 NONAME ; CAlfEffectObserver::~CAlfEffectObserver(void) ?SubscribeCallbackL@CAlfEffectObserver@@QAEXPAVMAlfEffectObserver@1@HH@Z @ 49 NONAME ; void CAlfEffectObserver::SubscribeCallbackL(class CAlfEffectObserver::MAlfEffectObserver *, int, int) ?GetListOfWindowGroupsWSurfaces@RAlfBridgerClient@@QAEHPAV?$RArray@H@@@Z @ 50 NONAME ; int RAlfBridgerClient::GetListOfWindowGroupsWSurfaces(class RArray *) + ?SetDistractionWindow@CAlfEffectObserver@@QAEXABVRWindowTreeNode@@H@Z @ 51 NONAME ; void CAlfEffectObserver::SetDistractionWindow(class RWindowTreeNode const &, int) diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def --- a/uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def Fri May 14 16:46:13 2010 +0300 @@ -72,4 +72,5 @@ _ZN18CAlfEffectObserverD2Ev @ 71 NONAME _ZN18CAlfEffectObserver18SubscribeCallbackLEPNS_18MAlfEffectObserverEii @ 72 NONAME _ZN17RAlfBridgerClient30GetListOfWindowGroupsWSurfacesEP6RArrayIiE @ 73 NONAME + _ZN18CAlfEffectObserver20SetDistractionWindowERK15RWindowTreeNodei @ 74 NONAME diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp --- a/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp Fri May 14 16:46:13 2010 +0300 @@ -295,7 +295,9 @@ } case KAlfCompOpBindSourceToToken: { +#ifdef _ALF_LOGGING RDebug::Print(_L("ptr0: %d, Target %d, Flags %d, combinedtarget"), ptr[0], ptr[1], ptr[2]); +#endif // #ifdef _ALF_LOGGING if( ptr[1] != 0) // add binding information for new host to given target with permitted operations { iHostBindingsHash.Insert(*ptr, ptr[1]); @@ -479,7 +481,9 @@ void CAlfCompositionSource::ConstructL(TInt aWsHandle, TInt aGroupHandle, TInt aScreenNumber) { iData = CAlfCompositionSourceData::NewL(); +#ifdef _ALF_LOGGING RDebug::Print(_L("CAlfCompositionClientBase::ConstructL - %d"), iData ); +#endif // #ifdef _ALF_LOGGING User::LeaveIfError( SendEvent(KAlfCompositionSourceScreenNumber, &aScreenNumber, sizeof(TInt))); @@ -698,7 +702,9 @@ void CAlfCompositionHost::ConstructL(TInt aToken, TInt aKey) { iData = CAlfCompositionSourceData::NewL(); +#ifdef _ALF_LOGGING RDebug::Print(_L("CAlfCompositionClientBase::ConstructL - %d"), iData ); +#endif // #ifdef _ALF_LOGGING TInt array[] = { 0, aToken, aKey }; TInt result = SendEvent(KAlfCompOpBindSourceToToken, array, sizeof(array)); @@ -1237,6 +1243,7 @@ { public: virtual void Remove(CAlfSignalObserver* aObserver) = 0; + virtual RAlfBridgerClient& Client() = 0; }; NONSHARABLE_CLASS(CAlfEffectObserver::CAlfEffectObserverData): public CBase, public MAlfEffectObserverData @@ -1245,6 +1252,7 @@ void SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType = MAlfEffectObserver::EAlfEffectComplete ); ~CAlfEffectObserverData(); void Remove(CAlfSignalObserver* aObserver); + RAlfBridgerClient& Client(); // data RAlfBridgerClient iClient; @@ -1261,20 +1269,40 @@ CActiveScheduler::Add(this); SetActive(); } - - void DoCancel(){} // do not... + + ~CAlfSignalObserver() + { + Cancel(); + } + + private: + void DoCancel() + { + if (iOwner) + { + iOwner->Client().SendSynch(EAlfCompleteSignal, TIpcArgs(iHandle, iType)); + } + } + + // just to prohibit cancel outside destructor + void Cancel() + { + CActive::Cancel(); + } + void RunL() { iObserver->HandleEffectCallback(iType, iHandle, iStatus.Int()); iOwner->Remove(this); } - MAlfEffectObserverData* iOwner; - CAlfEffectObserver::MAlfEffectObserver* iObserver; - TInt iHandle; - TInt iType; - TIpcArgs iArgs; + public: + MAlfEffectObserverData* iOwner; + CAlfEffectObserver::MAlfEffectObserver* iObserver; + TInt iHandle; + TInt iType; + TIpcArgs iArgs; }; void CAlfEffectObserver::CAlfEffectObserverData::SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType) @@ -1288,15 +1316,24 @@ CAlfEffectObserver::CAlfEffectObserverData::~CAlfEffectObserverData() { + iObservers.ResetAndDestroy(); + iObservers.Close(); iClient.Close(); // destroys signals - iObservers.ResetAndDestroy(); } - + +RAlfBridgerClient& CAlfEffectObserver::CAlfEffectObserverData::Client() + { + return iClient; + } + void CAlfEffectObserver::CAlfEffectObserverData::Remove(CAlfSignalObserver* aObserver) { TInt index = iObservers.Find(aObserver); - iObservers.Remove(index); - delete aObserver; + if (index != KErrNotFound) + { + iObservers.Remove(index); + } + delete aObserver; } EXPORT_C CAlfEffectObserver* CAlfEffectObserver::NewL() @@ -1311,7 +1348,7 @@ EXPORT_C CAlfEffectObserver::~CAlfEffectObserver() { - delete iData; + delete iData; } EXPORT_C TInt CAlfEffectObserver::ActiveEffectsCount() @@ -1324,11 +1361,18 @@ iData->SubscribeCallbackL(aObserver, aHandle, aType ); } +EXPORT_C void CAlfEffectObserver::SetDistractionWindow(const RWindowTreeNode& aWindow, TInt aState) + { + if (!&aWindow) + { + return; + } + iData->iClient.SendSynch(EAlfSetDistractionWindow, TIpcArgs(aWindow.WindowGroupId(), aWindow.ClientHandle(), aState)); + } + CAlfEffectObserver::CAlfEffectObserver() { } - +//end of file - -//end of file diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h Fri May 14 16:46:13 2010 +0300 @@ -399,11 +399,23 @@ */ void Synchronize(TInt aId); + void SetCompositionModified() + { + iCompositionModified = ETrue; + } + public: // From CActive void RunL(); void DoCancel(); - + TInt RunError(TInt aError) + { + // will likely lead to inconsistent state and thus reset anyway + RDebug::Print(_L("CAlfRsSendBuffer::RunError( %d )"),aError); + aError -= (aError); + return aError; //KErrNone; + } + private: /** @@ -818,5 +830,6 @@ TBool iLayersEnabled; #endif TInt iOrientation; + TBool iCompositionModified; }; #endif /*CALFSENDBUFFER_H_*/ diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Fri May 14 16:46:13 2010 +0300 @@ -209,6 +209,12 @@ __ALFLOGSTRING2("CAlfRenderStage::End. iScreenNumber=%d, aFinished=%d", iScreenNumber,aFinished); if (iAlfSendBuffer->FrameContainsDataL() ) { + // set up the link for composition rs + MAlfCompositionController* compcntrl = ( MAlfCompositionController*)ResolveObjectInterface(KAlfCompositionControllerIfUid); + if (compcntrl) + { + compcntrl->AlfBridgeCallback(MAlfBridge::EEndCallbackInitiated,0); + } TRAP( err, iAlfSendBuffer->SendL( aFinished )); } else diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Fri May 14 16:46:13 2010 +0300 @@ -1321,13 +1321,14 @@ TInt lastWrittenOffset( iOffset ); Commit(); - TIpcArgs args( lastWrittenOffset ); - // __ALFLOGSTRING1("CAlfRsSendBuffer::SendL, offset %d ( TRequestStatus)"), lastWrittenOffset ); + TIpcArgs args( lastWrittenOffset, iCompositionModified ); + //RDebug::Printf("CAlfRsSendBuffer::SendL, offset %d",lastWrittenOffset ); if ( iFlushBufferTimer ) { iFlushBufferTimer->Cancel(); } iAlfBridgerClient->SendAsynchronous( EAlfBridgerAsyncronousData, args, iStatus ); + iCompositionModified = EFalse; if ( aStatus ) // aStatus is null, if this was event notification and not drawing { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/Client/src/alfdirectclient.cpp --- a/uiacceltk/hitchcock/Client/src/alfdirectclient.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/Client/src/alfdirectclient.cpp Fri May 14 16:46:13 2010 +0300 @@ -118,8 +118,6 @@ EXPORT_C RAlfDirectClient::RAlfDirectClient() : RAlfClientBase(KAlfServiceUid.iUid) { - // elegant SW design, right - TRAP_IGNORE(OpenL()); } // --------------------------------------------------------------------------- diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/Client/src/alfvisual.cpp --- a/uiacceltk/hitchcock/Client/src/alfvisual.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/Client/src/alfvisual.cpp Fri May 14 16:46:13 2010 +0300 @@ -1611,6 +1611,7 @@ TBuf8<1> dumDum; TAlfVisualEffectParams params; params.iFileName = aEffectFile; + params.iHandle = Identifier(); TPckg paramsPckg(params); @@ -1640,6 +1641,7 @@ TAlfVisualEffectParams params; params.iFileName = aEffectFile; params.iGroupHandle = aGroupHandle; + params.iHandle = Identifier(); TPckg paramsPckg(params); diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/CommonInc/alfbridgecommands.h --- a/uiacceltk/hitchcock/CommonInc/alfbridgecommands.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/CommonInc/alfbridgecommands.h Fri May 14 16:46:13 2010 +0300 @@ -83,6 +83,7 @@ EAlfDSSetWindowArea, EAlfDSSetTransparencyAlphaChannel, EAlfDSIncludeToVisibilityCalculation, + EAlfDSSetDistractionWindow, KUnInitialized }; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h --- a/uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h Fri May 14 16:46:13 2010 +0300 @@ -94,6 +94,7 @@ EAlfBridgeCreated, // data: MAlfBridge EAlfNativeWindowCreated, // data: TAlfNativeWindowData ESetWindowTreeObserver, // data: MAlfCompositionAgnosticWindowTreeObserver* + EEndCallbackInitiated, // Renderstage above us has started progressing End(), i.e. rendering UI surface, no data EExternalize, // externalize complete state data: Todo EInternalize // reset the state from data data: Todo }; @@ -102,6 +103,7 @@ virtual void WriteIntsL(TUint8 aCommand, TInt aCount, TInt* aArray) = 0; virtual RAlfBridgerClient* Client() = 0; virtual void SetOrientation(TInt aOrientation) = 0; + virtual void SetCompositionModified() = 0; }; /** diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Fri May 14 16:46:13 2010 +0300 @@ -298,7 +298,18 @@ void LayoutSwitchComplete(); RAlfBridgerClient* BridgerClient(); - + + /** + * Refresh requested. This is meant to be used by alfstreamerbridge when + * frame has ended. + */ + void RefreshNow(TBool aSyncWait); + + /** + * Asynchronous refresh when in SW rendering mode. + */ + void AsynchRefresh(); + private: @@ -341,6 +352,16 @@ void HandleGfxStopControlEffectsL( TAlfBridgerData data ); /** + * HandleSetDistractionWindowL + * + * Define or undefine, window that should be discarded in fullscreen + * heuristic analysus. + * + * Used by avkon to mark CAknLocalScreenClearer window. + */ + void HandleSetDistractionWindowL( TAlfBridgerData data ); + + /** * RemoveEffectFromApp * * Removes effects on appui. @@ -801,6 +822,9 @@ void SetCursorTimerL(TUint aTime = 0, CHuiVisual* aCursor = 0); TBool IsAlfOriginatedWindow(CHuiCanvasVisual& aVisual); + + TBool IsFullScreenDrawnRecursiveAlfContent(CHuiVisual* aVisual, TRect& aFullScreen); + // Experimental TBool IsFullScreenDrawnRecursive( CHuiLayout* aLayout, @@ -991,6 +1015,9 @@ TBool iHomeScreenWallpaperWindowFound; TBool iBgAnimHidden; + + TBool iHomeScreenVisible; + TInt iHomeScreenPSValue; CAlfLayoutSwitchEffectCoordinator* iLayoutSwitchEffectCoordinator; TInt iAlfSecureId; @@ -1009,6 +1036,8 @@ TInt activevisualcount; TInt passivevisualcount; #endif + + CPeriodic* iManualRefreshTimer; }; #endif // __ALF_BRIDGE_H__ \ No newline at end of file diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h Fri May 14 16:46:13 2010 +0300 @@ -205,11 +205,22 @@ NONSHARABLE_CLASS(CControlEffectState ) : public CEffectState { public: - + TUint32 iClientHandle; TUint32 iClientGroupHandle; - + + enum TDistractionType + { + ENoOperation = 0, + ESetDistractionWindow = 100, + ERemoveDistractionWindow + }; + + TDistractionType iSetDistractionWindow; + void ConstructL(TInt aAction, RMemReadStream& aStream); + + void ConstructL(TUint32 aClientHandle, TUint32 aClientGroupHandle, TBool aSetDistractionWindow); }; NONSHARABLE_CLASS(CFullScreenEffectState ) : public CEffectState diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Fri May 14 16:46:13 2010 +0300 @@ -83,7 +83,7 @@ void RequestPacketEndCallback( TInt aOffset ); - void RequestFrameEndCallback(); + void RequestFrameEndCallback(TBool aCompositionModified); RHashMap iNodeHashArray; @@ -144,7 +144,7 @@ * * @since S60 ?S60_version */ - void ExecuteCommandsL(); + void ExecuteCommandsL(TBool aCompositionModified = EFalse); // Commands from window tree oberver at renderstage void DoNodeCreatedL(); diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h Fri May 14 16:46:13 2010 +0300 @@ -253,7 +253,7 @@ * * @since S60 5.0 */ - void StartNewBlock(); + void StartNewBlock(TBool aCompositionModified); /** * StartNewBlock diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Fri May 14 16:46:13 2010 +0300 @@ -45,7 +45,8 @@ EAlfQueueRequestBGSessions, EAlfGetNumberOfActiveEffects, EAlfRequestSignal, - EAlfCompleteSignal + EAlfCompleteSignal, + EAlfSetDistractionWindow }; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Fri May 14 16:46:13 2010 +0300 @@ -148,30 +148,42 @@ void RunL() { iSema.Wait(); + TInt position = iPosition; + TInt parentId = iParentIdentifier; + iSema.Signal(); + TBool goOn = EFalse; if (iStatus.Int() == KErrNone) { - TRAPD(err, DoAdjustPositionL()); - if (err) - { - __ALFLOGSTRING1("ALF: WG Parent not found, err %d", err); - } - } + do { + TRAPD(err, DoAdjustPositionL(position, parentId)); + if (err) + { + __ALFLOGSTRING1("ALF: WG Parent not found, err %d", err); + } + iSema.Wait(); + goOn = (iPosition != position || iParentIdentifier != parentId); + position = iPosition; + parentId = iParentIdentifier; + iSema.Signal(); + } while(goOn); + } + iSema.Wait(); DoActivate(); iSema.Signal(); } - void DoAdjustPositionL() + void DoAdjustPositionL(TInt aPosition, TInt aParentIdentifier) { - __ALFLOGSTRING1("ALF: DoAdjustPositionL() %d", iPosition); + __ALFLOGSTRING1("ALF: DoAdjustPositionL() %d", aPosition); - if (iPosition == CAlfAppServer::EAbsoluteBackground) // just for convenience + if (aPosition == CAlfAppServer::EAbsoluteBackground) // just for convenience { __ALFLOGSTRING("CAlfEventCatcher::DoAdjustPositionL - CAlfAppServer::EAbsoluteBackground"); iWindowGroup.SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront); iWsSession.Flush(); return; } - else if (iPosition == CAlfAppServer::EAlfWindowSize ) // just for developer convenience + else if (aPosition == CAlfAppServer::EAlfWindowSize ) // just for developer convenience { __ALFLOGSTRING("CAlfEventCatcher::DoAdjustPositionL - CAlfAppServer::EAlfWindowSize"); // update window size when layout changes @@ -183,7 +195,7 @@ TInt parentPriority = - iWsSession.GetWindowGroupOrdinalPriority(iParentIdentifier); + iWsSession.GetWindowGroupOrdinalPriority(aParentIdentifier); // perhaps we should maintain wg-list elsewhere CArrayFixFlat* wgs = new (ELeave) CArrayFixFlat(1); @@ -195,9 +207,9 @@ TInt wgCount = wgs->Count(); for (TInt i = 0; i < wgCount; i++) { - if (iParentIdentifier == wgs->At(i)) + if (aParentIdentifier == wgs->At(i)) { - if ( iPosition == CAlfAppServer::EOnTopOfParent ) + if ( aPosition == CAlfAppServer::EOnTopOfParent ) { pos = i; } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Fri May 14 16:46:13 2010 +0300 @@ -91,13 +91,21 @@ const TInt KEffectCleanupDelayInMs = 10; const TInt KPreventingCollisionOfIdsInSynchDrawRequests = 35; - +const TInt KRequestFrameSynchForComposition = -1; // bogus + +const TInt KAlfFSTaskSwapperAppStart = 1507; _LIT8(KAlfWindowGroupContainerControlTag, "WGROUP"); #define USE_APPLICATION_ENDFULLSCREEN_TIMEOUT // This debug option shows window groups in a grid //#define ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER +// Timeout for manual refresh +const TInt KAlfManualRefreshTimeout = 35000; + +_LIT_SECURITY_POLICY_PASS(KAlwaysPass); +const TUid KPSSysCategory = { KUidSystemCategoryValue }; +const TUint32 KAlfPSKeyHSVisible = 0x2002EA91; const TInt KFadeAction = 6000; @@ -174,6 +182,7 @@ #endif delete iCursorTimer; delete iLayoutSwitchEffectCoordinator; + delete iManualRefreshTimer; } @@ -215,6 +224,12 @@ iOrphanStorage->ConstructL(); RegisterFadeEffectL(); + + iManualRefreshTimer = CPeriodic::NewL(CActive::EPriorityStandard); + + RProperty::Define( KPSSysCategory, KAlfPSKeyHSVisible, RProperty::EInt, KAlwaysPass, KAlwaysPass ); + RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, 0 ); + } // --------------------------------------------------------------------------- @@ -787,6 +802,7 @@ // First HandleGfxEvent, then clear iWaitingWindowGroup. + __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - try triggering effect 0x%x", layout); TBool failed = HandleGfxEventL( *iFullScreenEffectData, layout, fromLayout ); if ( iFullScreenEffectData ) { @@ -795,6 +811,7 @@ if ( failed ) { // Effect failed, reset state + __ALFFXLOGSTRING1("CAlfBridge::CreateControlGroupL - effect failed on layout 0x%x", layout); HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData } } @@ -1355,7 +1372,7 @@ CAlfScreen* screen = iAlfScreens[aScreenNumber]; TRect fullscreen = TRect(TPoint(0,0), screen->Size()); - TBool fadeEffectInScreen = EFalse; + TBool checkFadeEffectInScreen = EFalse; // Prepare SW render target (if needed) @@ -1376,6 +1393,7 @@ iBgSurfaceFound = EFalse; iHomeScreenWallpaperWindowFound = EFalse; + iHomeScreenVisible = EFalse; // Check if effect group has an effect with opaque hint. CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup); @@ -1448,20 +1466,21 @@ if(iAppUi) { topMostAlfSrvSession = iAppUi->SrvSessionForControlGroup(controlgroup); - } - TInt clientWindowGroupId = topMostAlfSrvSession->ClientWindowGroup(); - __ALFLOGSTRING1("Alf Application: clientWindowGroupId %d", clientWindowGroupId); - // checking the case if there are multiple alf application openend. - if (clientWindowGroupId == iAppUi->GetLastActiveClient()) - { - alfWindowGroupFoundVisible = ETrue; - hostContainer->ClearFlags(EHuiVisualFlagInactive); - - // just add the rect to covered region because alf draws solid background - iTempRegion.AddRect(fullscreen); - iTempRegion.Tidy(); - fullscreenCovered = ETrue; - alfClientWindowGroupVisible = EFalse; // change flag so that we don't go in this branch again + + TInt clientWindowGroupId = topMostAlfSrvSession->ClientWindowGroup(); + __ALFLOGSTRING1("Alf Application: clientWindowGroupId %d", clientWindowGroupId); + // checking the case if there are multiple alf application openend. + if (clientWindowGroupId == iAppUi->GetLastActiveClient()) + { + __ALFLOGSTRING1("Alf Application: GetLastActiveClient %d", iAppUi->GetLastActiveClient()); + alfWindowGroupFoundVisible = ETrue; + hostContainer->ClearFlags(EHuiVisualFlagInactive); + // just add the rect to covered region because alf draws solid background + iTempRegion.AddRect(fullscreen); + iTempRegion.Tidy(); + fullscreenCovered = ETrue; + alfClientWindowGroupVisible = EFalse; // change flag so that we don't go in this branch again + } } } else // else put as inactive @@ -1507,21 +1526,12 @@ #endif } - // if native alf app is found visible we can assume it should cover whole screen with alfcontent - // this is for embedded native alf application cases. Otherwise chained window groups tend to - // flicker from time to time - if(!fullscreenCovered && controlgroup.iAlfApp) - { - alfClientWindowGroupVisible = ETrue; - } - - TBool subTreeCovered = EFalse; TBool hasLayers = EFalse; TBool hasActiveVisualsInVisualTree(EFalse); - //embedded native alf application assumes that it should cover whole screen with alfcontent + // native alf application assumes that it should cover whole screen with alfcontent // it makes alfeventwindowgroup as inactive and fading is not done on alf content // this call is exculsive for alfeventwindowgroup if (alfClientWindowGroupVisible && (controlgroup.ResourceId() == iAlfWindowGroupNodeId)) @@ -1531,7 +1541,6 @@ hasActiveVisualsInVisualTree, fullscreen, screen, subTreeCovered, hasLayers, IsVisualOpaque(*layout),alfClientWindowGroupVisible ); } - else { hasActiveVisualsInVisualTree = @@ -1543,11 +1552,21 @@ TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree); - if(!fullscreenCovered && alfClientWindowGroupVisible) - { - iTempRegion.AddRect(fullscreen); - iTempRegion.Tidy(); - fullscreenCovered = ETrue; + // if native alf app is found visible and the client it self is not covering whole screen, we can assume that alf content + // fills the rest. + // this is for embedded native alf application cases. Otherwise chained window groups tend to + // flicker from time to time + // also if alfcontent is not hided below avkon content the fading effect would reveal alfconent + if(controlgroup.iAlfApp) + { + fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); + if(!fullscreenCovered ) + { + iTempRegion.AddRect(fullscreen); + iTempRegion.Tidy(); + fullscreenCovered = ETrue; + alfClientWindowGroupVisible = ETrue; + } } // If root visuals effect is marked as opaque, then add whole screen area as covered. @@ -1566,7 +1585,7 @@ // are no more needed get removed. if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree)) { - fadeEffectInScreen = ETrue; + checkFadeEffectInScreen = ETrue; // Prepare fade effects to whole visual tree below layout PrepareFadeEffects( *layout ); @@ -1653,7 +1672,22 @@ } } } - + + if (iHomeScreenPSValue != iHomeScreenVisible) + { + TInt value = iHomeScreenVisible; + if ((iHomeScreenVisible && iHomeScreenWallpaperWindowFound) || iBgAnimHidden) + { + value = EFalse; + } + if (value != iHomeScreenPSValue) + { + RProperty::Set( KPSSysCategory, KAlfPSKeyHSVisible, value ); + iHomeScreenPSValue = value; + } + } + + if ( iSwRenderingEnabled ) { screen->iDisplay->SetForegroundTextureOptions( alfWindowGroupFoundVisible ); @@ -1662,7 +1696,7 @@ // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others // would clear the screen areas where they do not really draw. - if (fadeEffectInScreen) + if (checkFadeEffectInScreen) { TBool firstFadedWindowGroupFound = EFalse; for (TInt j=0; jiDisplay->Roster().Count() - screen->FixedControlGroupCount(); j++) // skip the topmost (effect) layer @@ -1851,6 +1885,7 @@ // We found an _ACTIVE_ window in homescreens controlgroup if (aControlGroup.SecureId() == 0x102750F0) { + iHomeScreenVisible = ETrue; // which is fully opaque, and visible ... if ( (canvasVisual->iOpacity.Now() > 0.001) && canvasVisual->Flags() & EHuiVisualFlagOpaqueHint) { @@ -2061,9 +2096,17 @@ // Determine if surface is visible. TBool surfaceWasVisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceVisible ); TBool surfaceWasInvisible = ( canvasVisual->CanvasFlags() & EHuiCanvasFlagSurfaceInvisible ); - __ALFLOGSTRING2("CAlfBridge::HideTarget: %d %d", aVisible, surfaceWasVisible); + __ALFLOGSTRING2("CAlfBridge::HandleLayerVisibility aVisible %d surfaceWasVisible %d", aVisible, surfaceWasVisible); TBool forcedUpdate = !surfaceWasVisible && !surfaceWasInvisible; + +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + if ( !aVisible && canvasVisual->LayerUsesAlphaFlag() ) + { + __ALFLOGSTRING( "CAlfBridge::HandleLayerVisibility LayerUsesAlphaFlag setting visible" ); + aVisible = ETrue; + } +#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS if ( !aVisible && ( forcedUpdate || surfaceWasVisible ) ) { @@ -2467,6 +2510,11 @@ iHuiEnv->ContinueRefresh(); break; } + case EAlfDSSetDistractionWindow: + { + HandleSetDistractionWindowL( data ); + break; + } case KUnInitialized: { __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received KUnInitialized: %d - CRITICAL ERROR!",data.iOp); @@ -2478,6 +2526,8 @@ __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received Unknown op: %d",data.iOp); } } + + AsynchRefresh(); } } @@ -2606,14 +2656,10 @@ viz->SetCanvasFlags(EHuiCanvasFlagEnableCanvasClipping); viz->SetParentCanvas(parentViz); } - else - { - __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Parent not found for visual %d!",windowNodeId); - } } else { - __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Control group not found for visual %d!",windowNodeId); + __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Control group not found for visual 0x%x!",windowNodeId); } break; @@ -2662,6 +2708,16 @@ if (layout) layout->Remove(aVisual); aVisual->Owner().Remove(aVisual); + RPointerArray familyTree; + ListFamilyTreeL(familyTree, (CHuiLayout*)aVisual); // recursively dig the family tree + for (TInt familyIndex = 1; familyIndex < familyTree.Count();familyIndex++) + { + CHuiLayout* lVisual = familyTree[familyIndex]; + lVisual->Owner().Remove(lVisual); + iOrphanStorage->AppendL( lVisual ); + } + familyTree.Close(); + __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual); // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then // application is exited. EHuiVisualFlagDrawOnlyAsExternalContent is indication that @@ -4483,6 +4539,7 @@ case AknTransEffect::EApplicationStartRect: case AknTransEffect::EApplicationStartSwitch: case AknTransEffect::EApplicationStartSwitchRect: + case KAlfFSTaskSwapperAppStart: { aToLayout->iOpacity.Set(0.0f); // these are meant for applications that are not yet ready to be drawn, but possible already on the foreground FreezeLayoutUntilEffectDestroyedL(aFromLayout, aEvent.iHandle); @@ -4789,16 +4846,12 @@ __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - WARNING - Another fullscreen effect to different app. Deleting the previous ongoing effect"); RemoveEffectFromApp(iFullScreenEffectData->iToSecureId, iFullScreenEffectData->iToWg);// Fullscreen effect for another app has arrived, and the previous has not finished and abort effect was not called. RemoveEffectFromApp(iFullScreenEffectData->iFromSecureId, iFullScreenEffectData->iFromWg); + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffectsL - Effect request has changed from appUid 0x%x to 0x%x. Cancel previous effect.", iFullScreenEffectData->iToAppId, fxData->iToAppId); + RemoveEffectFromApp(iFullScreenEffectData->iToAppId); // Fullscreen effect for another } - if (iFullScreenEffectData && iFullScreenEffectData->iToAppId != fxData->iToAppId) - { - // effected application has changed. Only single begin - end request supported at a time. - __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffectsL - Effect request has changed from appUid 0x%x to 0x%x. Cancel previous effect.", iFullScreenEffectData->iToAppId, fxData->iToAppId); - RemoveEffectFromApp(iFullScreenEffectData->iToAppId); - } - delete iFullScreenEffectData; + delete iFullScreenEffectData; iFullScreenEffectData = fxData; iFullScreenEffectData->iAppStartScreenshotItemHandle = fxData->iHandle; @@ -4933,6 +4986,7 @@ CHuiLayout* toLayout = control.VisualCount() > 0 ? (CHuiLayout*)&control.Visual(0) : NULL; if (!toLayout) { + // no point starting effect, if the layout is still inactive. return EFalse; } TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. @@ -5006,7 +5060,36 @@ __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopControlEffectsL - end"); } - +void CAlfBridge::HandleSetDistractionWindowL( TAlfBridgerData data ) + { + TInt windowGroupId = data.iInt1; + TInt windowClientHandle = data.iInt2; + TBool setDistractionWindow = (TBool)data.iPtr; + + CControlEffectState* fxData = new (ELeave) CControlEffectState; + CleanupStack::PushL(fxData); + fxData->ConstructL(windowClientHandle, windowGroupId, setDistractionWindow); + + __ALFFXLOGSTRING2("CAlfBridge::HandleSetDistractionWindowL client handle: %d, group: %d", windowClientHandle, windowGroupId ); + CHuiCanvasVisual* visual = FindVisualByClientSideIds(windowClientHandle, windowGroupId); + + iControlEffectData = fxData; + CleanupStack::Pop(fxData); + + if (visual) + { + HandleGfxControlEventL(*iControlEffectData, visual); + } + else + { + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle %d, iClientGroupHandle %d", + fxData->iClientHandle, + fxData->iClientGroupHandle); + return; + } + delete iControlEffectData; + iControlEffectData = NULL; + } void CAlfBridge::HandleRegisterEffectL( TAlfBridgerData data ) { TInt action = data.iInt1; @@ -5270,6 +5353,32 @@ void CAlfBridge::HandleGfxControlEventL(CControlEffectState& aEvent, CHuiCanvasVisual* aCanvasVisual) { + + if (aEvent.iSetDistractionWindow) + { + // marks the background clear window that comes as courtesy of the framework. + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEventL - setting distraction window 0x%x to state %d", aCanvasVisual, aEvent.iSetDistractionWindow); + switch(aEvent.iSetDistractionWindow) + { + case CControlEffectState::ESetDistractionWindow: + { + aCanvasVisual->SetCanvasFlags(EHuiCanvasFlagDistractionWindow); + break; + } + case CControlEffectState::ERemoveDistractionWindow: + { + aCanvasVisual->ClearCanvasFlags(EHuiCanvasFlagDistractionWindow); + break; + } + } + return; + } + + if ( aCanvasVisual && aCanvasVisual->Owner().ControlGroup() && aCanvasVisual->Owner().ControlGroup()->SecureId() == 0x101f857A ) // Camera id + { + __ALFFXLOGSTRING("CAlfBridge::HandleGfxControlEventL - Returning because inside camera app"); + return; + } TInt err = KErrNone; // Check if there is an effects engine in HuiEnv CHuiFxEffect* effect = NULL; @@ -6041,6 +6150,11 @@ // SetCapturingBufferL is called from HandleVisualVisibility. iAlfScreens[i]->SetVisualTreeVisibilityChanged(ETrue); } + + if (!iSwRenderingEnabled && iManualRefreshTimer) + { + iManualRefreshTimer->Cancel(); + } } // --------------------------------------------------------------------------- @@ -6254,7 +6368,11 @@ // void CAlfBridge::Synchronized(TInt aId) { - if(aId == iIdForLayoutSwitchFrameSync) + if (aId == KRequestFrameSynchForComposition) + { + return; + } + else if (aId == iIdForLayoutSwitchFrameSync) { // send notification to alfstreamer server about if (iActivated) @@ -6342,7 +6460,6 @@ TRect fullscreen = TRect(TPoint(0,0), screen->Size()); __ALFFXLOGSTRING3("CAlfBridge::IsFullScreenDrawn - new orientation %d, screen size: (%d,%d)", aOrientation, fullscreen.iBr.iX, fullscreen.iBr.iY ); TBool fullscreenCovered = EFalse; - CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL; // Check if effect group has an effect with opaque hint. CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[0]->iFullscreenEffectControlGroup); @@ -6358,9 +6475,9 @@ { fullscreenCovered = ETrue; } + + TBool alfClientWindowGroupVisible = EFalse; - TBool alfWindowGroupFoundVisible = EFalse; - AMT_SET_VALUE( iVisibleVisualCount, 0 ); // skip the topmost (effect) layer, start from floating sprite group @@ -6383,7 +6500,10 @@ if (!fullscreenCovered) { fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); - + if(fullscreenCovered) + { + return ETrue; + } for(TInt ii=0;ii< iTempRegion.Count(); ii++) { __ALFFXLOGSTRING4("CAlfBridge::IsFullScreenDrawn (%d,%d)-(%d,%d)", iTempRegion[ii].iTl.iX, iTempRegion[ii].iTl.iY , iTempRegion[ii].iBr.iX, iTempRegion[ii].iBr.iY ); @@ -6395,44 +6515,25 @@ { CHuiLayout* hostContainer = control.ContainerLayout( NULL ); TInt flags = hostContainer->Flags(); - if (!fullscreenCovered) + if (alfClientWindowGroupVisible) { - + // check visual sizes if client has not made this control group hidden if(!(flags&EHuiVisualFlagUnderOpaqueHint)) { - alfWindowGroupFoundVisible = ETrue; if(iAppUi) { - topMostAlfSrvSession = iAppUi->SrvSessionForControlGroup(controlgroup); + CAlfAppSrvSessionBase* alfSrvSession = iAppUi->SrvSessionForControlGroup(controlgroup); + + TInt clientWindowGroupId = alfSrvSession->ClientWindowGroup(); + // checking the case if there are multiple alf application openend. + if (clientWindowGroupId == iAppUi->GetLastActiveClient()) + { + if(IsFullScreenDrawnRecursiveAlfContent(hostContainer, fullscreen) ) + { + return ETrue; + } + } } - - // just add the rect to covered region because alf draws solid background - iTempRegion.AddRect(fullscreen); - iTempRegion.Tidy(); - fullscreenCovered = ETrue; - } - } - else if(!alfWindowGroupFoundVisible || flags&EHuiVisualFlagUnderOpaqueHint) - { - // this alf session control group should not be visible anymore because avkon application is on top - // -> change to inactive - - } - else if(!(flags&EHuiVisualFlagUnderOpaqueHint)) // alf app covers full screen - { - // check if current controlgroup belongs to same srvsession as the topmost visible alf session container - CAlfAppSrvSessionBase* alfsrvsession = NULL; - if(iAppUi) - { - alfsrvsession = iAppUi->SrvSessionForControlGroup(controlgroup); - } - if(topMostAlfSrvSession!=NULL && topMostAlfSrvSession == alfsrvsession) - { - - } - else - { - } } continue; @@ -6450,6 +6551,11 @@ } */ + if(controlgroup.iAlfApp && layout->iOpacity.Now() > 0.0f ) + { + alfClientWindowGroupVisible = ETrue; + } + if (fullscreenCovered) { return ETrue; @@ -6458,6 +6564,40 @@ return fullscreenCovered; } +TBool CAlfBridge::IsFullScreenDrawnRecursiveAlfContent(CHuiVisual* aVisual, TRect& aFullScreen) + { + if(aVisual) + { + TInt flags = aVisual->Flags(); + if(!(flags && EHuiVisualFlagInactive) && aVisual->iOpacity.Now() > 0 ) // don't take inactive or invisible visual into account + { + TPoint point = aVisual->Pos().Now(); + TPoint size = aVisual->Size().Now(); + TRect visualRect(point, TSize(size.iX, size.iY)); + iTempRegion.AddRect(visualRect); + iTempRegion.Tidy(); + + if( IsRectCoveredByRegion(aFullScreen, iTempRegion) ) + { + return ETrue; + } + } + TInt count = aVisual->Count(); + if(count) + { + for(TInt i = 0 ; i < count ; i++) + { + if( IsFullScreenDrawnRecursiveAlfContent( &aVisual->Visual(i), aFullScreen ) ) + { + return ETrue; + } + } + } + } + return EFalse; + } + + TBool CAlfBridge::IsFullScreenDrawnRecursive( CHuiLayout* aLayout, CHuiControlGroup& aControlGroup, @@ -6537,7 +6677,9 @@ visualIsOpaque = EFalse; } - if (visualIsActive && visualIsOpaque && !visualRectIsCovered) + if (visualIsActive && visualIsOpaque && !visualRectIsCovered + && !(canvasVisual->CanvasFlags() & EHuiCanvasFlagDistractionWindow) // exclude the akn clearer window from heuristics + ) { // New visibility system takes only window shape into account. if ( canvasVisual->CanvasFlags() & EHuiCanvasFlagIncludeToVisibilityCalculation ) @@ -6648,5 +6790,39 @@ return 0; } +void CAlfBridge::RefreshNow(TBool aSyncWait) + { + if (!iHuiEnv) + { + return; + } + + if (iSwRenderingEnabled && iManualRefreshTimer) + { + iManualRefreshTimer->Cancel(); + } + + if (aSyncWait) + { + iHuiEnv->Synchronize( KRequestFrameSynchForComposition, this ); + } + + iHuiEnv->RefreshCallBack((TAny*)iHuiEnv); + } + +static TInt DoAlfBridgeRefreshNow(TAny* aAny) + { + CAlfBridge* bridge = static_cast(aAny); + bridge->RefreshNow(EFalse); + return KErrNone; + } + +void CAlfBridge::AsynchRefresh() + { + if (iSwRenderingEnabled && iManualRefreshTimer && !iManualRefreshTimer->IsActive()) + { + iManualRefreshTimer->Start(KAlfManualRefreshTimeout, KAlfManualRefreshTimeout, TCallBack(DoAlfBridgeRefreshNow, this)); + } + } // end of file diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp Fri May 14 16:46:13 2010 +0300 @@ -510,7 +510,7 @@ if ( iBridge.iAlfRegisteredEffects[i].iAction == aContext) { //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffectL - loading effect")); - TRAP_IGNORE(engine->LoadEffectL(*iBridge.iAlfRegisteredEffects[i].iEffectFile, effect, effectable, NULL, this, iLayoutSwitchEffectContext, 0 ) ); + TRAP_IGNORE(engine->LoadEffectL(*iBridge.iAlfRegisteredEffects[i].iEffectFile, effect, effectable, NULL, this, iLayoutSwitchEffectContext, KHuiFxDelayRunUntilFirstFrameHasBeenDrawn ) ); break; } } @@ -854,8 +854,22 @@ iHandle = aStream.ReadInt32L(); iClientHandle = aStream.ReadInt32L(); iClientGroupHandle = aStream.ReadInt32L(); - TInt screenNumber = aStream.ReadInt32L(); // this has always value 0 + TInt screenNumber = aStream.ReadInt32L(); // this has always value 0 + iSetDistractionWindow = ENoOperation; // Are Symbian full filename+directory combinations still max 256 characters long? ResolveFileNameL(aStream); } +void CControlEffectState::ConstructL(TUint32 aClientHandle, TUint32 aClientGroupHandle, TInt aSetDistractionWindow) + { + iClientHandle = aClientHandle; + iClientGroupHandle = aClientGroupHandle; + if (aSetDistractionWindow) + { + iSetDistractionWindow = CControlEffectState::ESetDistractionWindow; + } + else + { + iSetDistractionWindow = CControlEffectState::ERemoveDistractionWindow; + } + } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Fri May 14 16:46:13 2010 +0300 @@ -185,10 +185,10 @@ // RequestFrameEndCallback // --------------------------------------------------------------------------- // -void CAlfHierarchyModel::RequestFrameEndCallback( ) +void CAlfHierarchyModel::RequestFrameEndCallback(TBool aCompositionModified) { - __ALFLOGSTRING( "CAlfHierarchyModel::RequestFrameEndCallback" ); - iServer.Bridge()->StartNewBlock(); + __ALFLOGSTRING1( "CAlfHierarchyModel::RequestFrameEndCallback, composition modified: %d", aCompositionModified); + iServer.Bridge()->StartNewBlock(aCompositionModified); } // --------------------------------------------------------------------------- // HandleMessageL @@ -216,7 +216,7 @@ { if ( iChunk.Handle() ) { - ExecuteCommandsL(); + ExecuteCommandsL(aMessage.Int1()); if ( iBatchAlreadyCommited ) { // This may happen, if alfstreamerbridge happens to process the commands (containing the EAlfCommitBatch) @@ -398,7 +398,7 @@ // ExecuteCommandsL // --------------------------------------------------------------------------- // -void CAlfHierarchyModel::ExecuteCommandsL( ) +void CAlfHierarchyModel::ExecuteCommandsL( TBool aCompositionModified ) { if ( !iStream ) { @@ -564,7 +564,7 @@ case EAlfCommitBatch: { - RequestFrameEndCallback(); + RequestFrameEndCallback(aCompositionModified); break; } #ifdef ALF_DEBUG_TRACK_DRAWING @@ -1097,6 +1097,9 @@ { // SetLayerUsesAplhaFlag is not supported for image visual node->Window()->SetLayerUsesAplhaFlag( enabled ); +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + node->Window()->SetTransparencyAlphaChannel( enabled ); +#endif // #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS } else if( node ) // this would mean that node has being orphaneded but not yet deleted { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfsrvsettingshandler.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfsrvsettingshandler.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvsettingshandler.cpp Fri May 14 16:46:13 2010 +0300 @@ -282,5 +282,8 @@ // TInt CAlfSrvSettingsHandler::RunError(TInt aError) { - return aError; + // will likely lead to inconsistent state and thus reset anyway + RDebug::Print(_L("CAlfSrvSettingsHandler::RunError( %d )"),aError); + aError -= (aError); + return aError; //KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp Fri May 14 16:46:13 2010 +0300 @@ -201,10 +201,12 @@ { err = Trigger(iMessages.Count()-1); } - else - { - iQueueSema.Signal(); - } + else if (iVarDataAddedButNotPosted) + { + iVarDataAddedButNotPosted = EFalse; // data lost + iQueueSema.Signal(); + } + return err; } @@ -257,7 +259,7 @@ CAlfBridge* bridge = dynamic_cast(iObserver); if (bridge) { - bridge->iHuiEnv->RefreshCallBack((TAny*)bridge->iHuiEnv); + bridge->RefreshNow(iMessages[iStatus.Int()].iInt2); } } // fall through #endif @@ -310,7 +312,7 @@ CAlfBridge* bridge = dynamic_cast(iObserver); if (bridge) { - bridge->iHuiEnv->RefreshCallBack((TAny*)bridge->iHuiEnv); + bridge->RefreshNow(iMessages[iQueue[0]].iInt2); } } // fall through #endif @@ -374,12 +376,12 @@ // // --------------------------------------------------------------------------- // -void CAlfStreamerBridge::StartNewBlock() +void CAlfStreamerBridge::StartNewBlock(TBool aCompositionModified) { // Queue marker. Basically we could use one new member to assert that there can // be only one marker //__ALFLOGSTRING1("CAlfStreamerBridge:: Request command read notification, swap active: %d", iSwapActive ); - AddData(EAlfRequestCommitBatch,0,0,0); + AddData(EAlfRequestCommitBatch,0,aCompositionModified,0); } // --------------------------------------------------------------------------- diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Fri May 14 16:46:13 2010 +0300 @@ -978,7 +978,16 @@ { server->CompleteSignal(aMessage.Int0(), aMessage.Int1()); break; - } + } + case EAlfSetDistractionWindow: + { + TInt windowGroupId = aMessage.Int0(); + TInt windowHandle = aMessage.Int1(); + TInt state = (TInt)aMessage.Int2(); + aMessage.Complete(KErrNone); + server->Bridge()->AddData( EAlfDSSetDistractionWindow, windowGroupId, windowHandle, (TAny*)state ); + break; + } default: { aMessage.Complete(KErrNotSupported); diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/ServerCore/Src/alfvisualhandlers.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfvisualhandlers.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfvisualhandlers.cpp Fri May 14 16:46:13 2010 +0300 @@ -769,7 +769,7 @@ if (engine) { CHuiFxEffect* effect = NULL; - engine->LoadEffectL( params->iFileName, effect, iVisual->Effectable() ); + engine->LoadEffectL( params->iFileName, effect, iVisual->Effectable(), NULL , NULL, params->iHandle, KHuiFxDelayRunUntilFirstFrameHasBeenDrawn ); // The effect will be automatically set to the visual if parsing succeeds } break; @@ -784,8 +784,8 @@ CHuiFxEffect* effect = NULL; // this will add the group, if it does not exist already // Begin and End group events are supposed to come through GfxTransEffect API. - engine->BeginGroupEffect(groupHandle); - engine->LoadGroupEffectL( params->iFileName, effect, iVisual->Effectable(),groupHandle ); + engine->BeginGroupEffect(groupHandle); + engine->LoadGroupEffectL( params->iFileName, effect, iVisual->Effectable(),groupHandle, NULL, NULL, params->iHandle, KHuiFxDelayRunUntilFirstFrameHasBeenDrawn ); // The effect will be automatically set to the visual if parsing succeeds } break; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/group/bganimhost.mmp --- a/uiacceltk/hitchcock/backgroundanim/group/bganimhost.mmp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/group/bganimhost.mmp Fri May 14 16:46:13 2010 +0300 @@ -56,6 +56,7 @@ SOURCE screensaverpropertylistener.cpp #endif SOURCE sensor.cpp +SOURCE fgapppropertylistener.cpp STATICLIBRARY libcrt0.lib LIBRARY libc.lib diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h --- a/uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h Fri May 14 16:46:13 2010 +0300 @@ -26,6 +26,7 @@ #include "plugininterface.h" #include "themerepositorylistener.h" #include "screensaverpropertylistener.h" +#include "fgapppropertylistener.h" #include "sensor.h" #include "../../../../uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h" @@ -39,6 +40,8 @@ void ExecuteL(); static TInt TimerFunc(TAny* aPtr); + static TInt ReaperFunc(TAny* aPtr); + static TInt DoomBringerFunc(TAny* aPtr); // from MAlfCompositionObserver void FrameReady(TInt aScreenNumber); @@ -67,9 +70,14 @@ void LoadPluginL(); void ReleasePlugin(); void NewFrame(); + void Kill(); void HandleScreenSaverEvent(); + void HandleFGAppEvent(); TBool GetPluginConfigurationL(); + void StartSensorsL(); + void StopSensors(); static TInt ScreenSaverCallback(TAny* aPtr); + static TInt FgAppCallback(TAny* aPtr); private: // windowing stuff @@ -94,9 +102,12 @@ // timer CHighResTimer* iTimer; TBool iTimerRunning; + CHighResTimer* iTheReaper; + CHighResTimer* iDoomBringer; TBool iEGLInitialized; TBool iSurfaceInitialized; + TBool iHiddenDueSC; // composition API CAlfCompositionSource* iCompSource; @@ -105,11 +116,15 @@ CThemeRepositoryListener* iThemeRepositoryListener; CScreenSaverPropertyListener* iSCPropertyListener; + CFGAppPropertyListener *iHSFgStatusPropertyListener; RPointerArray iSensorListeners; + TBool iSensorsStopped; RAknsSrvSession iSkinSrv; HBufC* iCurrentPluginDllName; HBufC* iCurrentPluginAssetDir; TBool iIsUIReady; + + TBool iReaped; }; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/inc/fgapppropertylistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/backgroundanim/inc/fgapppropertylistener.h Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __FGAPPPROPERTYLISTENER_H__ +#define __FGAPPPROPERTYLISTENER_H__ + +#include +#include +#include + +class CFGAppPropertyListener : public CActive + { + public: + static CFGAppPropertyListener* NewL(TCallBack aCallback); + virtual ~CFGAppPropertyListener(); + void RunL(); + void DoCancel(); + void IssueRequest(); + TInt GetHSFGStatus(); + protected: + void ConstructL(); + private: + CFGAppPropertyListener(TCallBack aCallback); + + RProperty iHSFGProperty; + TCallBack iCallback; + TInt iHSFGStatus; + }; + +#endif diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/inc/plugininterface.h --- a/uiacceltk/hitchcock/backgroundanim/inc/plugininterface.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/inc/plugininterface.h Fri May 14 16:46:13 2010 +0300 @@ -61,6 +61,8 @@ // If plugin does not want to use sensors, the function pointer must to be initialized to NULL void (*receivesensordata)(void*, int, int); + void (*setfaded)(int); + // this function can be used to convey any additional data from/to the plugin. int (*extension)(int, void*); } plugin_export_v1_t; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/inc/sensor.h --- a/uiacceltk/hitchcock/backgroundanim/inc/sensor.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/inc/sensor.h Fri May 14 16:46:13 2010 +0300 @@ -27,12 +27,15 @@ public: static CSensorListener* NewL(MSensrvDataListener* aDataListener, TUint32 aSensorType); virtual ~CSensorListener(); + void StopListening(); + void StartListeningL(); protected: void ConstructL(TUint32 aSensorType); CSensorListener(MSensrvDataListener* aDataListener); private: MSensrvDataListener* iDataListener; CSensrvChannel* iSensrvChannel; + TBool iListening; }; #endif \ No newline at end of file diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/refplugin/src/plugin.c --- a/uiacceltk/hitchcock/backgroundanim/refplugin/src/plugin.c Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/refplugin/src/plugin.c Fri May 14 16:46:13 2010 +0300 @@ -197,6 +197,7 @@ interface->destroy = destroy; interface->desiredsensors = 0; interface->receivesensordata = 0; + interface->setfaded = 0; interface->extension = extension; } } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Fri May 14 16:46:13 2010 +0300 @@ -41,21 +41,17 @@ delete iCurrentPluginDllName; delete iCurrentPluginAssetDir; delete iTimer; - if (iPlugin) - { - iPlugin->destroy(); - free(iPlugin); - } - iPluginLibrary.Close(); + delete iTheReaper; + delete iDoomBringer; + + ReleasePlugin(); + #if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) delete iSCPropertyListener; #endif + delete iHSFgStatusPropertyListener; delete iThemeRepositoryListener; - while (iSensorListeners.Count()) - { - delete iSensorListeners[0]; - iSensorListeners.Remove(0); - } + iSensorListeners.Close(); delete CActiveScheduler::Current(); CActiveScheduler::Install(NULL); @@ -82,11 +78,12 @@ CActiveScheduler *ac = new (ELeave) CActiveScheduler; CActiveScheduler::Install(ac); iTimer = CHighResTimer::NewL(TCallBack(TimerFunc, this),CActive::EPriorityStandard); + iTheReaper = CHighResTimer::NewL(TCallBack(ReaperFunc, this),CActive::EPriorityStandard); iThemeRepositoryListener = CThemeRepositoryListener::NewL(&iRunning); #if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) iSCPropertyListener = CScreenSaverPropertyListener::NewL(TCallBack(ScreenSaverCallback, this)); #endif - + iHSFgStatusPropertyListener = CFGAppPropertyListener::NewL(TCallBack(FgAppCallback, this)); CreateWindowL(); User::LeaveIfError(iSkinSrv.Connect()); @@ -101,6 +98,7 @@ #if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) iSCPropertyListener->IssueRequest(); #endif + iHSFgStatusPropertyListener->IssueRequest(); } void CBgAnimHost::CreateWindowL() @@ -481,6 +479,7 @@ if (!serr) { iSensorListeners.Append(listener); + StartSensorsL(); } } } @@ -506,11 +505,16 @@ void CBgAnimHost::NewFrame() { - if (!iRunning) + if (!iRunning && !iDoomBringer) { - // Stop and exit - CActiveScheduler::Stop(); - return; + iDoomBringer = CHighResTimer::NewL(TCallBack(DoomBringerFunc, this),CActive::EPriorityStandard); + iDoomBringer->CallBack(5000); + } + + if (iRunning && iDoomBringer) + { + delete iDoomBringer; + iDoomBringer = NULL; } if (!iSurfaceInitialized) { @@ -544,7 +548,28 @@ iTimer->CallBack(nextcallback); } + +void CBgAnimHost::Kill() + { + if (!iRunning) + { + CActiveScheduler::Stop(); + } + else + { + delete iDoomBringer; + iDoomBringer = NULL; + } + return; + } + +TInt CBgAnimHost::DoomBringerFunc(TAny* aPtr) + { + CBgAnimHost* me = (CBgAnimHost*)(aPtr); + me->Kill(); + return ETrue; + } TInt CBgAnimHost::TimerFunc(TAny* aPtr) { @@ -553,7 +578,14 @@ return ETrue; } - +TInt CBgAnimHost::ReaperFunc(TAny* aPtr) + { + CBgAnimHost* me = (CBgAnimHost*)(aPtr); + me->CompositionTargetHidden(); + return ETrue; + } + + void CBgAnimHost::ExecuteL() { // finally start our timer and scheduler... @@ -600,14 +632,22 @@ iTimerRunning = EFalse; iPlugin->gpuresourcesavailable(0); ReleaseWindowSurface(EFalse); + StopSensors(); } void CBgAnimHost::CompositionTargetVisible() { - if (iSurfaceInitialized) + if (!iRunning && !iDoomBringer) + { + iDoomBringer = CHighResTimer::NewL(TCallBack(DoomBringerFunc, this),CActive::EPriorityStandard); + iDoomBringer->CallBack(5000); + } + + if (iSurfaceInitialized || iHiddenDueSC || iReaped) { // don't bother if we are already in - // a correct state.. + // a correct state, or if we are hidden by + // the screensaver return; } @@ -623,34 +663,75 @@ if (!err) { iPlugin->gpuresourcesavailable(1); + iPlugin->setfaded(iHSFgStatusPropertyListener->GetHSFGStatus()); iTimer->CallBack(1); iTimerRunning = ETrue; } + TRAP_IGNORE(StartSensorsL()); } void CBgAnimHost::HandleScreenSaverEvent() { #if !defined(SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS) TInt scStatus = iSCPropertyListener->GetScreenSaverStatus(); + if (scStatus) { // screensaver is ON - if (iTimerRunning) - { - iTimer->Cancel(); - iTimerRunning = EFalse; - } + iHiddenDueSC = ETrue; + CompositionTargetHidden(); } else { // screensaver is OFF - if (!iTimerRunning && iSurfaceInitialized) + iHiddenDueSC = EFalse; + CompositionTargetVisible(); + } +#endif + } + +void CBgAnimHost::StartSensorsL() + { + for (TInt count = 0; count < iSensorListeners.Count(); count++) + { + iSensorListeners[count]->StartListeningL(); + } + } + +void CBgAnimHost::StopSensors() + { + for (TInt count = 0; count < iSensorListeners.Count(); count++) + { + iSensorListeners[count]->StopListening(); + } + } + +void CBgAnimHost::HandleFGAppEvent() + { + if (!iRunning && !iDoomBringer) + { + iDoomBringer = CHighResTimer::NewL(TCallBack(DoomBringerFunc, this),CActive::EPriorityStandard); + iDoomBringer->CallBack(5000); + } + + if (iPlugin && iPlugin->setfaded) + { + iPlugin->setfaded(iHSFgStatusPropertyListener->GetHSFGStatus()); + if (!iHSFgStatusPropertyListener->GetHSFGStatus()) { - iTimerRunning = ETrue; - iTimer->CallBack(1); + // reap the anim in 5 seconds... + // 5 seconds is probably just allright + // to have enought time for the plugin to fade out... + iReaped = ETrue; + iTheReaper->CallBack(5000); + } + else + { + iReaped = EFalse; + iTheReaper->Cancel(); + CompositionTargetVisible(); } } -#endif } TInt CBgAnimHost::ScreenSaverCallback(TAny* aPtr) @@ -660,6 +741,13 @@ return EFalse; } +TInt CBgAnimHost::FgAppCallback(TAny* aPtr) + { + CBgAnimHost* me = (CBgAnimHost*) aPtr; + me->HandleFGAppEvent(); + return EFalse; + } + void CBgAnimHost::DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost ) { if (iPlugin && iPlugin->receivesensordata) diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/src/fgapppropertylistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/backgroundanim/src/fgapppropertylistener.cpp Fri May 14 16:46:13 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include "fgapppropertylistener.h" + +const TUid KPSSysCategory = { KUidSystemCategoryValue }; +const TUint32 KAlfPSKeyHSVisible = 0x2002EA91; + +CFGAppPropertyListener::CFGAppPropertyListener(TCallBack aCallback) : CActive(EPriorityStandard), iCallback(aCallback) + { + CActiveScheduler::Add(this); + } + +CFGAppPropertyListener::~CFGAppPropertyListener() + { + Cancel(); + iHSFGProperty.Close(); + } + +CFGAppPropertyListener* CFGAppPropertyListener::NewL(TCallBack aCallback) + { + CFGAppPropertyListener* me = new (ELeave)CFGAppPropertyListener(aCallback); + CleanupStack::PushL(me); + me->ConstructL(); + CleanupStack::Pop(); + return me; + } + +void CFGAppPropertyListener::ConstructL() + { + User::LeaveIfError(iHSFGProperty.Attach(KPSSysCategory, KAlfPSKeyHSVisible)); + } + +void CFGAppPropertyListener::RunL() + { + if (iStatus.Int() != KErrCancel) + { + IssueRequest(); + iHSFGProperty.Get(iHSFGStatus); + iCallback.CallBack(); + } + } + +void CFGAppPropertyListener::DoCancel() + { + iHSFGProperty.Cancel(); + } + +void CFGAppPropertyListener::IssueRequest() + { + iHSFGProperty.Subscribe(iStatus); + SetActive(); + } + +TInt CFGAppPropertyListener::GetHSFGStatus() + { + return iHSFGStatus; + } + + + diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/src/highrestimer.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/highrestimer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/src/highrestimer.cpp Fri May 14 16:46:13 2010 +0300 @@ -39,9 +39,9 @@ { wait = 1000; } - if (wait > 100000) + if (wait > 5000000) { - wait = 100000; + wait = 5000000; } HighRes( TTimeIntervalMicroSeconds32( wait ) ); diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/src/sensor.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/sensor.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/src/sensor.cpp Fri May 14 16:46:13 2010 +0300 @@ -45,8 +45,6 @@ if (channelInfoList.Count()) { iSensrvChannel = CSensrvChannel::NewL(channelInfoList[0]); - iSensrvChannel->OpenChannelL(); - iSensrvChannel->StartDataListeningL( iDataListener, 1,1,0); } channelInfoList.Close(); @@ -60,14 +58,33 @@ CSensorListener::~CSensorListener() { - if (iSensrvChannel) + StopListening(); + delete iSensrvChannel; + + iSensrvChannel = NULL; + } + +void CSensorListener::StopListening() + { + if (iSensrvChannel && iListening) { - iSensrvChannel->StopDataListening(); + iSensrvChannel->StopDataListening(); iSensrvChannel->CloseChannel(); + iListening = EFalse; } - - delete iSensrvChannel; } + +void CSensorListener::StartListeningL() + { + if (iSensrvChannel && !iListening) + { + iSensrvChannel->OpenChannelL(); + iSensrvChannel->StartDataListeningL( iDataListener, 5,10,0); + iListening = ETrue; + } + } + + diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/backgroundanim/src/themerepositorylistener.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/themerepositorylistener.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/src/themerepositorylistener.cpp Fri May 14 16:46:13 2010 +0300 @@ -53,12 +53,15 @@ // we are only interested in the value if it // is something else than 0 // as it means that we should stop... - if (value && value != iPreviousValue) + if (value) { *iValueToChange = EFalse; } + else + { + *iValueToChange = ETrue; + } - iPreviousValue = value; if (iStatus.Int() != KErrCancel) { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Fri May 14 16:46:13 2010 +0300 @@ -1597,4 +1597,5 @@ ?HasTransParentClear@CHuiCanvasVisual@@QBEHXZ @ 1596 NONAME ; int CHuiCanvasVisual::HasTransParentClear(void) const ?AddEffectToGroup@CHuiFxEngine@@QAEHH@Z @ 1597 NONAME ; int CHuiFxEngine::AddEffectToGroup(int) ?FxmlUsesOpaqueHint@CHuiFxEngine@@QAEHABVTDesC16@@@Z @ 1598 NONAME ; int CHuiFxEngine::FxmlUsesOpaqueHint(class TDesC16 const &) + ?InitializeL@CHuiCanvasRenderBuffer@@UAEXABVTSize@@H@Z @ 1599 NONAME ; void CHuiCanvasRenderBuffer::InitializeL(class TSize const &, int) diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Fri May 14 16:46:13 2010 +0300 @@ -1998,4 +1998,5 @@ _ZNK16CHuiCanvasVisual19HasTransParentClearEv @ 1997 NONAME _ZN12CHuiFxEngine16AddEffectToGroupEi @ 1998 NONAME _ZN12CHuiFxEngine18FxmlUsesOpaqueHintERK7TDesC16 @ 1999 NONAME + _ZN22CHuiCanvasRenderBuffer11InitializeLERK5TSizei @ 2000 NONAME diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Fri May 14 16:46:13 2010 +0300 @@ -74,6 +74,17 @@ */ const TInt KHuiFxReadyAndWaitingGroupToStartSyncronized = 0x800; +/** + * This applies only to group effects. Visual has drawn one frame after the + * effect was added to the visual. + */ +const TInt KHuiReadyToDrawNotified = 0x1000; + +/** + * Effect observer has been called once. + */ +const TInt KHuiEffectObserverNotified = 0x2000; + class MAlfGfxEffectObserver { public: @@ -96,7 +107,15 @@ IMPORT_C TBool VisualArea(TRect& aRect) const; IMPORT_C TBool Changed(); IMPORT_C void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle ); - void NotifyEffectEndObserver(); + + /** + * NotifyEffectEndObserver + * + * @return ETrue, if effect observer was notified. + * EFalse, if effect does not have observer, but other notification is required (alf application + * effects. + */ + TBool NotifyEffectEndObserver(); IMPORT_C TBool IsAnimated() const; IMPORT_C TBool IsTransformed() const; @@ -191,7 +210,6 @@ TInt iFramesDrawn; TReal32 iElapsedTime; - TBool iNotifiedEffectReady; }; #endif /*HUIFXEFFECT_H_*/ diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/inc/huicanvasrenderbuffer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/huicanvasrenderbuffer.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasrenderbuffer.h Fri May 14 16:46:13 2010 +0300 @@ -80,6 +80,13 @@ */ IMPORT_C virtual void Copy(TPoint aPoint); + /** + * Initializes render buffer, with clear option. + * @param aSize size of render buffer. + * @param aClear contents of render buffer are cleared even if alredy initialized. + */ + IMPORT_C virtual void InitializeL(const TSize& aSize, TBool aClear); + protected: TSize iSize; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/inc/huicanvastexturecache.h --- a/uiacceltk/hitchcock/coretoolkit/inc/huicanvastexturecache.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvastexturecache.h Fri May 14 16:46:13 2010 +0300 @@ -398,7 +398,7 @@ TInt CalculateTotalCanvasRenderBufferUsageInKbytes(); - CHuiCanvasRenderBufferImage* ReUseReleasedRenderBuffer(TSize aSizehint); + CHuiCanvasRenderBufferImage* ReUseReleasedRenderBufferL(TSize aSizehint); TBool IsLowMemoryStateEnabled() const; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OffscreenRenderbuffer.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OffscreenRenderbuffer.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OffscreenRenderbuffer.h Fri May 14 16:46:13 2010 +0300 @@ -57,7 +57,8 @@ EGLContext iSavedContext; EGLSurface iSavedReadSurface; EGLSurface iSavedDrawSurface; - VGImage iRotatedImage; + VGImage iRotatedImage; + TSize iRotatedImageSize; TEGLState iPreviousEGLState; }; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderPlugin.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderPlugin.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderPlugin.h Fri May 14 16:46:13 2010 +0300 @@ -259,32 +259,37 @@ /** * Creates a new instance of a canvas graphics context. */ - virtual CHuiCanvasGc* CreateCanvasGcL(); + virtual CHuiCanvasGc* CreateCanvasGcL(); - /** - * Used to set flags that describe how the openvg state has changed. - */ - virtual void AddRestoreStateFlags(TInt aFlags); + /** + * Used to set flags that describe how the openvg state has changed. + */ + virtual void AddRestoreStateFlags(TInt aFlags); - /** - * Return the flags, e.g. for vg10gc to reset its state - */ - virtual TInt GetRestoreStateFlags(); + /** + * Return the flags, e.g. for vg10gc to reset its state + */ + virtual TInt GetRestoreStateFlags(); - /** - * Clear the stateflags - */ - virtual void ClearRestoreStateFlags(); + /** + * Clear the stateflags + */ + virtual void ClearRestoreStateFlags(); #ifdef __NVG - /** - * Getter for NVGEngine, to be used with NVG drawing inside OpenVG plugin - * - * @return CNvgEngine object - */ - CNvgEngine& NvgEngine() const; + /** + * Getter for NVGEngine, to be used with NVG drawing inside OpenVG plugin + * + * @return CNvgEngine object + */ + CNvgEngine& NvgEngine() const; #endif + /** + * Getter for hardware configuration flags (rendering quality Accurate / Fast) + */ + TInt GetHwConfigurationFlags() const; + /** * Getter for texture upload context. This is called by CHuiVg10Texture. */ @@ -366,6 +371,9 @@ MVGImageBinder* iMVGImageBinder; #endif + // Hardware configuration, fetched from CenRep + TInt iHwConf; + TBool iAllowsSwapBufferPreserved; TBool iAllowsVisualPBufferSurfaces; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10VgImageBinder.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10VgImageBinder.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10VgImageBinder.h Fri May 14 16:46:13 2010 +0300 @@ -88,7 +88,14 @@ EGLContext iContext; EGLContext iSavedContext; + + // Array for maintaining vgImages + RArray iGroupOpacityImages; + // Array for maintaining vgImages + RArray iGroupOpacitySurfaces; + }; + #endif /* HUIVG10VGIMAGEBINDER_H_ */ diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h Fri May 14 16:46:13 2010 +0300 @@ -78,6 +78,11 @@ */ void Copy(TPoint aPoint); + /** + * Initializes render buffer, with clear option. + */ + void InitializeL(const TSize& aSize, TBool aForceClear); + public: VGImage Image() const; diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OffscreenRenderbuffer.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OffscreenRenderbuffer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OffscreenRenderbuffer.cpp Fri May 14 16:46:13 2010 +0300 @@ -69,7 +69,6 @@ // Create a context iContext = eglCreateContext(iPlugin->EglDisplay(), config, iPlugin->EglSharedContext(), NULL); - EGLint err = eglGetError(); ASSERT(iContext); // Create a pbuffer surface @@ -190,42 +189,73 @@ { if (iBackgroundEnabled) { - CHuiDisplay& display = CHuiStatic::Env().PrimaryDisplay(); - TBool rotatedDisplay = display.Orientation() == CHuiGc::EOrientationCCW90 || display.Orientation() == CHuiGc::EOrientationCW90; - TRect renderBufferLocation = TRect(iPosition, iSize); + TBool rotatedDisplay = EFalse; + CHuiGc::TOrientation orientation = CHuiStatic::Env().PrimaryDisplay().Orientation(); + + // The current context can be the screen context or, in case of nested effects, an "effect off-screen" + // context. The latter uses VG image that is encapsulated inside PBuffer surface. + // Only if we have the screen context, the surface content can be in rotated state. + + TBool isScreenContext = (iPlugin->EglSharedContext() == eglGetCurrentContext()); + if (isScreenContext) + { + rotatedDisplay = orientation == CHuiGc::EOrientationCCW90 || orientation == CHuiGc::EOrientationCW90; + } -#ifdef HUIFX_TRACE - RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - renderBufferLocation original: %i,%i, %i,%i "), - renderBufferLocation.iTl.iX, - renderBufferLocation.iTl.iY, - renderBufferLocation.iBr.iX, - renderBufferLocation.iBr.iY); -#endif - - TRect displayArea = display.VisibleArea(); - - TInt displayHeight = displayArea.Height(); - TInt displayWidth = displayArea.Width(); - - TSize rotatedSize = iSize; - TPoint rotatedPos = iPosition; + + // Read surface size from egl + EGLDisplay eglDisp = eglGetCurrentDisplay(); + EGLSurface eglSurf = eglGetCurrentSurface(EGL_DRAW); + EGLint sfWidth; + EGLint sfHeight; + eglQuerySurface(eglDisp, eglSurf, EGL_WIDTH, &sfWidth); + eglQuerySurface(eglDisp, eglSurf, EGL_HEIGHT, &sfHeight); + + #ifdef HUIFX_TRACE + RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::ReadBackground - surface size: %i,%i "), sfWidth, sfHeight); + #endif // Read pixels from surface - if (rotatedDisplay) + if (!rotatedDisplay) + { + // Much easier if no rotation ! + vgGetPixels(iImage, 0, 0, iPosition.iX, sfHeight - (iPosition.iY + iSize.iHeight), iSize.iWidth, iSize.iHeight); + } + else { - if (iRotatedImage == VG_INVALID_HANDLE) + // If screen is rotated but surface is not in native orientation, this gets difficult + // because vgGetPixels is not affected by transformations. + + // display size = surface size rotated + TInt displayHeight = sfWidth; + TInt displayWidth = sfHeight; + + TSize newRotatedImageSize = TSize(iSize.iHeight, iSize.iWidth); + if (iRotatedImage == VG_INVALID_HANDLE || iRotatedImageSize != newRotatedImageSize) { PushEGLContext(); + // *** Create new vg image + + // Remove existing vg image, if any + if (iRotatedImage != VG_INVALID_HANDLE) + { + vgDestroyImage(iRotatedImage); + iRotatedImage = VG_INVALID_HANDLE; + HUIFX_VG_INVARIANT(); + } + #ifndef __WINS__ // Should possibly query the supported mode instead? VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE; #else VGImageFormat imageInternalFormat = VG_sARGB_8888; #endif - TSize rotatedImageSize = TSize(iSize.iHeight, iSize.iWidth); - iRotatedImage = vgCreateImage(imageInternalFormat, rotatedImageSize.iWidth, rotatedImageSize.iHeight, - VG_IMAGE_QUALITY_NONANTIALIASED); + iRotatedImageSize = newRotatedImageSize; + iRotatedImage = vgCreateImage(imageInternalFormat, iRotatedImageSize.iWidth, iRotatedImageSize.iHeight, + VG_IMAGE_QUALITY_NONANTIALIASED); + //iRotatedImage = vgCreateImage(imageInternalFormat, iSize.iWidth, iSize.iHeight, + // VG_IMAGE_QUALITY_NONANTIALIASED); PopEGLContext(); } @@ -233,14 +263,17 @@ // If we have rotation on CHuiGc level, we must manually take that into account when // accessing pixels directly - if(display.Orientation() == CHuiGc::EOrientationCCW90) + TSize rotatedSize = iSize; + TPoint rotatedPos = iPosition; + TRect renderBufferLocation = TRect(iPosition, iSize); + if(orientation == CHuiGc::EOrientationCCW90) { // Rotate the buffer location relative to real surface coordinates rotatedSize = TSize(iSize.iHeight, iSize.iWidth); rotatedPos = TPoint(displayHeight - iPosition.iY - iSize.iHeight, iPosition.iX); renderBufferLocation = TRect(rotatedPos, rotatedSize); } - else if(display.Orientation() == CHuiGc::EOrientationCW90) + else if(orientation == CHuiGc::EOrientationCW90) { // Rotate the buffer location relative to real surface coordinates rotatedSize = TSize(iSize.iHeight, iSize.iWidth); @@ -251,23 +284,17 @@ { // nothing } - - // If screen is rotated but surface is not in native orientation, this gets difficult - // because vgGetPixels is not affected by transformations. - - // Swap h and w so that those are the "real" values from surface point of view. - displayHeight = displayWidth; - - #ifdef HUIFX_TRACE - RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - renderBufferLocation: %i,%i, %i,%i "), + + #ifdef HUIFX_TRACE + RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::ReadBackground - renderBufferLocation: %i,%i, %i,%i "), renderBufferLocation.iTl.iX, renderBufferLocation.iTl.iY, renderBufferLocation.iBr.iX, renderBufferLocation.iBr.iY); - TRect vgRect(TPoint(renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight), rotatedSize); + TRect vgRect(TPoint(renderBufferLocation.iTl.iX, sfHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight), rotatedSize); - RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - vgRect: %i,%i, %i,%i "), + RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::ReadBackground - vgRect: %i,%i, %i,%i "), vgRect.iTl.iX, vgRect.iTl.iY, vgRect.iBr.iX, @@ -275,7 +302,7 @@ #endif // So...first get pixels from surface into rotated image - vgGetPixels(iRotatedImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight); + vgGetPixels(iRotatedImage, 0, 0, renderBufferLocation.iTl.iX, sfHeight - (renderBufferLocation.iTl.iY + rotatedSize.iHeight), rotatedSize.iWidth, rotatedSize.iHeight); // Draw rotated image into real buffer image, first bind it as render target... BindAsRenderTarget(); @@ -295,19 +322,19 @@ TInt h = iSize.iHeight; // ...select right rotation... - if (display.Orientation() == CHuiGc::EOrientationCW90) + if (orientation == CHuiGc::EOrientationCW90) { // Rotate around origo and move back to displayarea vgRotate(-90); vgTranslate(-h, 0); } - else if (display.Orientation() == CHuiGc::EOrientationCCW90) + else if (orientation == CHuiGc::EOrientationCCW90) { // Rotate around origo and move back to displayarea vgRotate(90); vgTranslate(0, -w); } - else if (display.Orientation() == CHuiGc::EOrientation180) + else if (orientation == CHuiGc::EOrientation180) { // Rotate around origo and move back to displayarea vgRotate(180); @@ -331,11 +358,6 @@ // ...finally unbind image and we should have the content correctly. UnbindAsRenderTarget(); } - else - { - // Much easier if no rotation ! - vgGetPixels(iImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight); - } } } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Fri May 14 16:46:13 2010 +0300 @@ -32,7 +32,6 @@ #include "uiacceltk/HuiPanic.h" #include "uiacceltk/huifixmath.h" #include "HuiRenderSurface.h" -#include "../../CommonInc/uiacceltkdomaincrkeys.h" #include "huiextension.h" @@ -385,8 +384,9 @@ vgRemovePathCapabilities(iBorderPath, VG_PATH_CAPABILITY_APPEND_TO); // Get hardware configuration - TInt hwConf = 0; // the defaulf value for everything is 0 to allow new flags to be defined - HuiUtil::GetValueFromCentralRepository( KUIAccelTKHWConfigurationFlags, hwConf ); + CHuiVg10RenderPlugin& renderer = (CHuiVg10RenderPlugin&) CHuiStatic::Renderer(); + TInt hwConf = renderer.GetHwConfigurationFlags(); + if ( hwConf & KHuiAntialiasing ) { SetQuality( EHuiQualityAccurate ); @@ -395,11 +395,10 @@ { SetQuality( EHuiQualityFast ); } - iVgObjectsCreated = ETrue; } - + void CHuiVg10Gc::InitState() { // Clean matrix stack in case there is anything left @@ -2225,15 +2224,6 @@ HUI_DEBUG(_L("CHuiVg10Gc::DrawNVG() - Fallback to draw the old way (via DrawNvg)")); iNvgEngine->DrawNvg(nvgDataVoidIC, aImageSize, NULL, NULL); } - -#ifdef _DEBUG - // TODO: REMOVE ONCE THE TSW ERROR IS FIXED! - VGErrorCode err = vgGetError(); - if (err) - { - RDebug::Print(_L("CHuiVg10Gc::DrawNVG - Error in NVG draw: %04x"), err); - } -#endif // The NVG draw messes up the paint, scissoring & rects, so mark them as dirty TInt dirtyFlags = EHuiVg10GcStateFlagDirtyPaint | diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp Fri May 14 16:46:13 2010 +0300 @@ -32,6 +32,7 @@ #include "uiacceltk/HuiEnv.h" #include "uiacceltk/HuiDisplay.h" #include "HuiFxVg10Engine.h" +#include "../../CommonInc/uiacceltkdomaincrkeys.h" #ifdef __NVG #include @@ -109,7 +110,10 @@ // Initialize some "allow flags" which depend on used HW ReadAllowsSwapBufferPreserved(); - ReadAllowsVisualPBufferSurfaces(); + ReadAllowsVisualPBufferSurfaces(); + + // Cache the Hardware configuration + iHwConf = HuiUtil::GetValueFromCentralRepository( KUIAccelTKHWConfigurationFlags, iHwConf ); } CHuiVg10RenderPlugin::~CHuiVg10RenderPlugin() @@ -508,6 +512,11 @@ } #endif +TInt CHuiVg10RenderPlugin::GetHwConfigurationFlags() const + { + return iHwConf; + } + // TODO: This is only a temporary check until all HW platforms support feature void CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp Fri May 14 16:46:13 2010 +0300 @@ -1379,16 +1379,6 @@ EHuiVg10GcStateFlagDirtyScissorRects; iRenderPlugin.AddRestoreStateFlags(dirtyFlags); -#ifdef _DEBUG - // TODO: There's something in the DrawNvg() code, which causes OpenVg to set - // error code => PANIC, if not for this temp check here. REMOVE ONCE THE TSW ERROR IS FIXED! - VGErrorCode err = vgGetError(); - if (err) - { - RDebug::Print(_L("CHuiVG10Texture::CreateRenderedImage - Error in NVG draw: %04x"), err); - } -#endif - HUI_VG_INVARIANT(); vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10VGImageBinder.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10VGImageBinder.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10VGImageBinder.cpp Fri May 14 16:46:13 2010 +0300 @@ -1,28 +1,28 @@ /* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class HuiVg10VGImageBinder -* -*/ + * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Class HuiVg10VGImageBinder + * + */ #include "HuiVg10VgImageBinder.h" #include "HuiVg10RenderPlugin.h" #include "uiacceltk/HuiUtil.h" CHuiVg10VgImageBinder::CHuiVg10VgImageBinder(CHuiVg10RenderPlugin* aRenderPlugin): - iRenderPlugin(aRenderPlugin) - { - } +iRenderPlugin(aRenderPlugin) + { + } void CHuiVg10VgImageBinder::ConstructL() { @@ -48,79 +48,127 @@ TInt CHuiVg10VgImageBinder::BindClientBuffer(TUint aBuffer) { - // Check whether we should use the Alpha format bit - VGImageFormat imageFormat = (VGImageFormat)vgGetParameteri(aBuffer, VG_IMAGE_FORMAT); - TInt maskBit = 0; - if (imageFormat == VG_sRGBA_8888_PRE) + + // This returns the index of the corresponding aBuffer stored in the array. + // If KErrNotFound is returned,it indicates that this is the first BindClientBuffer + // call for aBuffer and hence eglPbufferfromclient has to be created for this buffer + TInt bufferIndex = iGroupOpacityImages.Find(aBuffer); + + + // This check mandates that iSavedDraw/Read Surfaces are stored only for the first time + // (i.e., before any pbufferfromclient surfaces are created).This is because when there are concurrent + // BindToImageL calls,we would eventually be losing track of the base window surface on + // top of which the vgImage has to be drawn. + if(iGroupOpacityImages.Count() == 0) { - maskBit = EGL_VG_ALPHA_FORMAT_PRE_BIT; + // Save current context and surfaces + iSavedContext = eglGetCurrentContext(); + iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW); + iSavedReadSurface = eglGetCurrentSurface(EGL_READ); } - - const TInt BITS_PER_CHANNEL = 8; - // Choose an EGL config - const EGLint attrs[] = + + // Buffer Index would be KErrNotFound if this is the first BindClientBuffer call for aBuffer + // (there would be multiple BindClientBuffer calls for an aBuffer) and hence corresponding + // pbufferfromclient surface has to be created for that aBuffer. + if(bufferIndex == KErrNotFound) { - EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT, - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT | maskBit, - EGL_RED_SIZE, BITS_PER_CHANNEL, - EGL_GREEN_SIZE, BITS_PER_CHANNEL, - EGL_BLUE_SIZE, BITS_PER_CHANNEL, - EGL_ALPHA_SIZE, BITS_PER_CHANNEL, - EGL_NONE - }; + // Check whether we should use the Alpha format bit + VGImageFormat imageFormat = (VGImageFormat)vgGetParameteri(aBuffer, VG_IMAGE_FORMAT); + TInt maskBit = 0; + if (imageFormat == VG_sRGBA_8888_PRE) + { + maskBit = EGL_VG_ALPHA_FORMAT_PRE_BIT; + } + + const TInt BITS_PER_CHANNEL = 8; + // Choose an EGL config + const EGLint attrs[] = + { + EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT, + EGL_SURFACE_TYPE, EGL_PBUFFER_BIT | maskBit, + EGL_RED_SIZE, BITS_PER_CHANNEL, + EGL_GREEN_SIZE, BITS_PER_CHANNEL, + EGL_BLUE_SIZE, BITS_PER_CHANNEL, + EGL_ALPHA_SIZE, BITS_PER_CHANNEL, + EGL_NONE + }; + + // Create a context + TInt configCount = iRenderPlugin->EglChooseConfig(attrs); + EGLConfig config = iRenderPlugin->EglConfig(0); + + // Create a pbuffer surface + iEglPBufferSurface_Client = eglCreatePbufferFromClientBuffer(iRenderPlugin->EglDisplay(), + EGL_OPENVG_IMAGE, + static_cast(aBuffer), // Use the param image as buffer + config, NULL); + if (iEglPBufferSurface_Client == EGL_NO_SURFACE) + { + HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be created, eglErr: %04x"), eglGetError() ); + return KErrGeneral; + } + iGroupOpacitySurfaces.Append(iEglPBufferSurface_Client); + iGroupOpacityImages.Append(aBuffer); + } + // Control would go to else part indicating that this is not the first BindClientBuffer for aBuffer + // and hence the corresponding eglPBufferfromClient surface could be retrieved with the bufferIndex + else + { + iEglPBufferSurface_Client = iGroupOpacitySurfaces[bufferIndex]; + } + + EGLContext context = iRenderPlugin->EglSharedContext(); - // Create a context - TInt configCount = iRenderPlugin->EglChooseConfig(attrs); - EGLConfig config = iRenderPlugin->EglConfig(0); + // eglMakeCurrent with EGL_NO_SURFACE de-couples vgImage from an old eglpbufferfromclient surface. + // Otherwise in a multiple BindClientBuffer scenario for the same vgImage, eglMakeCurrent + // fails with an EGL_BAD_ACCESS error (vgimage already inuse error) + eglMakeCurrent(iRenderPlugin->EglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, context); - // Create a pbuffer surface - iEglPBufferSurface_Client = eglCreatePbufferFromClientBuffer(iRenderPlugin->EglDisplay(), - EGL_OPENVG_IMAGE, - static_cast(aBuffer), // Use the param image as buffer - config, NULL); - - if (iEglPBufferSurface_Client == EGL_NO_SURFACE) + // Bind our own PBuffer surface (from VGImage) + if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client, iEglPBufferSurface_Client, context ) == EGL_FALSE ) { - HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be created, eglErr: %04x"), eglGetError() ); + HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be made current, eglErr: %04x"), eglGetError()); + TInt eglError = eglGetError(); return KErrGeneral; } - // Save current context and surfaces - iSavedContext = eglGetCurrentContext(); - iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW); - iSavedReadSurface = eglGetCurrentSurface(EGL_READ); - - EGLContext context = iRenderPlugin->EglSharedContext(); - - // Bind our own PBuffer surface (from VGImage) - if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client, iEglPBufferSurface_Client, context /*iSavedContext*/) == EGL_FALSE ) - { - HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be made current, eglErr: %04x"), eglGetError()); - return KErrGeneral; - } - // Alles in Ordnung! return KErrNone; } TInt CHuiVg10VgImageBinder::UnBindClientBuffer() { - if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iSavedDrawSurface, iSavedReadSurface, iSavedContext) == EGL_FALSE ) + EGLContext context = iRenderPlugin->EglSharedContext(); + + // eglMakeCurrent with EGL_NO_SURFACE de-couples vgImage from an old eglpbufferfromclient surface. + // Otherwise in a multiple BindClientBuffer scenario for the same vgImage, eglMakeCurrent + // fails with an EGL_BAD_ACCESS error (vgimage already inuse error) + eglMakeCurrent(iRenderPlugin->EglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, context); + + // iSavedDrawSurface and iSavedReadSurface would be the window surface on top of which the + // group opacity vgImages(aBuffers) would have to be drawn. This is the reason why we store + // iSavedDrawSurface only once at the start of BindClientBuffer routine. + if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iSavedDrawSurface, iSavedReadSurface, context) == EGL_FALSE ) { HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be made current, eglErr: %04x"), eglGetError()); return KErrGeneral; } - - iSavedDrawSurface = 0; - iSavedReadSurface = 0; - iSavedContext = 0; + + // When the final UnBindClientBuffer is called and the vgimage has to be drawn on to the window surface. + // We would lose the handles if these iSaved surfaces are set to zero. +// iSavedDrawSurface = 0; +// iSavedReadSurface = 0; +// iSavedContext = 0; if (iEglPBufferSurface_Client) { + TInt bufferIndex = iGroupOpacitySurfaces.Find(iEglPBufferSurface_Client); + iGroupOpacitySurfaces.Remove(bufferIndex); + iGroupOpacityImages.Remove(bufferIndex); eglDestroySurface( iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client ); iEglPBufferSurface_Client = EGL_NO_SURFACE; } - + // Everything went fine return KErrNone; } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasrenderbuffer.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasrenderbuffer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasrenderbuffer.cpp Fri May 14 16:46:13 2010 +0300 @@ -450,3 +450,39 @@ } } +void CHuiVg10CanvasRenderBuffer::InitializeL(const TSize& aSize, TBool aForceClear) + { + if (!IsInitialized()) + { + InitializeL(aSize); + } + else + { + if (aForceClear) + { + CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer(); + + // Reinitialize the context + PushEGLContext(); + + Bind(); + iGc->InitState(); + + VGfloat color[] = + { + 0.f, 0.f, 0.f, 0.f + }; + vgSetfv(VG_CLEAR_COLOR, sizeof(color) / sizeof(VGfloat), color); + vgClear(0, 0, iSize.iWidth, iSize.iHeight); + UnBind(); + + // Let renderer know that we have been fiddlling with OpenVg state directly + // "iGc->InitState" confuses scissoring setting, so lets notify it. + renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor); + renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode); + + PopEGLContext(); + } + } + } + diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Fri May 14 16:46:13 2010 +0300 @@ -3270,7 +3270,7 @@ if (cachedEntry == KErrNotFound) { // Try first getting reused render buffer - newRenderBufferEntry = ReUseReleasedRenderBuffer(aSizeHint); + newRenderBufferEntry = ReUseReleasedRenderBufferL(aSizeHint); // Create new entry object if needed if (!newRenderBufferEntry) @@ -3375,7 +3375,7 @@ // // --------------------------------------------------------------------------- // -CHuiCanvasRenderBufferImage* CHuiCanvasTextureCache::ReUseReleasedRenderBuffer(TSize aSizeHint) +CHuiCanvasRenderBufferImage* CHuiCanvasTextureCache::ReUseReleasedRenderBufferL(TSize aSizeHint) { if (aSizeHint == TSize(0,0)) { @@ -3392,6 +3392,12 @@ // Remove from array and return instance to caller CHuiCanvasRenderBufferImage* reusedEntry = iCachedRenderBuffers[i]; iCachedRenderBuffers.Remove(i); + + if (reusedEntry->iCanvasRenderBuffer && reusedEntry->iCanvasRenderBuffer->IsInitialized()) + { + reusedEntry->iCanvasRenderBuffer->InitializeL(aSizeHint, ETrue); + } + return reusedEntry; } } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Fri May 14 16:46:13 2010 +0300 @@ -706,7 +706,7 @@ RosterImpl().ScanDirty(); } - if (!useDirtyRects || cantUseDirtyRectsInThisFrame || iEnv.EffectsEngine()->HasActiveEffects()) + if (!useDirtyRects || cantUseDirtyRectsInThisFrame || iEnv.EffectsEngine()->HasActiveEffects() || RosterImpl().IsVisibleContentFrozen()) { // Just redraw everything iCurrentDirtyRegions->Reset(); @@ -759,7 +759,7 @@ // need to clear the screen as fade effect uses // always blending. If we do not clear here // fade leaves trails in certain situations. - if (iEnv.EffectsEngine()->HasActiveFadeEffect() + if (iEnv.EffectsEngine()->HasActiveEffects() || RosterImpl().IsVisibleContentFrozen() // guaranteen, that transparent pixels of the UI surface are drawn correctly during layout switch. ) { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Fri May 14 16:46:13 2010 +0300 @@ -81,12 +81,12 @@ ReleaseCachedRenderTarget(); iEngine->RemoveEffect(this); - if (iEngine && iGroupId != KErrNotFound && !iNotifiedEffectReady) + if (iEngine && iGroupId != KErrNotFound && !(iFlags & KHuiReadyToDrawNotified)) { // if effect was deleted before it was drawn, the group must be notified. If this was the last effect in the group // the group will be removed by the EffectReadyToStart - // effect group does not not know, which effects have notified about themselves. thus iNotifiedEffectReady flag is used. - iNotifiedEffectReady = ETrue; + // effect group does not not know, which effects have notified about themselves. + SetEffectFlag(KHuiReadyToDrawNotified); iEngine->NotifyEffectReady(iGroupId); } @@ -95,12 +95,17 @@ #endif } -void CHuiFxEffect::NotifyEffectEndObserver() +TBool CHuiFxEffect::NotifyEffectEndObserver() { + if (iFlags & KHuiEffectObserverNotified) + { + return ETrue; + } + SetEffectFlag(KHuiEffectObserverNotified); // prevent extra notifier calls calls // fade effect should not have observers if (iFlags & KHuiFadeEffectFlag) { - return; + return ETrue; // fade effect does not have observer that would need notification } if (iEffectEndObserver) { @@ -109,7 +114,14 @@ iEffectEndObserver = NULL; // Note: The call below may synchronously delete me (CHuiFxEffect instance) effectEndObserver->AlfGfxEffectEndCallBack( iHandle ); - } + return ETrue; // end observer notified + } + else + { + // must be notified without destroying the effect first. gives alf apps chance + // to do their own cleanup + return EFalse; + } } EXPORT_C void CHuiFxEffect::AddLayerL(const CHuiFxLayer* aLayer) @@ -535,7 +547,7 @@ // NotifyEffectReady will clear KHuiFxReadyAndWaitingGroupToStartSyncronized flag // if all items in the group are ready. iEngine->NotifyEffectReady(iGroupId); - iNotifiedEffectReady = ETrue; + SetEffectFlag(KHuiReadyToDrawNotified); return; } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Fri May 14 16:46:13 2010 +0300 @@ -296,7 +296,13 @@ #ifdef HUIFX_TRACE RDebug::Printf("void CHuiFxEngine::NotifyEffectEndObservers() calling NotifyEffectEndObserver"); #endif - effect->NotifyEffectEndObserver(); + if (!effect->NotifyEffectEndObserver()) + { + // this effect is not in effect cleanupstack and does not have end observer on coretoolkit + // side. However, it might have observer on alf side, that is notified from RemoveEffect. + // Alf clients are responsible for destroying their own effects + RemoveEffect(effect); + } } } } @@ -375,6 +381,8 @@ TInt i = iActiveEffects.Find(aEffect); if (i >= 0) { + // Note, will effecsts will be drawn until they are destroyed. Removing + // from iActiveEffects list only stops timeline updates. iActiveEffects.Remove(i); if (iEffectObserver) { diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/coretoolkit/src/huicanvasrenderbuffer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvasrenderbuffer.cpp Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasrenderbuffer.cpp Fri May 14 16:46:13 2010 +0300 @@ -69,4 +69,8 @@ // Default implementation does nothing } +EXPORT_C void CHuiCanvasRenderBuffer::InitializeL(const TSize& /*aSize*/, TBool /*aForceClear*/) + { + iInitialized = ETrue; + } diff -r f5bac0badc7e -r 6ce30188c5bf uiacceltk/hitchcock/goommonitor/data/goomconfig.xml --- a/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Mon May 03 13:22:43 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Fri May 14 16:46:13 2010 +0300 @@ -67,6 +67,8 @@ this line may be enabled for flashlite and other apps that allocate mem through policy server close_app uid="101FD693" priority="80" sync_mode="check" close_timeout="3000" wait_after_close="5000" --> + +