# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272882163 -10800 # Node ID f5bac0badc7e81ed1d4791136e0278219f8f2722 # Parent 83d2d132aa5817c56819b15a2c2f95ccc38544c8 Revision: 201015 Kit: 201018 diff -r 83d2d132aa58 -r f5bac0badc7e rom/alfred.iby --- a/rom/alfred.iby Fri Apr 16 15:56:24 2010 +0300 +++ b/rom/alfred.iby Mon May 03 13:22:43 2010 +0300 @@ -81,18 +81,23 @@ // Effect fxmls. Keep the list in alphabetical order. When updating the list below, REMEMBER TO ALSO UPDATE core_exports.inc! data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_add_page.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_add_page.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_appear.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_appear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_anim_to_image.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_anim_to_image.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_image_to_image.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_bg_image_to_image.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_editmode.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_editmode.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_widgetmanager.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_widgetmanager.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear_prt.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear_prt.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear_lsc.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_appear_lsc.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear_prt.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear_prt.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear_lsc.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left_disappear_lsc.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_editmode.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_editmode.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_widgetmanager.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_widgetmanager.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_remove_page.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_remove_page.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear_prt.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear_prt.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear_lsc.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_appear_lsc.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear_prt.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear_prt.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear_lsc.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right_disappear_lsc.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/app_activate.fxml RESOURCE_FILES_DIR/effects/app_activate.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/app_exit.fxml RESOURCE_FILES_DIR/effects/app_exit.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/app_start.fxml RESOURCE_FILES_DIR/effects/app_start.fxml @@ -133,10 +138,10 @@ data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_cascade_appear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_cascade_appear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_cascade_disappear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_cascade_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_disappear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_disappear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_fullscreen_close.fxml RESOURCE_FILES_DIR/effects/photos_fullscreen_close.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_fullscreen_open.fxml RESOURCE_FILES_DIR/effects/photos_fullscreen_open.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_gridview_appear.fxml RESOURCE_FILES_DIR/effects/photos_gridview_appear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_gridview_disappear.fxml RESOURCE_FILES_DIR/effects/photos_gridview_disappear.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_fullscreen_close.fxml RESOURCE_FILES_DIR/effects/photos_fullscreen_close.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/photos_fullscreen_open.fxml RESOURCE_FILES_DIR/effects/photos_fullscreen_open.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_appear.fxml RESOURCE_FILES_DIR/effects/popup_appear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_disappear.fxml RESOURCE_FILES_DIR/effects/popup_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_disappear_screenshot.fxml RESOURCE_FILES_DIR/effects/popup_disappear_screenshot.fxml @@ -148,7 +153,6 @@ data=DATAZ_/RESOURCE_FILES_DIR/effects/systemnotify_appear.fxml RESOURCE_FILES_DIR/effects/systemnotify_appear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/systemnotify_disappear.fxml RESOURCE_FILES_DIR/effects/systemnotify_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/tab_effect.fxml RESOURCE_FILES_DIR/effects/tab_effect.fxml -data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_app_start_disappear.fxml RESOURCE_FILES_DIR/effects/taskswapper_app_start_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_app_start_rect.fxml RESOURCE_FILES_DIR/effects/taskswapper_app_start_rect.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_appear.fxml RESOURCE_FILES_DIR/effects/taskswapper_appear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_disappear.fxml RESOURCE_FILES_DIR/effects/taskswapper_disappear.fxml diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_client_server_api/inc/alf/alfappserver.h --- a/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappserver.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappserver.h Mon May 03 13:22:43 2010 +0300 @@ -263,6 +263,9 @@ CAlfAppSrvSessionBase* SrvSessionForControlGroup(CHuiControlGroup& aGroup); + TInt GetLastActiveClient(); + + public: CAlfAppSrvSessionBase* iOldSession; diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h --- a/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h Mon May 03 13:22:43 2010 +0300 @@ -198,10 +198,13 @@ TInt ForceSwRendering(TBool aEnabled); TInt GetSizeAndRotation(TSize& aSize, TInt& aRotation); TInt ReadPixels(CFbsBitmap* aBitmap); - void SetAlfAppWindowGroup( TInt aID ); + void SetAlfAppWindowGroup( TInt aId ); + void RemoveAlfAppWindowGroup( TInt aId ); CAlfAppSrvSessionBase* SrvSessionForControlGroup(CHuiControlGroup& aGroup); void DoBlankScreen(const RMessage2& aMessage); + + TInt GetLastActiveClient(); private: diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_client_server_api/inc/alf/alfdirectclient.h --- a/uiaccelerator_plat/alf_client_server_api/inc/alf/alfdirectclient.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfdirectclient.h Mon May 03 13:22:43 2010 +0300 @@ -57,7 +57,7 @@ * * @param aMode ETrue to enable low memory, EFalse to disable */ - IMPORT_C void EnableLowMemoryState( TBool aMode ); + IMPORT_C void EnableLowMemoryState( TBool aMode, TBool aUseSwRendering); /** * Forces SW rendering to be used. diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Mon May 03 13:22:43 2010 +0300 @@ -451,6 +451,7 @@ void CollectRecursivePaintedRegion(TRegion& aRecursivePaintRegion, TInt aExcludeCanvasFlags) const; TBool CanSkipDrawing() const; + TBool KeepNoCache() const; private: diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSkin.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSkin.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSkin.h Mon May 03 13:22:43 2010 +0300 @@ -241,8 +241,12 @@ */ IMPORT_C virtual TInt GetTexture(TInt aSkinTextureResource, const CHuiTexture*& aOutTexture); - - + + /** + * Release cached textures. + */ + void ReleaseCachedTextures(); + public: /* Implementation of MHuiTextureContentObserver. */ diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionclient.h --- a/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionclient.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionclient.h Mon May 03 13:22:43 2010 +0300 @@ -302,10 +302,18 @@ /** - * Activate drawing for the first time or continue drawing if it is being paused or suspended + * Activate drawing for the first time or continue drawing if it is being paused or suspended **/ IMPORT_C void ActivateL(); + + /* + * An other option to activate/continue drawing. This activate method ensures that no saw-edged black area is seen if client + * only wants to draw one frame. MAlfBufferProvider::ProduceNewFrameL is called from inside ActivateSyncL so that + * surface buffer can be updated before making surface visible. + */ + IMPORT_C void ActivateSyncL(); + /** * Suspend drawing **/ diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h --- a/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h Mon May 03 13:22:43 2010 +0300 @@ -295,4 +295,40 @@ CAlfCompositionSourceData* iData; }; +NONSHARABLE_CLASS(CAlfEffectObserver): public CBase + { +public: + + class MAlfEffectObserver + { + public: + /** bit field */ + enum{ + EAlfEffectStarted = 0x1, + EAlfEffectComplete = 0x2 + }; + virtual void HandleEffectCallback(TInt aType, TInt aHandle, TInt aStatus) = 0; + }; + + IMPORT_C static CAlfEffectObserver* NewL(); + IMPORT_C ~CAlfEffectObserver(); + + /** + * Asks the number of active effects + * @return error code or number of active effects (>= 0). + */ + IMPORT_C TInt ActiveEffectsCount(); + + /** + * Subscribe callback for a handle + * @leave system wide error code + */ + IMPORT_C void SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType = MAlfEffectObserver::EAlfEffectComplete ); + +private: + CAlfEffectObserver(); + class CAlfEffectObserverData; + CAlfEffectObserverData* iData; + }; + #endif // #define __ALFCOMPOSITIONUTILITY_H__ diff -r 83d2d132aa58 -r f5bac0badc7e uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.h --- a/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.h Mon May 03 13:22:43 2010 +0300 @@ -25,6 +25,14 @@ class RFs; class RWsSession; +// temp support for migration +#define __GOOM_PLUGIN_API_V2 + +enum TGOomMonitorFlags + { + KGOomNone = 0, + KGOomUseSwRendering + }; /** * Panic codes with category "OomMonitorPlugin" @@ -66,8 +74,8 @@ * FreeRam is called when the system RAM level becomes * low. This plugin is requested to help free some RAM. */ - virtual void FreeRam(TInt aBytesToFree) = 0; - + //virtual void FreeRam(TInt aBytesToFree); + virtual void FreeRam(TInt aBytesToFree, TInt aFlags) = 0; /** * MemoryGood is called when the system RAM level becomes * good after being low.The plugin may take this opportunity @@ -77,7 +85,8 @@ * used over time, otherwise the plugin may cause oscillation * between low and good memory states. */ - virtual void MemoryGood() = 0; + //virtual void MemoryGood(); + virtual void MemoryGood(TInt aFlags) = 0; public: /** @@ -114,8 +123,8 @@ * @param aBytesToFree The minimum number of bytes of free memory that the plugin should try to free. */ - virtual void FreeRam(TInt aBytesToFree) = 0; - + virtual void FreeRam(TInt aBytesToFree, TInt aFlags) = 0; + /** * MemoryGood is called when the system RAM level becomes * good after being low.The plugin may take this opportunity @@ -125,7 +134,8 @@ * used over time, otherwise the plugin may cause oscillation * between low and good memory states. */ - virtual void MemoryGood() = 0; + virtual void MemoryGood(TInt aFlags) = 0; + }; @@ -170,8 +180,11 @@ private: CAppGOomMonitorPlugin(TUid aAppUid); - void FreeRam(TInt aFreeMemory); + /*void FreeRam(TInt aFreeMemory); void MemoryGood(); + */ + void FreeRam(TInt aBytesToFree, TInt aFlags); + void MemoryGood(TInt aFlags); void SendMessageToApp(TInt aMessage); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def --- a/uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def Mon May 03 13:22:43 2010 +0300 @@ -41,5 +41,12 @@ ??1CAlfCompositionCntrlClient@@UAE@XZ @ 40 NONAME ; CAlfCompositionCntrlClient::~CAlfCompositionCntrlClient(void) ?SetSourceRect@CAlfCompositionSource@@UAEHABVTRect@@@Z @ 41 NONAME ; int CAlfCompositionSource::SetSourceRect(class TRect const &) ?GetListOfInactiveWindowGroupsWSurfaces@RAlfBridgerClient@@QAEHPAV?$RArray@H@@@Z @ 42 NONAME ; int RAlfBridgerClient::GetListOfInactiveWindowGroupsWSurfaces(class RArray *) - ?NewL@CAlfCompositionPixelSource@@SAPAV1@AAVMAlfBufferProvider@@HPAVRWindow@@@Z @ 43 NONAME ; class CAlfCompositionPixelSource * CAlfCompositionPixelSource::NewL(class MAlfBufferProvider &, int, class RWindow *) + ?NewL@CAlfCompositionPixelSource@@SAPAV1@AAVMAlfBufferProvider@@HPAVRWindow@@@Z @ 43 NONAME ; class CAlfCompositionPixelSource * CAlfCompositionPixelSource::NewL(class MAlfBufferProvider &, int, class RWindow *) + ?ActivateSyncL@CAlfCompositionPixelSource@@QAEXXZ @ 44 NONAME ; void CAlfCompositionPixelSource::ActivateSyncL(void) + ?EffectsCount@RAlfBridgerClient@@QAEHXZ @ 45 NONAME ; SBS RULES OK + ?ActiveEffectsCount@CAlfEffectObserver@@QAEHXZ @ 46 NONAME ; int CAlfEffectObserver::ActiveEffectsCount(void) + ?NewL@CAlfEffectObserver@@SAPAV1@XZ @ 47 NONAME ; class CAlfEffectObserver * CAlfEffectObserver::NewL(void) + ??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 *) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def --- a/uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def Mon May 03 13:22:43 2010 +0300 @@ -63,4 +63,13 @@ _ZThn32_N21CAlfCompositionSource13SetSourceRectERK5TRect @ 62 NONAME _ZN17RAlfBridgerClient38GetListOfInactiveWindowGroupsWSurfacesEP6RArrayIiE @ 63 NONAME _ZN26CAlfCompositionPixelSource4NewLER18MAlfBufferProvideriP7RWindow @ 64 NONAME + _ZN26CAlfCompositionPixelSource13ActivateSyncLEv @ 65 NONAME + _ZN17RAlfBridgerClient12EffectsCountEv @ 66 NONAME + _ZN18CAlfEffectObserver18ActiveEffectsCountEv @ 67 NONAME + _ZN18CAlfEffectObserver4NewLEv @ 68 NONAME + _ZN18CAlfEffectObserverD0Ev @ 69 NONAME + _ZN18CAlfEffectObserverD1Ev @ 70 NONAME + _ZN18CAlfEffectObserverD2Ev @ 71 NONAME + _ZN18CAlfEffectObserver18SubscribeCallbackLEPNS_18MAlfEffectObserverEii @ 72 NONAME + _ZN17RAlfBridgerClient30GetListOfWindowGroupsWSurfacesEP6RArrayIiE @ 73 NONAME diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp --- a/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp Mon May 03 13:22:43 2010 +0300 @@ -725,27 +725,22 @@ void RunL() { - if( iStatus == KErrNone ) + if( iStatus != KErrCancel ) { SetActive(); if( !iPixelSource.DrawFrameL(iStatus, iBufferNumber) ) { - __ALFLOGSTRING( "CSurfaceUpdateCallBack::RunL - DrawFrameL returned EFalse -> Pause"); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); + __ALFLOGSTRING( "CSurfaceUpdateCallBack::RunL - DrawFrameL returned EFalse -> Pausing"); + TRequestStatus* status = &iStatus; + User::RequestComplete(status, KErrCancel); Cancel(); - } + } } - else - { - __ALFLOGSTRING1("CSurfaceUpdateCallBack::RunL %d", iStatus.Int()); - iPixelSource.Suspend(); - } + }; + void DoCancel() + { + }; - - }; - void DoCancel() { }; - private: // Data CAlfCompositionPixelSource& iPixelSource; TInt iBufferNumber; @@ -907,7 +902,71 @@ // do nothing if content was already active } - + +// --------------------------------------------------------------------------- +// CAlfCompositionPixelSource::ActivateSyncL +// --------------------------------------------------------------------------- +// +EXPORT_C void CAlfCompositionPixelSource::ActivateSyncL() + { + if( !iData->iWindow && iData->iSurfaceId.IsNull() ) + { + User::Leave(KErrNotReady); + } + TBool pause = EFalse; + if( iData->iSourceStatus == CAlfCompositionPixelSourceData::ESuspended ) + { + MAlfBufferProvider::TBufferCreationAttributes& creationAttribs = iData->iProvider.BufferAttributes(); + + iData->iSurfaceRect = TRect(TPoint(0,0), TSize(creationAttribs.iWidth, creationAttribs.iHeight)); + + ConstructSurfaceL(creationAttribs); + + User::LeaveIfError( iData->iSurfaceUpdateSession.Connect() ); + + // update surface buffer before setting surface as background surface + if( !iData->iSurfaceUpdateWaiter ) + { + iData->iSurfaceUpdateWaiter = new (ELeave) CSurfaceUpdateCallback( *this, 0, iData->iWaiterAoPriority ); + } + + iData->iSurfaceUpdateWaiter->SetActive(); + pause = !DrawFrameL(iData->iSurfaceUpdateWaiter->iStatus ,0); + if(pause && iData->iSurfaceUpdateWaiter->IsActive()) + { + TRequestStatus* status = &iData->iSurfaceUpdateWaiter->iStatus; + User::RequestComplete(status, KErrCancel); + iData->iSurfaceUpdateWaiter->Cancel(); + } + + iData->iWindow->SetBackgroundSurface(iData->iSurfaceId); + + TInt array[] = { 0, iData->iWindow->ClientHandle(), iData->iWindow->WindowGroupId() }; + TInt handle = SendEvent(KAlfCompOpCreateSource, array, sizeof(array)); + CAlfCompositionClientBase::SetHandleL( handle ); + } + + if( iData->iSourceStatus != CAlfCompositionPixelSourceData::EActive && !pause ) + { + + if( !iData->iSurfaceUpdateWaiter ) + { + iData->iSurfaceUpdateWaiter = new (ELeave) CSurfaceUpdateCallback( *this, 0, iData->iWaiterAoPriority ); + } + + if(!iData->iSurfaceUpdateWaiter->IsActive()) + { + iData->iSurfaceUpdateWaiter->SetActive(); + TRequestStatus* status = &iData->iSurfaceUpdateWaiter->iStatus; + User::RequestComplete(status, KErrNone); + } + iData->iProvider.OnActivation(); + iData->iSourceStatus = CAlfCompositionPixelSourceData::EActive; + } + + // do nothing if content was already active and running + } + // --------------------------------------------------------------------------- // CAlfCompositionPixelSource::Suspend // --------------------------------------------------------------------------- @@ -1172,4 +1231,104 @@ CAlfCompositionSource::HandleEventL( aEventType, aEventData ); } +class CAlfSignalObserver; + +class MAlfEffectObserverData + { + public: + virtual void Remove(CAlfSignalObserver* aObserver) = 0; + }; + +NONSHARABLE_CLASS(CAlfEffectObserver::CAlfEffectObserverData): public CBase, public MAlfEffectObserverData + { + public: + void SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType = MAlfEffectObserver::EAlfEffectComplete ); + ~CAlfEffectObserverData(); + void Remove(CAlfSignalObserver* aObserver); + + // data + RAlfBridgerClient iClient; + RPointerArray iObservers; + }; + + +NONSHARABLE_CLASS(CAlfSignalObserver):public CActive + { + public: + CAlfSignalObserver(CAlfEffectObserver::MAlfEffectObserver* aObserver, MAlfEffectObserverData* aOwner, TInt aHandle, TInt aType):CActive(EPriorityStandard), + iOwner(aOwner), iObserver(aObserver), iHandle(aHandle), iType(aType), iArgs(aHandle,aType) + { + CActiveScheduler::Add(this); + SetActive(); + } + + void DoCancel(){} // do not... + + void RunL() + { + iObserver->HandleEffectCallback(iType, iHandle, iStatus.Int()); + iOwner->Remove(this); + } + + MAlfEffectObserverData* iOwner; + CAlfEffectObserver::MAlfEffectObserver* iObserver; + TInt iHandle; + TInt iType; + TIpcArgs iArgs; + }; + +void CAlfEffectObserver::CAlfEffectObserverData::SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType) + { + CAlfSignalObserver* obs = new (ELeave) CAlfSignalObserver(aObserver, this, aHandle, aType); + CleanupStack::PushL(obs); + User::LeaveIfError(iObservers.Append(obs)); + CleanupStack::Pop(); + iClient.SendAsynchronous(EAlfRequestSignal, obs->iArgs, obs->iStatus); + } + +CAlfEffectObserver::CAlfEffectObserverData::~CAlfEffectObserverData() + { + iClient.Close(); // destroys signals + iObservers.ResetAndDestroy(); + } + +void CAlfEffectObserver::CAlfEffectObserverData::Remove(CAlfSignalObserver* aObserver) + { + TInt index = iObservers.Find(aObserver); + iObservers.Remove(index); + delete aObserver; + } + +EXPORT_C CAlfEffectObserver* CAlfEffectObserver::NewL() + { + CAlfEffectObserver* me = new (ELeave) CAlfEffectObserver(); + CleanupStack::PushL(me); + me->iData = new (ELeave) CAlfEffectObserverData(); + User::LeaveIfError(me->iData->iClient.Connect()); + CleanupStack::Pop(); + return me; + } + +EXPORT_C CAlfEffectObserver::~CAlfEffectObserver() + { + delete iData; + } + +EXPORT_C TInt CAlfEffectObserver::ActiveEffectsCount() + { + return iData->iClient.EffectsCount(); + } + +EXPORT_C void CAlfEffectObserver::SubscribeCallbackL(MAlfEffectObserver* aObserver, TInt aHandle, TInt aType) + { + iData->SubscribeCallbackL(aObserver, aHandle, aType ); + } + +CAlfEffectObserver::CAlfEffectObserver() + { + } + + + + //end of file diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp --- a/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp Mon May 03 13:22:43 2010 +0300 @@ -147,13 +147,12 @@ SendReceive(aOp, aIPCArgs, aStatus ); } - -EXPORT_C TInt RAlfBridgerClient::GetListOfInactiveWindowGroupsWSurfaces(RArray* aWindowGroups) +TInt RAlfBridgerClient::GetListOfWindowGroups(RArray* aWindowGroups, TBool aListAll) { TInt err = KErrNone; TInt array[10]; TPtr8 ptr((TUint8*)array,0,40); - err = SendReceive(EAlfGetListOfWGsHavingInactiveSurfaces, TIpcArgs(&ptr)); + err = SendReceive(EAlfGetListOfWGsHavingInactiveSurfaces, TIpcArgs(&ptr, aListAll)); if (!err) { for(TInt i = 0; i < 10; i++) @@ -171,6 +170,28 @@ return err; } +EXPORT_C TInt RAlfBridgerClient::GetListOfInactiveWindowGroupsWSurfaces(RArray* aWindowGroups) + { + return GetListOfWindowGroups(aWindowGroups, EFalse); + } + +EXPORT_C TInt RAlfBridgerClient::GetListOfWindowGroupsWSurfaces(RArray* aWindowGroups) + { + return GetListOfWindowGroups(aWindowGroups, ETrue); + } + + + +// --------------------------------------------------------------------------- +// EffectsCount +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RAlfBridgerClient::EffectsCount() + { + return SendReceive(EAlfGetNumberOfActiveEffects, TIpcArgs()); + } + + // Open // --------------------------------------------------------------------------- // diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Mon May 03 13:22:43 2010 +0300 @@ -366,9 +366,9 @@ TRegionFix<1> clipRegion; clipRegion.AddRect( aClipRect ); - TRgb penColor = TRgb(0x555555); - TRgb brushColor = TRgb(0x555555); - TRgb dotColor = TRgb(0xBBBBBB); + TRgb penColor = TRgb(0x000000); + TRgb brushColor = TRgb(0x000000); + TRgb dotColor = TRgb(0xFFFFFF); WindowRedrawStart( aWindowTreeNode, drawRegion ); iWsGraphicsContext->Reset(); @@ -593,7 +593,9 @@ AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeCount ); AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeGroup, iRsWindowGroupNodeCount ); - AMT_INC_COUNTER(iRsTotalNodeCount ); + AMT_INC_COUNTER(iRsTotalNodeCount ); + + AMT_MAP_RENDER_STAGE_NODE_CREATED(); } // --------------------------------------------------------------------------- @@ -636,7 +638,14 @@ AMT_DEC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeCount ); AMT_DEC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeGroup, iRsWindowGroupNodeCount ); - AMT_DEC_COUNTER(iRsTotalNodeCount ); + AMT_DEC_COUNTER(iRsTotalNodeCount ); + + AMT_MAP_INC_VALUE_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), + iIntMap, aWindowTreeNode.Window()->Handle(), + EAlfModuleTestTypeRenderStageReleaseWindow ); + AMT_MAP_INC_VALUE_IF( ( MWsWindowTreeNode::EWinTreeNodeGroup == nodeType && aWindowTreeNode.WindowGroup() ), + iIntMap, aWindowTreeNode.WindowGroup()->Identifier(), + EAlfModuleTestTypeRenderStageReleaseWindowGroup ); } // --------------------------------------------------------------------------- @@ -655,7 +664,11 @@ iAlfSendBuffer->CommitL(); __ALFLOGSTRING("CAlfRenderStage::NodeActivated <<"); - AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeActivatedCount ); + AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeActivatedCount ); + + AMT_MAP_SET_VALUE_IF( nodeType == MWsWindowTreeNode::EWinTreeNodeClient, + iBoolMap, aWindowTreeNode.Window()->Handle(), ETrue, + EAlfModuleTestTypeRenderStageActiveWindow ); } // --------------------------------------------------------------------------- @@ -695,12 +708,13 @@ AMT_INC_COUNTER( iRsNodeExtentChangedCount ); AMT_SET_VALUE( iRsLatestNodeExtentRect, aRect ); + AMT_MAP_SET_VALUE_IF( ( aWindowTreeNode.Window() ), - iSizeMap, aWindowTreeNode.Window()->Handle(), - aRect.Size(), EAlfModuleTestTypeRenderStageChangeSize ); + iSizeMap, aWindowTreeNode.Window()->Handle(), + aRect.Size(), EAlfModuleTestTypeRenderStageChangeWindowSize ); AMT_MAP_SET_VALUE_IF( ( aWindowTreeNode.Window() ), - iPositionMap, aWindowTreeNode.Window()->Handle(), - aRect.iTl, EAlfModuleTestTypeRenderStageChangePosition ); + iPositionMap, aWindowTreeNode.Window()->Handle(), + aRect.iTl, EAlfModuleTestTypeRenderStageChangeWindowPosition ); } // --------------------------------------------------------------------------- @@ -717,7 +731,7 @@ &aWindowTreeNode ); iAlfSendBuffer->CommitL(); - } + } // --------------------------------------------------------------------------- // FlagChanged @@ -735,9 +749,12 @@ iAlfSendBuffer->CommitL(); AMT_INC_COUNTER( iRsTotalNodeFlagChangedCount ); - AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.Window() ), - iIntMap, aWindowTreeNode.Window()->Handle(), - EAlfModuleTestTypeRenderStageChangeFlag ); + + AMT_MAP_SET_VALUE_IF( ( aWindowTreeNode.Window() && MWsWindowTreeObserver::EVisible == aFlag ), + iBoolMap, + aWindowTreeNode.Window()->Handle(), + aNewValue, + EAlfModuleTestTypeRenderStageChangeWindowVisibility ); } // --------------------------------------------------------------------------- @@ -837,7 +854,9 @@ iAlfSendBuffer->CommitL(); AMT_INC_COUNTER( iRsTotalNodeAttributeChangedCount ); - } + } + + AMT_MAP_RENDER_STAGE_TEXT_CURSOR_CHANGE(); } // --------------------------------------------------------------------------- diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Mon May 03 13:22:43 2010 +0300 @@ -1176,10 +1176,11 @@ // ARRAY IMPLEMENTATION // +#ifdef RD_SUBWINDOW_EFFECTS + const TInt KArrayOffsetTemplate = 23456789; const TInt KArraySizeTemplate = 23456789; -#ifdef RD_SUBWINDOW_EFFECTS void CAlfRsSendBuffer::WriteArrayHeaderTemplateL() { WriteInt8L( EAlfCommandIndexArrayHeader ); @@ -1455,6 +1456,7 @@ iBufStream->Open( iChunk.Base() + sizeof( TChunkHeader), iPrimaryChunkMaxSize ); #else delete iStreamPtr; + iStreamPtr = NULL; iStreamPtr = new(ELeave)TPtr8( (TUint8*)(iChunk.Base() + sizeof( TChunkHeader)), iPrimaryChunkMaxSize - sizeof( TChunkHeader)); iChunkHeader->iMemWriteStream = (RMemWriteStream*)1; #endif diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF --- a/uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF Mon May 03 13:22:43 2010 +0300 @@ -1102,7 +1102,7 @@ ?MeasureFPS@RAlfDirectClient@@QAEXJH@Z @ 1101 NONAME ; void RAlfDirectClient::MeasureFPS(long, int) ??0RAlfDirectClient@@QAE@XZ @ 1102 NONAME ; RAlfDirectClient::RAlfDirectClient(void) ?Disconnect@RAlfDirectClient@@QAEXXZ @ 1103 NONAME ; void RAlfDirectClient::Disconnect(void) - ?EnableLowMemoryState@RAlfDirectClient@@QAEXH@Z @ 1104 NONAME ; void RAlfDirectClient::EnableLowMemoryState(int) + ?EnableLowMemoryState@RAlfDirectClient@@QAEXHH@Z @ 1104 NONAME ; void RAlfDirectClient::EnableLowMemoryState(int, int) ?SetGroupEffectL@CAlfVisual@@QAEXABVTDesC16@@H@Z @ 1105 NONAME ; void CAlfVisual::SetGroupEffectL(class TDesC16 const &, int) ?ForceSwRendering@RAlfDirectClient@@QAEHH@Z @ 1106 NONAME ; int RAlfDirectClient::ForceSwRendering(int) ?Finish@CAlfDrawer@@QAEHXZ @ 1107 NONAME ; int CAlfDrawer::Finish(void) @@ -1110,4 +1110,5 @@ ?NewL@CAlfDrawer@@SAPAV1@XZ @ 1109 NONAME ; class CAlfDrawer * CAlfDrawer::NewL(void) ?BlankScreen@RAlfDirectClient@@QAEHH@Z @ 1110 NONAME ; int RAlfDirectClient::BlankScreen(int) ?FallbackCopyScreenToBitmap@CAlfDrawer@@SAHAAVCWsScreenDevice@@PAVCFbsBitmap@@ABVTRect@@@Z @ 1111 NONAME ; int CAlfDrawer::FallbackCopyScreenToBitmap(class CWsScreenDevice &, class CFbsBitmap *, class TRect const &) + ?CopyScreenToBitmap@AlfDrawerInternal@@SAHPAVMAlfDrawerScreenInterface@@PAVCFbsBitmap@@ABVTRect@@@Z @ 1112 NONAME ; int AlfDrawerInternal::CopyScreenToBitmap(class MAlfDrawerScreenInterface *, class CFbsBitmap *, class TRect const &) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/Client/eabi/alfclientu.DEF --- a/uiacceltk/hitchcock/Client/eabi/alfclientu.DEF Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/Client/eabi/alfclientu.DEF Mon May 03 13:22:43 2010 +0300 @@ -1335,7 +1335,7 @@ _ZN16RAlfDirectClient10DisconnectEv @ 1334 NONAME _ZN16RAlfDirectClientC1Ev @ 1335 NONAME _ZN16RAlfDirectClientC2Ev @ 1336 NONAME - _ZN16RAlfDirectClient20EnableLowMemoryStateEi @ 1337 NONAME + _ZN16RAlfDirectClient20EnableLowMemoryStateEii @ 1337 NONAME _ZN10CAlfVisual15SetGroupEffectLERK7TDesC16i @ 1338 NONAME _ZN16RAlfDirectClient16ForceSwRenderingEi @ 1339 NONAME _ZN10CAlfDrawer4NewLEv @ 1340 NONAME @@ -1345,4 +1345,5 @@ _ZN10CAlfDrawerD2Ev @ 1344 NONAME _ZN16RAlfDirectClient11BlankScreenEi @ 1345 NONAME _ZN10CAlfDrawer26FallbackCopyScreenToBitmapER15CWsScreenDeviceP10CFbsBitmapRK5TRect @ 1346 NONAME + _ZN17AlfDrawerInternal18CopyScreenToBitmapEP25MAlfDrawerScreenInterfaceP10CFbsBitmapRK5TRect @ 1347 NONAME diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/Client/src/alfdirectclient.cpp --- a/uiacceltk/hitchcock/Client/src/alfdirectclient.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/Client/src/alfdirectclient.cpp Mon May 03 13:22:43 2010 +0300 @@ -42,7 +42,7 @@ Send( command, TIpcArgs(aId)); } -EXPORT_C void RAlfDirectClient::EnableLowMemoryState( TBool aMode ) +EXPORT_C void RAlfDirectClient::EnableLowMemoryState( TBool aMode , TBool aUseSwRendering) { if (!Handle()) { diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/Client/src/alfdrawer.cpp --- a/uiacceltk/hitchcock/Client/src/alfdrawer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/Client/src/alfdrawer.cpp Mon May 03 13:22:43 2010 +0300 @@ -22,6 +22,7 @@ #include #include "alfcrppluginclient.h" #include "alflogger.h" +#include "alfdrawerinternal.h" #include #include @@ -42,6 +43,17 @@ // Creates CAlfCrpPluginClient instance. static CAlfCrpPluginClient* CreateAlfCrpClientL(); +NONSHARABLE_CLASS( TAlfDrawerDirectClient ) : public MAlfDrawerScreenInterface + { +public: + TAlfDrawerDirectClient( RAlfDirectClient& aClient ); + TInt GetSizeAndRotation(TSize& aSize, TInt& aRotation); + TInt ReadPixels(CFbsBitmap* aBitmap); + +private: + RAlfDirectClient iClient; + }; + /** * Misc utility methods for CAlfDrawer. */ @@ -93,6 +105,14 @@ CWsScreenDevice& aDevice, CFbsBitmap* aBitmap, const TRect& aRect ); + + /** + * Copies screen to bitmap using 'read pixels' operation. + */ + static void DoCopyScreenToBitmap2L( + MAlfDrawerScreenInterface* aInterface, + CFbsBitmap* aBitmap, + const TRect& aRect ); }; @@ -187,12 +207,29 @@ RAlfDirectClient client; CleanupClosePushL(client); + TAlfDrawerDirectClient clientWrapper(client); + DoCopyScreenToBitmap2L(&clientWrapper, aBitmap, aRect); + + CleanupStack::PopAndDestroy(); // CleanupClosePushL + + __ALFLOGSTRING("DoCopyScreenToBitmapL - Done"); + } + +// --------------------------------------------------------------------------- +// DoCopyScreenToBitmapL +// --------------------------------------------------------------------------- +// +void AlfDrawerUtils::DoCopyScreenToBitmap2L( + MAlfDrawerScreenInterface* aInterface, + CFbsBitmap* aBitmap, + const TRect& aRect ) + { // Get size & virtual rotation from ALF side. // GetSizeAndRotation will also create session to server. TInt rotation = 0; TSize size; - User::LeaveIfError(client.GetSizeAndRotation(size, rotation)); + User::LeaveIfError(aInterface->GetSizeAndRotation(size, rotation)); // Calculate device size in pixels (same as aDevice.SizeInPixels()) TSize deviceSize = size; @@ -216,7 +253,6 @@ actualRect.IsEmpty() ) { __ALFLOGSTRING("DoCopyScreenToBitmapL - empty rect or zero bitmap size"); - CleanupStack::PopAndDestroy(); // CleanupClosePushL return; } @@ -239,7 +275,7 @@ CleanupStack::PushL( surfaceBitmap ); User::LeaveIfError( surfaceBitmap->Create( size, surfaceDisplayMode ) ); - TInt err = client.ReadPixels( surfaceBitmap->Handle() ); + TInt err = aInterface->ReadPixels( surfaceBitmap ); __ALFLOGSTRING1("DoCopyScreenToBitmapL - ReadPixels returned %d", err); User::LeaveIfError( err ); @@ -439,10 +475,6 @@ } CleanupStack::PopAndDestroy( surfaceBitmap ); - - CleanupStack::PopAndDestroy(); // CleanupClosePushL - - __ALFLOGSTRING("DoCopyScreenToBitmapL - Done"); } // --------------------------------------------------------------------------- @@ -473,6 +505,19 @@ } // --------------------------------------------------------------------------- +// CopyScreenToBitmap +// --------------------------------------------------------------------------- +// +EXPORT_C TInt AlfDrawerInternal::CopyScreenToBitmap( + MAlfDrawerScreenInterface* aInterface, + CFbsBitmap* aBitmap, + const TRect& aRect ) + { + TRAPD(err, AlfDrawerUtils::DoCopyScreenToBitmap2L(aInterface, aBitmap, aRect)); + return err; + } + +// --------------------------------------------------------------------------- // CreateAlfCrpClient // --------------------------------------------------------------------------- // @@ -495,3 +540,30 @@ return client; } +// --------------------------------------------------------------------------- +// TAlfDrawerDirectClient +// --------------------------------------------------------------------------- +// +TAlfDrawerDirectClient::TAlfDrawerDirectClient( RAlfDirectClient& aClient ) + : iClient( aClient ) + { + } + +// --------------------------------------------------------------------------- +// GetSizeAndRotation +// --------------------------------------------------------------------------- +// +TInt TAlfDrawerDirectClient::GetSizeAndRotation(TSize& aSize, TInt& aRotation) + { + return iClient.GetSizeAndRotation(aSize, aRotation); + } + +// --------------------------------------------------------------------------- +// ReadPixels +// --------------------------------------------------------------------------- +// +TInt TAlfDrawerDirectClient::ReadPixels(CFbsBitmap* aBitmap) + { + return iClient.ReadPixels(aBitmap->Handle()); + } + diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfdecoderserverclient.h --- a/uiacceltk/hitchcock/CommonInc/alfdecoderserverclient.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/CommonInc/alfdecoderserverclient.h Mon May 03 13:22:43 2010 +0300 @@ -58,7 +58,24 @@ * @return error code. */ IMPORT_C TInt GetListOfInactiveWindowGroupsWSurfaces(RArray* aWindowGroups); + + /** + * Asks list of window groups that have graphics surfaces attached + * @param aArray array to be populated + * @return error code. + */ + IMPORT_C TInt GetListOfWindowGroupsWSurfaces(RArray* aWindowGroups); + + + /** + * Asks the number of active effects + * @return error code or number of active effects (>= 0). + */ + IMPORT_C TInt EffectsCount(); + private: + + TInt GetListOfWindowGroups(RArray* aWindowGroups, TBool aListAll); TInt iSpare1; TInt iSpare2; }; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfdrawerinternal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfdrawerinternal.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2010 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: Internal interface for CAlfDrawer +* +*/ + + + +#ifndef ALFDRAWERINTERNAL_H +#define ALFDRAWERINTERNAL_H + +#include + +/** + * Interface to get screen & parameters + */ +class MAlfDrawerScreenInterface + { +public: + virtual TInt GetSizeAndRotation(TSize& aSize, TInt& aRotation) = 0; + virtual TInt ReadPixels(CFbsBitmap* aBitmap) = 0; + }; + +/** + * Internal drawer interface. + */ +NONSHARABLE_CLASS( AlfDrawerInternal ) + { +public: + IMPORT_C static TInt CopyScreenToBitmap( + MAlfDrawerScreenInterface* aInterface, + CFbsBitmap* aBitmap, + const TRect& aRect ); + }; + +#endif // ALFDRAWERINTERNAL_H diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletest.h --- a/uiacceltk/hitchcock/CommonInc/alfmoduletest.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletest.h Mon May 03 13:22:43 2010 +0300 @@ -14,430 +14,34 @@ * Description: * */ -#include "e32base.h" -#include "e32debug.h" - #ifndef ALFMODULETEST_H #define ALFMODULETEST_H -// Define this to build module testing enchanced version of ALF -//#define USE_MODULE_TEST_HOOKS_FOR_ALF -#if !defined(USE_MODULE_TEST_HOOKS_FOR_ALF) || !defined(AMT_CONTROL) - -#define AMT_DATA() -#define AMT_FUNC(func) -#define AMT_FUNC_EXC(func) -#define AMT_FUNC_EXC_RET(ret, func) -#define AMT_FUNC_EXC_IF(cond, func) -#define AMT_FUNC_EXC_IF_RET(cond, ret, func) -#define AMT_INC_COUNTER(member) -#define AMT_DEC_COUNTER(member) -#define AMT_SET_VALUE(member, val) -#define AMT_GET_VALUE(x, member) -#define AMT_INC_COUNTER_IF(cond, member) -#define AMT_DEC_COUNTER_IF(cond, member) -#define AMT_SET_VALUE_IF(cond, member, val) -#define AMT_GET_VALUE_IF(cond, x, member) +#include +#include +#include -#define AMT_MAP_APPEND(memberMap, key, type, defaultValue) -#define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) -#define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) -#define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) -#define AMT_MAP_SET_VALUE(memberMap, key, value, type) -#define AMT_MAP_INC_VALUE(memberMap, key, type) -#define AMT_MAP_DEC_VALUE(memberMap, key, type) -#define AMT_MAP_RESET(memberMap) - -#define AMT_PRINT_STATE() +// Informs if module test hooks have been set on. +#include "alfmoduletestconf.h" -#ifndef AMT_CONTROL -#error "Error: you need to define AMT_CONTROL macro in your code to be able to use ALF module test system!" -// The user have to define AMT_CONTROL, e.g. like this: -// #define AMT_CONTROL() static_cast(Dll::Tls()) -// or -// #define AMT_CONTROL() iMyModuleTestDataControl -// etc. -#endif - -#else +// Provides module test hooks defines. +#include "alfmoduletestdefines.h" -// *** Use these macros to access global memory chunk - - -// Note: If you read/write a large block of data members, it is advisable not use the AMT_FUNC_EXC() based macros below. -// Use Lock() and Unlock() around the block explicitely, and use AMT_FUNC() macro. -// That is to avoid unnecessary nested lock-unlock sequences (even if nested locks are working ok). - -// Note: Be careful not to lock the the mutex for a long time as it will halt other processes if they are using the lock during that time! - -// Generic macros -#define AMT_DATA() AMT_CONTROL()->iModuleTestData -#define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} -#define AMT_FUNC_EXC(func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();} -#define AMT_FUNC_EXC_RET(ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {ret = func;} AMT_CONTROL()->Unlock();} -#define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();} -#define AMT_FUNC_EXC_IF_RET(cond, ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {ret = func;} AMT_CONTROL()->Unlock();} +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF -// Single operation macros, that will do lock/unlock. -#define AMT_INC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member++) -#define AMT_DEC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member--) -#define AMT_SET_VALUE(member, val) AMT_FUNC_EXC(AMT_DATA()->member=(val)) -#define AMT_GET_VALUE(x, member) AMT_FUNC_EXC((x) = AMT_DATA()->member) -#define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) +// *** Test map classes +#include "alfmoduletesttype.h" +#include "alfmoduletestitem.h" +#include "alfmoduletestmap.h" -// Conditional single operation macros, that will do lock/unlock. -#define AMT_INC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++) -#define AMT_DEC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--) -#define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val)) -#define AMT_GET_VALUE_IF(cond, x, member) AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member) - -// Map operation macros, that will do lock/unlock -#define AMT_MAP_APPEND(memberMap, key, type, defaultValue) AMT_FUNC_EXC(AMT_DATA()->memberMap.Append(key, type, defaultValue)) -#define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.SetValue(key, value, type)) -#define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.Find(key, type)), AMT_DATA()->memberMap.SetValue(key, AMT_DATA()->memberMap.Find(key, type)->Value() + 1, type)) -#define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.Find(key, type)), AMT_DATA()->memberMap.SetValue(key, AMT_DATA()->memberMap.Find(key, type)->Value() - 1, type)) -#define AMT_MAP_SET_VALUE(memberMap, key, value, type) AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetValue(key, value, type)) -#define AMT_MAP_INC_VALUE(memberMap, key, type) AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type) -#define AMT_MAP_DEC_VALUE(memberMap, key, type) AMT_MAP_DEC_VALUE_IF(ETrue, memberMap, key, type) -#define AMT_MAP_RESET(memberMap) AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset()) // *** Global object names _LIT(KAlfModuleTestChunkName, "ALF_MODULE_TEST_CHUNK"); _LIT(KAlfModuleTestMutexName, "ALF_MODULE_TEST_MUTEX"); -/** - * TAlfModuleTestType specifies recognized test types. - */ -enum TAlfModuleTestType - { - // Do not use this value when creating item. - EAlfModuleTestTypeNone, - - // Render stage component specific tests - EAlfModuleTestTypeRenderStageChangeSize, - EAlfModuleTestTypeRenderStageChangePosition, - EAlfModuleTestTypeRenderStageChangeFlag, - - // Streamer hierarchy model component specific tests - EAlfModuleTestTypeHierarchyModelChangeSize, - EAlfModuleTestTypeHierarchyModelChangePosition, - EAlfModuleTestTypeHierarchyModelChangeFlag, - - // Server bridge component specific tests - EAlfModuleTestTypeBridgeChangeSize, - EAlfModuleTestTypeBridgeChangePosition, - EAlfModuleTestTypeBridgeChangeFlag, - - // Do not use this value when creating item. - // This is just meant for Find operations when all tests are accepted. - EAlfModuleTestTypeAll - }; - - -/** - * CAlfModuleTestItem - * - * Provides key-value pair that is used in TAlfModuleTestMap. - */ -template< class T > -NONSHARABLE_CLASS( TAlfModuleTestItem ) - { - -public: - - /** - * Constructor to initialize variables. - * - * @param aKey Key that identifies the item. - * In test cases this could be for example handle. - * @param aTestType Defines for what this test item is meant for. - */ - TAlfModuleTestItem( TInt aKey, const TAlfModuleTestType& aTestType, const T& aDefaultValue ): - iKey( aKey ), - iTestType( aTestType ), - iValue( aDefaultValue ), - iValueSetCount( 0 ) - { - } - - - /** - * @param aObject Value to be compared. - * @return ETrue if given object equals the value of this item. - * Else EFalse. - */ - TBool Equals( const T& aValue, const TAlfModuleTestType& aTestType ) const - { - // Also, check that value has been set. If it has not been set, - // then think objects as unequals. - return ( iValueSetCount > 0 - && iValue == aValue - && TestTypeMatch( aTestType ) ); - } - - - /** - * @return TInt Key that should be set during creation of this object. - */ - TInt Key() const - { - return iKey; - } - - /** - * @see ValueSet to check if the value has already been set. - * - * @return const T& Value that corresonds the key. - */ - const T& Value() const - { - return iValue; - } - - - /** - * @param aValue Value to be set for the key - */ - void SetValue( const T& aValue ) - { - iValue = aValue; - ++iValueSetCount; - } - - - /** - * @return TInt Informs how many times the value has been set. - */ - TInt ValueSetCount() const - { - return iValueSetCount; - } - - /** - * @return const TAlfModuleTestType& Defines what the test is for - */ - const TAlfModuleTestType& TestType() const - { - return iTestType; - } - - - /** - * @param aTestType - * @return TBool ETrue if flag matches this item. Else EFalse. - */ - TBool TestTypeMatch( const TAlfModuleTestType& aTestType ) const - { - return ( EAlfModuleTestTypeAll == aTestType - || iTestType == aTestType ); - } - - - /** - * Resets the item info - */ - void Reset() - { - iValueSetCount = 0; - } - - -private: // data - - TInt iKey; - TAlfModuleTestType iTestType; - T iValue; - TInt iValueSetCount; - - }; - - -/** - * Class CAlfModuleTestMap - * - * Provides map functionality for the key-value-pairs. - * In test cases, this should most likely be used so, that - * first test case classes create items with certain keys, for example with handle values. - * Then, define hooks are used in the code to update values that corresond the correct handles. - * In the end, test case classes can check that items have correct values set and if the test - * is passed. - */ -template< class T > -NONSHARABLE_CLASS( TAlfModuleTestMap ) - { -public: - - // Maximum item count in the map - static const TInt KMaxArrayCount = 50; - - - /** - * Constructor to initialize variables. - */ - TAlfModuleTestMap(): - iCount( 0 ), - iSetValueCallCount( 0 ) - { - } - - - /** - * @param aKey - * @param aTestType Informs what type of test is accepted. Others are skipped. - * @return T* Ownership is not transferred. - * NULL if item is not found. - */ - TAlfModuleTestItem< T >* Find( TInt aKey, const TAlfModuleTestType& aTestType ) - { - // Try to find the item corresponding the given key. - for ( TInt i = 0; i < iCount; ++i ) - { - TAlfModuleTestItem< T >& testItem( iArray[ i ] ); - if ( testItem.Key() == aKey - && testItem.TestTypeMatch( aTestType ) ) - { - return &( testItem ); - } - } - // Item corresponding the given key was not found. - return NULL; - } - - - /** - * Function to append new item into the map. - * - * @param aKey - * @param aTestType Describes for what case the appended test item is created for. - * @return TInt System wide error code. - */ - TInt Append( TInt aKey, const TAlfModuleTestType& aTestType, const T& aDefaultValue ) - { - if ( iCount == KMaxArrayCount ) - { - // Array already full. - return KErrOverflow; - } - else if ( Find( aKey, aTestType ) ) - { - // Key has already been inserted. - return KErrAlreadyExists; - } - - // Append new key value set into the array. - iArray[ iCount ] = TAlfModuleTestItem< T >( aKey, aTestType, aDefaultValue ); - ++iCount; - return KErrNone; - } - - - /** - * Sets the value for the item. - * Item itself should already exist in the array before - * setting its value here. See, Append function. - * - * @param aKey - * @param aValue - * @return TInt System wide error code. - */ - TInt SetValue( TInt aKey, const T& aValue, const TAlfModuleTestType& aTestType ) - { - // Increase counter, because this function is called. - ++iSetValueCallCount; - TAlfModuleTestItem< T >* item( Find( aKey, aTestType ) ); - if ( !item ) - { - // Item was not found from the array. - return KErrNotFound; - } - // Item exists. So, set its values. - item->SetValue( aValue ); - return KErrNone; - } - - - /** - * Resets the map - */ - void Reset() - { - // Just reset the counter. - // We do not bother to reset map items, because when counter is reseted - // already set items and their info is left out of the scope. - iCount = 0; - iSetValueCallCount = 0; - } - - - /** - * Checks if all the values of items in the array match the given value. - * - * @param aValue Reference to the value that items are compared to. - * @param aTestType Informs the test type whose items should be compared. - */ - TInt CountEquals( const T& aValue, const TAlfModuleTestType& aTestType ) const - { - TInt count( 0 ); - for ( TInt i = 0; i < iCount; ++i ) - { - if ( iArray[ i ].Equals( aValue, aTestType ) ) - { - // Item matches - ++count; - } - } - return count; - } - - - /** - * @return TInt Number of map items - */ - TInt ItemCount() const - { - return iCount; - } - - - /** - * @return const TAlfModuleTestItem< T >& Reference to the map item - */ - const TAlfModuleTestItem< T >& Item( TInt aIndex ) const - { - return iArray[ aIndex ]; - } - - - /** - * @return TInt Number of times SetValue function has been called - * since last reset. This information can be used - * to check if hooks have been used correct times during - * a test case. Notice, that this informs the number of - * function calls, not the number of times a value has actually - * set for some item. - */ - TInt SetValueCallCount() const - { - return iSetValueCallCount; - } - - -private: // data - - TAlfModuleTestItem< T > iArray[ KMaxArrayCount ]; - // Informs number of array items - TInt iCount; - // Informs how many times SetItem has been called since last reset. - // Notice, that this informs the number of function calls, not the number - // of times a value has actually set for some item. - TInt iSetValueCallCount; - - }; - - /* * Class CAlfModuleTestData */ @@ -445,7 +49,7 @@ NONSHARABLE_CLASS(CAlfModuleTestData) : public CBase { public: - void PrintState() + void PrintState() const { RDebug::Print(_L("*** ALF INTERNAL STATE ***")); RDebug::Print(_L("iTotalLayerCount[0]=%d"), iTotalLayerCount[0]); @@ -487,24 +91,57 @@ iLatestVisualExtentRect.Width(), iLatestVisualExtentRect.Height()); RDebug::Print(_L("iTotalVisualFlagChangedCount=%d"), iTotalVisualFlagChangedCount); RDebug::Print(_L("iTotalVisualAttributeChangedCount=%d"), iTotalVisualAttributeChangedCount); + RDebug::Print(_L("iBoolMap =>")); + PrintBoolMapState( iBoolMap ); + RDebug::Print(_L("iIntMap =>")); + PrintIntMapState( iIntMap ); RDebug::Print(_L("iSizeMap =>")); PrintSizeMapState( iSizeMap ); RDebug::Print(_L("iPositionMap =>")); - PrintPositionMapState( iPositionMap ); + PrintPositionMapState( iPositionMap ); + RDebug::Print(_L("iSurfaceMap =>")); + PrintSurfaceMapState( iSurfaceMap ); RDebug::Print(_L("*** ALF INTERNAL STATE ***")); } + + void PrintBoolMapState( const TAlfModuleTestMap< TBool >& aMap ) const + { + RDebug::Print(_L("*** ALF INTERNAL BOOL MAP STATE -->")); + RDebug::Print(_L("Map item count=%d"), aMap.ItemCount()); + for ( TInt i = 0; i < aMap.ItemCount(); ++i ) + { + const TAlfModuleTestItem< TBool >& item( aMap.Item( i ) ); + RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValue=%d, iValueSetCount=%d, iLinkTargetKey=%d"), + i, item.TestType(), item.Key(), item.Value(), item.ValueSetCount(), item.LinkTargetKey()); + } + RDebug::Print(_L("<-- ALF INTERNAL BOOL MAP STATE ***")); + } - void PrintSizeMapState( TAlfModuleTestMap< TSize > aMap ) + + void PrintIntMapState( const TAlfModuleTestMap< TInt >& aMap ) const + { + RDebug::Print(_L("*** ALF INTERNAL INT MAP STATE -->")); + RDebug::Print(_L("Map item count=%d"), aMap.ItemCount()); + for ( TInt i = 0; i < aMap.ItemCount(); ++i ) + { + const TAlfModuleTestItem< TInt >& item( aMap.Item( i ) ); + RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValue=%d, iValueSetCount=%d, iLinkTargetKey=%d"), + i, item.TestType(), item.Key(), item.Value(), item.ValueSetCount(), item.LinkTargetKey()); + } + RDebug::Print(_L("<-- ALF INTERNAL INT MAP STATE ***")); + } + + + void PrintSizeMapState( const TAlfModuleTestMap< TSize >& aMap ) const { RDebug::Print(_L("*** ALF INTERNAL SIZE MAP STATE -->")); - RDebug::Print(_L("Map item count=%d, SetValue call count=%d"), - aMap.ItemCount(), aMap.SetValueCallCount()); + RDebug::Print(_L("Map item count=%d"), aMap.ItemCount()); for ( TInt i = 0; i < aMap.ItemCount(); ++i ) { const TAlfModuleTestItem< TSize >& item( aMap.Item( i ) ); - RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d"), - i, item.Key(), item.TestType(), item.ValueSetCount()); + RDebug::Print(_L("Map item %d, iTestType=%d, iKey=%d, iValueSetCount=%d, iLinkTargetKey=%d"), + i, item.TestType(), item.Key(), item.ValueSetCount(), item.LinkTargetKey()); RDebug::Print(_L("Map item index=%d, width=%d, height=%d"), i, item.Value().iWidth, item.Value().iHeight); } @@ -512,23 +149,39 @@ } - void PrintPositionMapState( TAlfModuleTestMap< TPoint > aMap ) + void PrintPositionMapState( const TAlfModuleTestMap< TPoint >& aMap ) const { RDebug::Print(_L("*** ALF INTERNAL POSITION MAP STATE -->")); - RDebug::Print(_L("Map item count=%d, SetValue call count=%d"), - aMap.ItemCount(), aMap.SetValueCallCount()); + RDebug::Print(_L("Map item count=%d"), aMap.ItemCount() ); for ( TInt i = 0; i < aMap.ItemCount(); ++i ) { const TAlfModuleTestItem< TPoint >& item( aMap.Item( i ) ); - RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d"), - i, item.Key(), item.TestType(), item.ValueSetCount()); + RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d, iLinkTargetKey=%d"), + i, item.Key(), item.TestType(), item.ValueSetCount(), item.LinkTargetKey()); RDebug::Print(_L("Map item index=%d, x=%d, y=%d"), i, item.Value().iX, item.Value().iY); } RDebug::Print(_L("<-- ALF INTERNAL POSITION MAP STATE ***")); - } + } + void PrintSurfaceMapState( const TAlfModuleTestMap< TSurfaceId >& aMap ) const + { + RDebug::Print(_L("*** ALF INTERNAL SURFACE MAP STATE -->")); + RDebug::Print(_L("Map item count=%d"), aMap.ItemCount() ); + for ( TInt i = 0; i < aMap.ItemCount(); ++i ) + { + const TAlfModuleTestItem< TSurfaceId >& item( aMap.Item( i ) ); + RDebug::Print(_L("Map item %d, iKey=%d, iTestType=%d, iValueSetCount=%d, iLinkTargetKey=%d"), + i, item.Key(), item.TestType(), item.ValueSetCount(), item.LinkTargetKey()); + RDebug::Print(_L("Map item index=%d, internal0=%d, internal1=%d, internal2=%d, internal3=%d"), + i, item.Value().iInternal[ 0 ], item.Value().iInternal[ 1 ], + item.Value().iInternal[ 2 ], item.Value().iInternal[ 3 ] ); + } + RDebug::Print(_L("<-- ALF INTERNAL SURFACE MAP STATE ***")); + } + + public: TBool iIsEnabled; // *** not yet implemented. For run-time enabling/disabling of the test system. @@ -587,13 +240,19 @@ TInt iASE_Temp3; TInt iASE_Temp4; - // Map that contains integer items that can be specified for certain test cases. + // Map that contains boolean items for certain test cases. + TAlfModuleTestMap< TBool > iBoolMap; + // Map that contains integer items for certain test cases. TAlfModuleTestMap< TInt > iIntMap; - // Map that contains size items that can be specified for certain test cases. + // Map that contains size items for certain test cases. TAlfModuleTestMap< TSize > iSizeMap; - // Map that contains position items that can be specified for certain test cases. - TAlfModuleTestMap< TPoint > iPositionMap; - + // Map that contains position items for certain test cases. + TAlfModuleTestMap< TPoint > iPositionMap; + // Map that contains rect items for certain test cases. + TAlfModuleTestMap< TRect > iRectMap; + // Map that contains surface id items for layer/surface test cases. + TAlfModuleTestMap< TSurfaceId > iSurfaceMap; + }; @@ -650,7 +309,8 @@ CAlfModuleTestData* iModuleTestData; // Not owned }; -#endif +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + #endif // ALFMODULETEST_H diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletestconf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletestconf.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,25 @@ +/* +* 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 ALF_MODULETEST_CONF_H +#define ALF_MODULETEST_CONF_H + +// Define this to build module testing enchanced version of ALF +//#define USE_MODULE_TEST_HOOKS_FOR_ALF + +#endif // ALF_MODULETEST_CONF_H + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletestconsts.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletestconsts.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,53 @@ +/* +* 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: +* +*/ +/** + * Provides general constants for test cases. + */ + +#include "alfmoduletestconf.h" +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + +#ifndef ALFMODULETESTCONSTS_H +#define ALFMODULETESTCONSTS_H + +#include + + +/** + * Constants + */ +namespace AlfModuleTestConsts + { + /** + * When flush is requested, the flow should wait long enough. + * Then, a test case should have plenty of time to finish itself. + */ + const TInt KFlushLongWaitTime( 2000000 ); + + /** + * When flush is requested, the flow should wait. + * Then, a normal test case should have enough time to finish itself. + */ + const TInt KFlushWaitTime( 200000 ); + } + + +#endif // ALFMODULETESTCONSTS_H + +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletestdefines.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletestdefines.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,251 @@ +/* +* 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: +* +*/ +/** + * @see alfmoduletest.h for class implementations that these defines use. + */ + +#ifndef ALF_MODULE_TEST_DEFINES_H +#define ALF_MODULE_TEST_DEFINES_H + + +// Informs if module test hooks have been set on. +#include "alfmoduletestconf.h" + + +#ifndef USE_MODULE_TEST_HOOKS_FOR_ALF + // Use empty defines if module test hook is not set. + + #define AMT_DATA() + #define AMT_FUNC(func) + #define AMT_FUNC_EXC(func) + #define AMT_FUNC_EXC_RET(ret, func) + #define AMT_FUNC_EXC_IF(cond, func) + #define AMT_FUNC_EXC_IF_RET(cond, ret, func) + #define AMT_INC_COUNTER(member) + #define AMT_DEC_COUNTER(member) + #define AMT_SET_VALUE(member, val) + #define AMT_GET_VALUE(x, member) + #define AMT_INC_COUNTER_IF(cond, member) + #define AMT_DEC_COUNTER_IF(cond, member) + #define AMT_SET_VALUE_IF(cond, member, val) + #define AMT_GET_VALUE_IF(cond, x, member) + + #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) + #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) + #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) + #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) + #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) + #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) + #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) + #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) + #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) + #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) + #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) + #define AMT_MAP_SET_VALUE(memberMap, key, value, type) + #define AMT_MAP_INC_VALUE(memberMap, key, type) + #define AMT_MAP_DEC_VALUE(memberMap, key, type) + #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) + #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) + #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) + #define AMT_MAP_RESET(memberMap) + + #define AMT_PRINT_STATE() + +#else + // Module test hook has been set. + + #ifndef AMT_CONTROL + #error "Error: you need to define AMT_CONTROL macro in your code to be able to use ALF module test system!" + // The user have to define AMT_CONTROL, e.g. like this: + // #define AMT_CONTROL() static_cast(Dll::Tls()) + // or + // #define AMT_CONTROL() iMyModuleTestDataControl + // etc. + #endif // AMT_CONTROL + + + // *** Use these macros to access global memory chunk + + + // Note: If you read/write a large block of data members, it is advisable not use the AMT_FUNC_EXC() based macros below. + // Use Lock() and Unlock() around the block explicitely, and use AMT_FUNC() macro. + // That is to avoid unnecessary nested lock-unlock sequences (even if nested locks are working ok). + + // Note: Be careful not to lock the the mutex for a long time as it will halt other processes if they are using the lock during that time! + + // Generic macros + #define AMT_DATA() AMT_CONTROL()->iModuleTestData + #define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} + #define AMT_FUNC_EXC(func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();} + #define AMT_FUNC_EXC_RET(ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {ret = func;} AMT_CONTROL()->Unlock();} + #define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();} + #define AMT_FUNC_EXC_IF_RET(cond, ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {ret = func;} AMT_CONTROL()->Unlock();} + + // Single operation macros, that will do lock/unlock. + #define AMT_INC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member++) + #define AMT_DEC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member--) + #define AMT_SET_VALUE(member, val) AMT_FUNC_EXC(AMT_DATA()->member=(val)) + #define AMT_GET_VALUE(x, member) AMT_FUNC_EXC((x) = AMT_DATA()->member) + + // Conditional single operation macros, that will do lock/unlock. + #define AMT_INC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++) + #define AMT_DEC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--) + #define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val)) + #define AMT_GET_VALUE_IF(cond, x, member) AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member) + + // Map operation macros, that will do lock/unlock + #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) reinterpret_cast< TInt >( keyPtr ) + #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) ) + #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue)) + #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) AMT_MAP_APPEND_IF(ETrue, memberMap, key, defaultValue, type) + #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendLink(type, linkKey, targetKey)) + #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) AMT_MAP_APPEND_LINK_IF(ETrue, memberMap, linkKey, targetKey, type) + #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_IF(cond, memberMap, actualKey, defaultValue, type ); AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, actualKey, type) + #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_AND_LINK_IF(ETrue, memberMap, linkKey, actualKey, defaultValue, type) + #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.SetActualValue(type, key, value)) + #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() + 1)) + #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() - 1)) + #define AMT_MAP_SET_VALUE(memberMap, key, value, type) AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetActualValue(type, key, value)) + #define AMT_MAP_INC_VALUE(memberMap, key, type) AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type) + #define AMT_MAP_DEC_VALUE(memberMap, key, type) AMT_MAP_DEC_VALUE_IF(ETrue, memberMap, key, type) + #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendAccept(testType)) + #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) AMT_MAP_APPEND_ACCEPT_IF(ETrue, memberMap, testType) + #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) AMT_FUNC_EXC(AMT_DATA()->memberMap.ResetItems(type, defaultValue)) + #define AMT_MAP_RESET(memberMap) AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset()) + + #define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) + +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + + +// General defines +// Text cursor handle is defined as constant because correct handle is not provided +// from the window server for render stage. +#define AMT_MAP_TEXT_CURSOR_HANDLE 0 + + +// Notice: +// Defines below will be empty if module test hook is not set. +// If module test hook is set on, then these defines also use functionality defined above. + + +// Render stage defines + +#define AMT_MAP_RENDER_STAGE_NODE_CREATED() \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iIntMap, aWindowTreeNode.Window()->Handle(), 0, EAlfModuleTestTypeRenderStageCreateWindow ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iIntMap, aWindowTreeNode.Window()->Handle(), 0, EAlfModuleTestTypeRenderStageReleaseWindow ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iBoolMap, aWindowTreeNode.Window()->Handle(), EFalse, EAlfModuleTestTypeRenderStageActiveWindow ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iSizeMap, aWindowTreeNode.Window()->Handle(), TSize(), EAlfModuleTestTypeRenderStageChangeWindowSize ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iPositionMap, aWindowTreeNode.Window()->Handle(), TPoint(), EAlfModuleTestTypeRenderStageChangeWindowPosition ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iBoolMap, aWindowTreeNode.Window()->Handle(), EFalse, EAlfModuleTestTypeRenderStageChangeWindowVisibility ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeGroup == nodeType && aWindowTreeNode.WindowGroup() ), iIntMap, aWindowTreeNode.WindowGroup()->Identifier(), 0, EAlfModuleTestTypeRenderStageCreateWindowGroup ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeGroup == nodeType && aWindowTreeNode.WindowGroup() ), iIntMap, aWindowTreeNode.WindowGroup()->Identifier(), 0, EAlfModuleTestTypeRenderStageReleaseWindowGroup ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeStandardTextCursor == nodeType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeRenderStageChangeTextCursorType ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeStandardTextCursor == nodeType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeRenderStageChangeTextCursorClipRect ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeStandardTextCursor == nodeType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeRenderStageChangeTextCursorFlag ); \ + AMT_MAP_APPEND_IF( ( MWsWindowTreeNode::EWinTreeNodeStandardTextCursor == nodeType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeRenderStageChangeTextCursorColor ); \ + \ + AMT_MAP_INC_VALUE_IF( ( MWsWindowTreeNode::EWinTreeNodeClient == nodeType && aWindowTreeNode.Window() ), iIntMap, aWindowTreeNode.Window()->Handle(), EAlfModuleTestTypeRenderStageCreateWindow ); \ + AMT_MAP_INC_VALUE_IF( ( MWsWindowTreeNode::EWinTreeNodeGroup == nodeType && aWindowTreeNode.WindowGroup() ), iIntMap, aWindowTreeNode.WindowGroup()->Identifier(), EAlfModuleTestTypeRenderStageCreateWindowGroup ) + +#define AMT_MAP_RENDER_STAGE_TEXT_CURSOR_CHANGE() \ + AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorType ); \ + AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorClipRect ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorClipRect ); \ + AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorFlags ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorFlag ); \ + AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorColor ) + +#define AMT_MAP_RENDER_STAGE_ADD_LAYER() \ + AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeRenderStageCreateLayer ); \ + AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeRenderStageReleaseLayer ) + +#define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \ + AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeRenderStageCreateLayer ); \ + AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeRenderStageReleaseLayer ); \ + \ + AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeRenderStageCreateLayer ) + + +// Streamer defines + +#define AMT_MAP_STREAMER_NODE_WINDOW_CONSTRUCT() \ + AMT_MAP_APPEND_AND_LINK( iIntMap, iId, iNodeWindowConstructionStruct.iWindowHandle, 0, EAlfModuleTestTypeHierarchyModelCreateWindow ); \ + AMT_MAP_APPEND_AND_LINK( iIntMap, iId, iNodeWindowConstructionStruct.iWindowHandle, 0, EAlfModuleTestTypeHierarchyModelReleaseWindow ); \ + AMT_MAP_APPEND_AND_LINK( iBoolMap, iId, iNodeWindowConstructionStruct.iWindowHandle, EFalse, EAlfModuleTestTypeHierarchyModelActiveWindow ); \ + AMT_MAP_APPEND_AND_LINK( iSizeMap, iId, iNodeWindowConstructionStruct.iWindowHandle, TSize(), EAlfModuleTestTypeHierarchyModelChangeWindowSize ); \ + AMT_MAP_APPEND_AND_LINK( iPositionMap, iId, iNodeWindowConstructionStruct.iWindowHandle, TPoint(), EAlfModuleTestTypeHierarchyModelChangeWindowPosition ); \ + AMT_MAP_APPEND_AND_LINK( iBoolMap, iId, iNodeWindowConstructionStruct.iWindowHandle, EFalse, EAlfModuleTestTypeHierarchyModelChangeWindowVisibility ) + +#define AMT_MAP_STREAMER_NODE_GROUP_CONSTRUCT() \ + AMT_MAP_APPEND_AND_LINK( iIntMap, iId, clientHandle, 0, EAlfModuleTestTypeHierarchyModelCreateWindowGroup ); \ + AMT_MAP_APPEND_AND_LINK( iIntMap, iId, clientHandle, 0, EAlfModuleTestTypeHierarchyModelReleaseWindowGroup ) + +#define AMT_MAP_STREAMER_TEXT_CURSOR_CONSTRUCT() \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeHierarchyModelChangeTextCursorType ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeHierarchyModelChangeTextCursorClipRect ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeHierarchyModelChangeTextCursorFlag ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeHierarchyModelChangeTextCursorColor ) + +#define AMT_MAP_STREAMER_TEXT_CURSOR_CHANGE() \ + AMT_MAP_INC_VALUE_IF( ( attribute == MWsWindowTreeObserver::ECursorType ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeHierarchyModelChangeTextCursorType ); \ + AMT_MAP_INC_VALUE_IF( ( attribute == MWsWindowTreeObserver::ECursorClipRect ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeHierarchyModelChangeTextCursorClipRect ); \ + AMT_MAP_INC_VALUE_IF( ( attribute == MWsWindowTreeObserver::ECursorFlags ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeHierarchyModelChangeTextCursorFlag ); \ + AMT_MAP_INC_VALUE_IF( ( attribute == MWsWindowTreeObserver::ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeHierarchyModelChangeTextCursorColor ) + + +// Alfserver defines + +#define AMT_MAP_BRIDGE_ADD_VISUAL() \ + AMT_MAP_APPEND_AND_LINK( iIntMap, aWindowNodeId, aClientSideId, 0, EAlfModuleTestTypeBridgeCreateWindow ); \ + AMT_MAP_APPEND_AND_LINK( iIntMap, aWindowNodeId, aClientSideId, 0, EAlfModuleTestTypeBridgeReleaseWindow ); \ + AMT_MAP_APPEND_AND_LINK( iBoolMap, aWindowNodeId, aClientSideId, EFalse, EAlfModuleTestTypeBridgeActiveWindow ); \ + AMT_MAP_APPEND_AND_LINK( iSizeMap, aWindowNodeId, aClientSideId, TSize(), EAlfModuleTestTypeBridgeChangeWindowSize ); \ + AMT_MAP_APPEND_AND_LINK( iPositionMap, aWindowNodeId, aClientSideId, TPoint(), EAlfModuleTestTypeBridgeChangeWindowPosition ); \ + AMT_MAP_APPEND_AND_LINK( iBoolMap, aWindowNodeId, aClientSideId, EFalse, EAlfModuleTestTypeBridgeChangeWindowVisibility ); \ + \ + AMT_MAP_APPEND_AND_LINK_IF( aVisual, iRectMap, AMT_MAP_CPTR_TO_KEY_CAST( aVisual ), aClientSideId, TRect(), EAlfModuleTestTypeCoreToolkitDrawWindow ); \ + AMT_MAP_APPEND_AND_LINK_IF( aVisual, iRectMap, AMT_MAP_CPTR_TO_KEY_CAST( aVisual ), aClientSideId, TRect(), EAlfModuleTestTypeCoreToolkitDrawFromRenderBuffer ); \ + \ + AMT_MAP_APPEND( iBoolMap, aClientSideId, ETrue, EAlfModuleTestTypeBridgeCreateWindow ); \ + AMT_MAP_APPEND( iBoolMap, aClientSideId, EFalse, EAlfModuleTestTypeBridgeVisualVisibility ); \ + AMT_MAP_APPEND_LINK_IF( aVisual, iBoolMap, AMT_MAP_CPTR_TO_KEY_CAST( aVisual ), aClientSideId, EAlfModuleTestTypeBridgeVisualVisibility ); \ + AMT_MAP_APPEND( iBoolMap, aClientSideId, EFalse, EAlfModuleTestTypeBridgeReleaseWindow ); \ + AMT_MAP_APPEND_LINK( iBoolMap, aWindowNodeId, aClientSideId, EAlfModuleTestTypeBridgeReleaseWindow ); \ + \ + AMT_MAP_INC_VALUE( iIntMap, aClientSideId, EAlfModuleTestTypeBridgeCreateWindow ) + +#define AMT_MAP_BRIDGE_CREATE_CONTROL_GROUP() \ + AMT_MAP_APPEND_AND_LINK( iIntMap, aWindowGroupNodeId, aClientWindowGroupId, 0, EAlfModuleTestTypeBridgeCreateWindowGroup ); \ + AMT_MAP_APPEND_AND_LINK( iIntMap, aWindowGroupNodeId, aClientWindowGroupId, 0, EAlfModuleTestTypeBridgeReleaseWindowGroup ); \ + \ + AMT_MAP_INC_VALUE( iIntMap, aClientWindowGroupId, EAlfModuleTestTypeBridgeCreateWindowGroup ) + +#define AMT_MAP_BRIDGE_ADD_TEXT_CURSOR() \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeBridgeChangeTextCursorType ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeBridgeChangeTextCursorClipRect ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeBridgeChangeTextCursorFlag ); \ + AMT_MAP_APPEND( iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, 0, EAlfModuleTestTypeBridgeChangeTextCursorColor ) + +#define AMT_MAP_BRIDGE_TEXT_CURSOR_CHANGE() \ + AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorType ); \ + AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorClipRect ); \ + AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorFlag ); \ + AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorColor ) + + +#endif // ALF_MODULE_TEST_DEFINES_H + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletestitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletestitem.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,204 @@ +/* +* 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: +* +*/ +/** + * @note This class is provided only if module test hooks are set on. + */ + +#include "alfmoduletestconf.h" +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + +#ifndef ALFMODULETESTITEM_H +#define ALFMODULETESTITEM_H + +#include +#include "alfmoduletesttype.h" + + +/** + * CAlfModuleTestItem + * + * Provides key-value pair that is used in TAlfModuleTestMap. + */ +template< class T > +NONSHARABLE_CLASS( TAlfModuleTestItem ) + { + +public: + + /** + * Default constructor + * + * This is provided for copy operations that may required default constructor. + * For normal cases, use another constructor instead to initialize the item + * with correct values. + */ + TAlfModuleTestItem(): + iTestType( EAlfModuleTestTypeNone ), + iKey( 0 ), + iValueSetCount( 0 ), + iLinkTargetKey( KErrNotFound ) + { + } + + + /** + * Constructor to initialize variables. + * + * @param aTestType Defines for what this test item is meant for. + * @param aKey Key that identifies the item. + * In test cases this could be for example handle. + * @param aDefaultValue Default value for the map item. + */ + TAlfModuleTestItem( const TAlfModuleTestType& aTestType, TInt aKey, const T& aDefaultValue ): + iTestType( aTestType ), + iKey( aKey ), + iValue( aDefaultValue ), + iValueSetCount( 0 ), + iLinkTargetKey( KErrNotFound ) + { + } + + + /** + * @note Be carefull when comparing items because some items may + * be link items instead of original items. + * + * @param aTestType Test type of accepted item. + * @param aValue Item value to be compared. + * @return ETrue if given object equals the value of this item. + * Else EFalse. + */ + TBool Equals( const TAlfModuleTestType& aTestType, const T& aValue ) const + { + // Also, check that value has been set. If it has not been set, + // then think objects as unequals. + return ( iValueSetCount > 0 + && iValue == aValue + && TestTypeMatch( aTestType ) ); + } + + + /** + * @return TInt Key that should be set during creation of this object. + */ + TInt Key() const + { + return iKey; + } + + + /** + * @see TAlfModuleTestItem::ValueSetCount to check if the value has already been set. + * + * @return const T& Value that corresonds the key. + */ + const T& Value() const + { + return iValue; + } + + + /** + * @param aValue Value to be set for the key + */ + void SetValue( const T& aValue ) + { + iValue = aValue; + ++iValueSetCount; + } + + + /** + * @return TInt Informs how many times the value has been set. + */ + TInt ValueSetCount() const + { + return iValueSetCount; + } + + + /** + * @return const TAlfModuleTestType& Defines what the test is for. + */ + const TAlfModuleTestType& TestType() const + { + return iTestType; + } + + + /** + * @param aTestType Type of the test this item is for. + * @return TBool ETrue if flag matches this item. Else EFalse. + */ + TBool TestTypeMatch( const TAlfModuleTestType& aTestType ) const + { + return ( EAlfModuleTestTypeAll == aTestType + || EAlfModuleTestTypeAll == iTestType + || iTestType == aTestType ); + } + + + /** + * @param aLinkTargetKey Key of the item that this item links to. + * KErrNotFound if this is not a link item. + */ + void SetLinkTargetKey( TInt aLinkTargetKey ) + { + iLinkTargetKey = aLinkTargetKey; + } + + + /** + * @return TInt Key of the item that this item links to. + * KErrNotFound if this is not a link item. + */ + TInt LinkTargetKey() const + { + return iLinkTargetKey; + } + + + /** + * Resets this item to the given default value and + * sets value set count to zero. + * + * @note Type, key and link target remain unchanged. + * + * @param aDefaultValue Default value for the item. + */ + void Reset( const T& aDefaultValue ) + { + iValue = aDefaultValue; + iValueSetCount = 0; + } + + +private: // data + + TAlfModuleTestType iTestType; + TInt iKey; + T iValue; + TInt iValueSetCount; + TInt iLinkTargetKey; + + }; + +#endif // ALFMODULETESTITEM_H + +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletestmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletestmap.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,382 @@ +/* +* 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: +* +*/ +/** + * @note This class is provided only if module test hooks are set on. + */ + +#include "alfmoduletestconf.h" +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + +#ifndef ALFMODULETESTMAP_H +#define ALFMODULETESTMAP_H + +#include +#include "alfmoduletestitem.h" +#include "alfmoduletesttype.h" + + +/** + * Class CAlfModuleTestMap + * + * Provides map functionality for the key-value-pairs. + * In test cases, this should most likely be used so, that + * first test case classes create items with certain keys, for example with handle values. + * Then, define hooks are used in the code to update values that corresond the correct handles. + * In the end, test case classes can check that items have correct values set and if the test + * is passed. + * + * @note When this item is copied, also the contents of the map item array are copied + * into new map item array. In other words, copy can be thought as deep copy + * instead of just shallow copy of array pointer. + * + * @see CAlfModuleTestItem + */ +template< class T > +NONSHARABLE_CLASS( TAlfModuleTestMap ) + { +public: + + // Maximum item count in the map + static const TInt KMaxArrayCount = 100; + + // Maximum accepted test type count in the map + static const TInt KMaxAcceptArrayCount = 20; + + + /** + * Constructor to initialize variables. + */ + TAlfModuleTestMap(): + iArrayCount( 0 ) + { + } + + + /** + * @note This will return normal items and also items that are links. + * + * @param aTestType Informs what type of test is accepted. Others are skipped. + * @param aKey Key of the map item. + * @return T* Ownership is not transferred. + * NULL if item is not found. + */ + TAlfModuleTestItem< T >* Find( const TAlfModuleTestType& aTestType, TInt aKey ) + { + // Try to find the item corresponding the given key. + for ( TInt i = 0; i < iArrayCount; ++i ) + { + TAlfModuleTestItem< T >& testItem( iArray[ i ] ); + if ( testItem.Key() == aKey + && testItem.TestTypeMatch( aTestType ) ) + { + return &( testItem ); + } + } + // Item corresponding the given key was not found. + return NULL; + } + + + /** + * Finds the actual item. + * + * @note If the given key identifies a link item, + * then search is continued to the actual item + * through the link chain. + * Link item is not returned here. + * + * @param aTestType Test type of the linked item and link item. + * @param aKey Key of the item. This can also be a key to a link item. + * @return TAlfModuleTestItem< T >* Actual item. + * NULL if item was not found. + * Ownership is not transferred. + */ + TAlfModuleTestItem< T >* FindActual( const TAlfModuleTestType& aTestType, TInt aKey ) + { + TAlfModuleTestItem< T >* item( Find( aTestType, aKey ) ); + while ( item && item->LinkTargetKey() != KErrNotFound ) + { + // Item is link. + // So, find the actual item through link targets. + item = Find( aTestType, item->LinkTargetKey() ); + } + return item; + } + + + /** + * Function to append new item into the map. + * + * @param aTestType Describes for what case the appended test item is created for. + * @param aKey Key of the map item. + * @param aDefaultValue Default value for the map item. + * @return TInt System wide error code. + */ + TInt Append( const TAlfModuleTestType& aTestType, TInt aKey, const T& aDefaultValue ) + { + if ( !Accept( aTestType ) ) + { + // Given test type has not been set as accepted. + return KErrNotSupported; + } + else if ( Find( aTestType, aKey ) ) + { + // Item already exists in the map. + return KErrAlreadyExists; + } + else if ( iArrayCount == KMaxArrayCount ) + { + // Array already full. + return KErrOverflow; + } + + // Append new item into the array. + iArray[ iArrayCount ] = TAlfModuleTestItem< T >( aTestType, aKey, aDefaultValue ); + ++iArrayCount; + return KErrNone; + } + + + /** + * Creates and appends link item that links to another item. + * + * @param aTestType Test type of the linked item and link item. + * @param aLinkKey Link item key. + * @param aTargetKey Target item key. + * @return TInt System wide error code. + */ + TInt AppendLink( const TAlfModuleTestType& aTestType, TInt aLinkKey, TInt aTargetKey ) + { + if ( !Accept( aTestType ) ) + { + // Given test type has not been set as accepted. + return KErrNotSupported; + } + else if ( Find( aTestType, aLinkKey ) ) + { + // Link item already exists in the map. + return KErrAlreadyExists; + } + else if ( !FindActual( aTestType, aTargetKey ) ) + { + // Link has to point to another existing item. + // Also, link has to point to the chain that ends to actual item. + // Then, links will not create forever loops. Loops could occur + // if links in chain point to each other creating loops. + return KErrNotFound; + } + else if ( iArrayCount == KMaxArrayCount ) + { + // Array already full. + return KErrOverflow; + } + + // Create link item because original item exists and link chain is correct. + // Append new link item into the array and link it to another link or to + // actual item. + TAlfModuleTestItem< T >* target( Find( aTestType, aTargetKey ) ); + // Set value of the link same as its target's value. + iArray[ iArrayCount ] = TAlfModuleTestItem< T >( aTestType, aLinkKey, target->Value() ); + iArray[ iArrayCount ].SetLinkTargetKey( target->Key() ); + ++iArrayCount; + return KErrNone; + } + + + /** + * Sets the value for the actual item. + * Item itself should already appended into map and exist + * in the array before setting its value here. + * + * @note Some items may be links. But, only the value of the + * actual item in the end of the link chain is set here. + * + * @param aTestType Describes for what case the item is for. + * @param aKey Key of the map item. + * @param aValue Value for the map item. + * @return TInt System wide error code. + */ + TInt SetActualValue( const TAlfModuleTestType& aTestType, TInt aKey, const T& aValue ) + { + TAlfModuleTestItem< T >* item( FindActual( aTestType, aKey ) ); + if ( !item ) + { + // Actual item was not found from the array. + return KErrNotFound; + } + + // Actual item exists and it is not link item. So, set its values. + item->SetValue( aValue ); + return KErrNone; + } + + + /** + * Find an actual item if it exists and gets its value if item is found + * and value has been set. + * + * @param aTestType Describes for what case the item is for. + * @param aKey Key of the map item. + * @param aValue If map item is found, value of the item is set here. + * @param aAcceptDefault ETrue if an existing object having its default value + * is accepted. EFalse if value should have been updated + * separately. + * @return TBool ETrue if map item is found and value has been set. Else EFalse. + */ + TBool GetActualValue( + const TAlfModuleTestType& aTestType, TInt aKey, T& aValue, TBool aAcceptDefault ) + { + const TAlfModuleTestItem< T >* item( FindActual( aTestType, aKey ) ); + if ( item && ( aAcceptDefault || item->ValueSetCount() > 0 ) ) + { + aValue = item->Value(); + return ETrue; + } + return EFalse; + } + + + /** + * Finds an actual item if it exists and checks if it equals the given value. + * + * @param aTestType Describes for what case the item is for. + * @param aKey Key of the map item. + * @param aValue Value of the map item. + * @return TBool ETrue if item is found and its value equals given value. Else EFalse. + */ + TBool ActualEquals( const TAlfModuleTestType& aTestType, TInt aKey, const T& aValue ) + { + T value( aValue ); + if ( GetActualValue( aTestType, aKey, value, ETrue ) && value == aValue ) + { + return ETrue; + } + return EFalse; + } + + + /** + * @return TInt Number of map items + */ + TInt ItemCount() const + { + return iArrayCount; + } + + + /** + * @return const TAlfModuleTestItem< T >& Reference to the map item + */ + const TAlfModuleTestItem< T >& Item( TInt aIndex ) const + { + return iArray[ aIndex ]; + } + + + /** + * Appends an accepted test type into the accepted array. + * + * @note Only items of accepted test type can be appended + * into this map. + * + * @param aTestType Test item type that is accepted for this map. + * @return TInt System wide error code. + */ + TInt AppendAccept( const TAlfModuleTestType& aTestType ) + { + if ( Accept( aTestType ) ) + { + // Type already exists in the array. + return KErrAlreadyExists; + } + else if ( iAcceptArrayCount == KMaxAcceptArrayCount ) + { + // Array already full. + return KErrOverflow; + } + + iAcceptArray[ iAcceptArrayCount ] = aTestType; + ++iAcceptArrayCount; + return KErrNone; + } + + + /** + * @param aTestType Test item type to be checked. + * @return TBool ETrue if given test type is set as accepted for this map. + * Else EFalse. + */ + TBool Accept( const TAlfModuleTestType& aTestType ) const + { + for ( TInt i = 0; i < iAcceptArrayCount; ++i ) + { + if ( aTestType == iAcceptArray[ i ] ) + { + return ETrue; + } + } + return EFalse; + } + + + /** + * Resets all the array items that match the given test type + * to given default value. + * + * @param aTestType The test type of items that should be resetted. + * @param aValue Reference to the value that items are resetted to. + */ + void ResetItems( const TAlfModuleTestType& aTestType, const T& aDefaultValue ) + { + for ( TInt i = 0; i < iArrayCount; ++i ) + { + if ( iArray[ i ].TestTypeMatch( aTestType ) ) + { + iArray[ i ].Reset( aDefaultValue ); + } + } + } + + + /** + * Resets the map + */ + void Reset() + { + // Just reset the counter. + // We do not bother to reset map items, because when counter is reseted + // already set items and their info is left out of the scope. + iArrayCount = 0; + iAcceptArrayCount = 0; + } + + +private: // data + + TAlfModuleTestItem< T > iArray[ KMaxArrayCount ]; + TInt iArrayCount; + + TAlfModuleTestType iAcceptArray[ KMaxAcceptArrayCount ]; + TInt iAcceptArrayCount; + + }; + +#endif // ALFMODULETESTMAP_H + +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/CommonInc/alfmoduletesttype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletesttype.h Mon May 03 13:22:43 2010 +0300 @@ -0,0 +1,97 @@ +/* +* 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: +* +*/ +/** + * @note Contents of this file are provided only if module test hooks are set on. + */ + +#include "alfmoduletestconf.h" +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + +#ifndef ALFMODULETESTTYPE_H +#define ALFMODULETESTTYPE_H + +/** + * TAlfModuleTestType specifies recognized test types. + */ +enum TAlfModuleTestType + { + // Do not use this value when creating item. + EAlfModuleTestTypeNone, + + // Render stage component specific tests + EAlfModuleTestTypeRenderStageCreateLayer, + EAlfModuleTestTypeRenderStageReleaseLayer, + EAlfModuleTestTypeRenderStageCreateWindow, + EAlfModuleTestTypeRenderStageReleaseWindow, + EAlfModuleTestTypeRenderStageCreateWindowGroup, + EAlfModuleTestTypeRenderStageReleaseWindowGroup, + EAlfModuleTestTypeRenderStageActiveWindow, + EAlfModuleTestTypeRenderStageChangeWindowSize, + EAlfModuleTestTypeRenderStageChangeWindowPosition, + EAlfModuleTestTypeRenderStageChangeWindowVisibility, + EAlfModuleTestTypeRenderStageChangeTextCursorType, + EAlfModuleTestTypeRenderStageChangeTextCursorClipRect, + EAlfModuleTestTypeRenderStageChangeTextCursorFlag, + EAlfModuleTestTypeRenderStageChangeTextCursorColor, + + // Streamer hierarchy model component specific tests + EAlfModuleTestTypeHierarchyModelCreateLayer, + EAlfModuleTestTypeHierarchyModelReleaseLayer, + EAlfModuleTestTypeHierarchyModelCreateWindow, + EAlfModuleTestTypeHierarchyModelReleaseWindow, + EAlfModuleTestTypeHierarchyModelCreateWindowGroup, + EAlfModuleTestTypeHierarchyModelReleaseWindowGroup, + EAlfModuleTestTypeHierarchyModelActiveWindow, + EAlfModuleTestTypeHierarchyModelChangeWindowSize, + EAlfModuleTestTypeHierarchyModelChangeWindowPosition, + EAlfModuleTestTypeHierarchyModelChangeWindowVisibility, + EAlfModuleTestTypeHierarchyModelChangeTextCursorType, + EAlfModuleTestTypeHierarchyModelChangeTextCursorClipRect, + EAlfModuleTestTypeHierarchyModelChangeTextCursorFlag, + EAlfModuleTestTypeHierarchyModelChangeTextCursorColor, + + // Server bridge component specific tests + EAlfModuleTestTypeBridgeCreateLayer, + EAlfModuleTestTypeBridgeReleaseLayer, + EAlfModuleTestTypeBridgeCreateWindow, + EAlfModuleTestTypeBridgeReleaseWindow, + EAlfModuleTestTypeBridgeCreateWindowGroup, + EAlfModuleTestTypeBridgeReleaseWindowGroup, + EAlfModuleTestTypeBridgeActiveWindow, + EAlfModuleTestTypeBridgeChangeWindowSize, + EAlfModuleTestTypeBridgeChangeWindowPosition, + EAlfModuleTestTypeBridgeChangeWindowVisibility, + EAlfModuleTestTypeBridgeChangeTextCursorType, + EAlfModuleTestTypeBridgeChangeTextCursorClipRect, + EAlfModuleTestTypeBridgeChangeTextCursorFlag, + EAlfModuleTestTypeBridgeChangeTextCursorColor, + EAlfModuleTestTypeBridgeVisualVisibility, + + // Core toolkit component specific tests + EAlfModuleTestTypeCoreToolkitDrawWindow, + EAlfModuleTestTypeCoreToolkitDrawFromRenderBuffer, + + // Do not use this value when creating item. + // This is just meant for Find operations when all tests are accepted. + EAlfModuleTestTypeAll + }; + +#endif // ALFMODULETESTTYPE_H + +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF + +// End of File diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Mon May 03 13:22:43 2010 +0300 @@ -134,7 +134,7 @@ CAlfScreen* aScreen, TBool& aSubtreeVisible, TBool& aHasVisualsWithLayers, - TBool aChildCanBeOpaque ); + TBool aChildCanBeOpaque, TBool aOnlyForEmbeddedAlfApp = EFalse ); /** * Updates layer visibilities. @@ -211,6 +211,7 @@ void EnableSwRenderingL(TBool aEnable = ETrue); TBool PrepareSwRenderingTarget( CAlfScreen* aScreen ); + void InitializeSwRenderingTarget(CFbsBitmap* aBitmap); /** * Sets memory level. @@ -261,21 +262,34 @@ * Sets HuiControlGroup as Alf application window group */ void SetWindowGroupAsAlfApp(TInt aId); + + /** + * removes Alf application window group tag + */ + void RemoveWindowGroupAsAlfApp(TInt aId); // From MHuiSynchronizationObserver void Synchronized(TInt aId); /* - * HandleGfxEndFullScreenTimeout + * GfxTriggerEndFullScreen * * GfxTransEffect API gives EndFullScreen events too late. Thus there is a two stage process for triggering * the EndFullScreen effect after BeginFullScreen event arrived. * - * For application start effects we give N milliseconds timeout for application to finish drawing after - * the first drawing has arrived. If after N milliseconds application has not drawn 75% of the screen, it - * gets another N milliseconds. Most cases, the first N milliseconds is enough. */ - void HandleGfxEndFullScreenTimeout(CFullScreenEffectState* aFullScreenEffectData); + void GfxTriggerEndFullScreen(CFullScreenEffectState* aFullScreenEffectData); + + /* + * GfxTriggerEffectWhenFullScreenDrawn + * + * Goes through the given CHuiControl (group which is supposed to show the effect). + * Triggers the effect, if drawing buffers in group cover the whole screen in the + * current orientation. + * + * @param aToGroup Group to be analyzed + */ + TBool GfxTriggerEffectWhenFullScreenDrawn(CHuiControlGroup* aToGroup = NULL); // Experimental TBool IsFullScreenDrawn( TInt aOrientation); @@ -283,6 +297,8 @@ void LayoutSwitchStart(); void LayoutSwitchComplete(); + RAlfBridgerClient* BridgerClient(); + private: @@ -333,7 +349,17 @@ // component effect handling void HandleGfxControlEffectsL( TAlfBridgerData data ); - + + /** + * StoreLayoutIfRequiredByEffectL + * + * @param aNeededStoredLayout Returns ETrue, if storing is required. Otherwise EFalse. + * + * @return ETrue If storing was required and could be done. + * OR storing was not required. + */ + TBool StoreLayoutIfRequiredByEffectL(CHuiLayout* aLayout, CFullScreenEffectState& aEvent, TBool& aNeededStoredLayout); + /** * Handles begin and end fullscreen events */ @@ -762,6 +788,13 @@ TBool HasActivePaintedAreas( CHuiCanvasVisual& aVisual, TBool aIncludeChildren ); TBool HasActiveFadedChildren( CHuiCanvasVisual& aVisual ); + /* + * This is for updating all the layout that are created to correspond the window server window groups. + * This should be called immediately when layout switch happens. Layout extents must be update then otherwise + * visibility calculations will clip to old sizes. + */ + void UpdateRootVisualsToFullscreen(); + private: RPointerArray iAlfScreens; @@ -954,6 +987,7 @@ mutable RRegionBuf iTempRegion; TBool iBgSurfaceFound; TBool iInLowMemMode; + TBool iLayoutSwitchInProgress; TBool iHomeScreenWallpaperWindowFound; TBool iBgAnimHidden; @@ -969,6 +1003,8 @@ TInt iIdForEAlfDSSynchronizeOp; TInt iIdForLayoutSwitchFrameSync; + RArray iAlfNativeClientsWgIds; + #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER TInt activevisualcount; TInt passivevisualcount; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h Mon May 03 13:22:43 2010 +0300 @@ -219,10 +219,6 @@ void ConstructL(TInt aAction, RMemReadStream& aStream); - TBool InitDelayedEffectL(CAlfBridge* aBridge, TSize aDisplaySize); - - void NotifyDrawingTimeout(); - // Information from BeginFullScreen TInt iType; TInt iToWg; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Mon May 03 13:22:43 2010 +0300 @@ -197,6 +197,11 @@ CAlfNodeRoot* iRootNode; + #ifdef __WINS__ + TInt iDebug_CheckNodeTableItegrityCounter; + void Debug_CheckNodeTableItegrity(const TDesC16& aContext); + #endif + private: // variables RChunk iChunk; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h Mon May 03 13:22:43 2010 +0300 @@ -224,6 +224,12 @@ return iTrackNode; } + #ifdef __WINS__ + void Debug_CheckSiblingOrder(const TDesC16& aContext); + #endif + +public: // Data + CAlfNode* iParent; CAlfNode* iChild; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h Mon May 03 13:22:43 2010 +0300 @@ -192,7 +192,7 @@ }; -NONSHARABLE_CLASS(CAlfStreamerBridge): public CActive, public CHuiEnv::MHuiSwapObserver +NONSHARABLE_CLASS(CAlfStreamerBridge): public CActive { public: @@ -282,74 +282,44 @@ * @return Pointer to the data struct */ const TAny* GetVarDataL( TInt aIndex ); - - /** - * SetStreamerServer() - * - * Sets Streamserver instance. - */ - void SetStreamerServer( CAlfStreamerServer& aStreamerServer ); - /** - * StreamerServer() - * - * Gets Streamserver instance set with set functionality. - * @see SetStreamerServer() - */ - CAlfStreamerServer* StreamerServer(); - + /* deprecated */ IMPORT_C TUid FindAppUidForWgId(TInt aWgId); IMPORT_C TInt FindWgForAppUid(TUid aAppUid); + void SetObserver(MAlfStreamerListener* aObserver) + { + iObserver = aObserver; + } + public: // from CActive void RunL(); - void DoCancel(); -public: // from SwapObserver - void PrepareSwap(); - void SwapComplete(); - void ReleaseWindowServer(TBool aRelease = ETrue); - void SetWgIdArray(TInt* aArray); - private: - + + CAlfStreamerServer* iStreamerServer; MAlfStreamerListener* iObserver; - MAlfBatchObs* iBatchObserver; - TThreadId iThread; RArray iMessages; - RArray iQueue; RCriticalSection iQueueSema; RBuf8 iDataBuf; - - TInt iItemsInBuffer; + volatile TInt iItemsInBuffer; + volatile TBool iVarDataAddedButNotPosted; - RArray iFxMessages; - RArray iFxQueue; - RBuf8 iFxBuf; - TInt iFxItemsInBuffer; - - CAlfStreamerServer* iStreamerServer; #ifdef ALF_DEBUG_TRACK_DRAWING CAlfCommandDebug* iCommandDebugger; #endif - - volatile TBool iSwapActive; - volatile TBool iMakeCurrentActive; - TBool iFxQueueActive; - TInt* iWgArray; - TBool iVarDataAddedButNotPosted; public: - TAlfNativeWindowData iAlfWindowData; - + volatile TAlfNativeWindowData iAlfWindowData; + volatile TInt iActiveEffectCount; }; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Mon May 03 13:22:43 2010 +0300 @@ -42,7 +42,11 @@ EAlfPostDataToCompositionClient, EAlfPostDataToCompositionTarget, EAlfGetListOfWGsHavingInactiveSurfaces, - EAlfQueueRequestBGSessions + EAlfQueueRequestBGSessions, + EAlfGetNumberOfActiveEffects, + EAlfRequestSignal, + EAlfCompleteSignal + }; enum TAlfCompOps{ @@ -83,5 +87,13 @@ TInt iAlfWindowGrpId; TUint iAlfWindowHandle; }; + +/* bitfield*/ +enum TAlfSignalFlags + { + EAlfSignalEffectStarted = 0x1, + EAlfSignalEffectComplete = 0x2, + + }; #endif diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h Mon May 03 13:22:43 2010 +0300 @@ -73,7 +73,9 @@ void AddTargetFromInactiveSurfaces(TInt aTarget); void GetListOfWGsHavingInactiveSurfacesL(const RMessage2& aMessage, TBool aActiveAlso = ETrue); void QueueRequestBGAnimSessionsL(const TPtrC8& aPtr, TInt aOp); - + + void AddSignal(CAlfStreamerServerSession* aSession, const RMessage2& aMessage); + void CompleteSignal(TInt aSignal, TInt aType); private: void ConstructL(); @@ -88,7 +90,6 @@ TInt SearchCommonEntryForToken(const RMessage2& aMessage); CAlfStreamerServerSession* SearchSessionForToken(TInt aToken); - private: CAlfStreamerBridge* iBridge; // not owned mutable TUint iSessions; @@ -130,6 +131,16 @@ CAsyncCallBack * iRendezvous; + struct TAlfSignal + { + CAlfStreamerServerSession* iSession; + RMessagePtr2 iMessage; + TInt iHandle; + TInt iFlags; + }; + + RArray iSignals; + public: struct TAlfCompParams { diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfappserver.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappserver.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappserver.cpp Mon May 03 13:22:43 2010 +0300 @@ -1464,4 +1464,8 @@ return result; } +TInt CAlfAppServer::GetLastActiveClient() + { + return iLastActiveClientWg; + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp Mon May 03 13:22:43 2010 +0300 @@ -24,6 +24,7 @@ MACRO ALF_USE_CANVAS +MACRO ALF_DRAW_FRAME_BEFORE_END_CALLBACK #define ALF_USE_CANVAS // Enable this to add GetWinIdListL method to CAlfWindowManager API. diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp Mon May 03 13:22:43 2010 +0300 @@ -303,7 +303,7 @@ } else { - ShowControlGroupsInOrderL(*display); +// ShowControlGroupsInOrderL(*display); } // This is needed for Huitk BitBlit() to succeed @@ -437,9 +437,9 @@ } } -void CAlfAppSrvSession::ShowControlGroupsInOrderL(CHuiDisplay& aDisplay) +void CAlfAppSrvSession::ShowControlGroupsInOrderL(CHuiDisplay& /*aDisplay*/) { -#ifdef SYMBIAN_BUILD_GCE +/*#ifdef SYMBIAN_BUILD_GCE iControlGroupOrder.Reset(); // gather all the control groups that belong to this session for ( TInt g = 0 ; g < aDisplay.Roster().Count() ; g++ ) @@ -474,7 +474,7 @@ iControlGroupOrder.Remove(iControlGroupOrder.Count()-1); } } - iControlGroupOrder.Reset(); + iControlGroupOrder.Reset();*/ } void CAlfAppSrvSession::ReOrderControlGroupSessionsL( RPointerArray& aGroupSessions ) @@ -1238,7 +1238,8 @@ #ifdef SYMBIAN_BUILD_GCE - CHuiLayout* hostContainer = controlGroup.Control(0).ContainerLayout( NULL ); + CHuiLayout* hostContainer = controlGroup.Control(0).ContainerLayout( NULL ); + controlGroup.SetAcceptInput(EFalse); if(hostContainer) hostContainer->SetFlags(EHuiVisualFlagUnderOpaqueHint); #else diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Mon May 03 13:22:43 2010 +0300 @@ -53,12 +53,12 @@ #include "alfshareddisplaycoecontrol.h" #include "alfuids.h" -#ifdef SYMBIAN_BUILD_GCE #include "alfbridge.h" #include "alfstreamerserver.h" #include "alfdecoderserverclient.h" #include "alfstreamerconsts.h" -#endif // #ifdef SYMBIAN_BUILD_GCE +#include "HuiFxEngine.h" +#include "alfstreamerconsts.h" // DISABLE this if you want to use the AHDemoApp layout switch. If this is enabled // and switch is done through AHDemoApp, the layout will be rotated too much. @@ -67,6 +67,31 @@ #define ALF_USE_EMULATOR_LAYOUT_SWITCH_BUTTON #endif +NONSHARABLE_CLASS(TAlfEffectObserver): public MHuiEffectObserver + { + public: + TAlfEffectObserver(volatile TInt* aEffectCount, CAlfBridge& aBridge):iEffectCount((TInt*)aEffectCount), iBridge(aBridge){} + void EffectAdded(CHuiFxEffect* aEffect) + { + if (iBridge.BridgerClient() && aEffect && aEffect->Handle()) + { + __ALFFXLOGSTRING1("Effect about to start 0x%x", aEffect->Handle()); + iBridge.BridgerClient()->SendBlind(EAlfCompleteSignal, TIpcArgs(aEffect->Handle(), EAlfSignalEffectStarted)); + } + (*iEffectCount)++; + } + void EffectComplete(CHuiFxEffect* aEffect) + { + if (iBridge.BridgerClient() && aEffect && aEffect->Handle()) + { + __ALFFXLOGSTRING1("Effect complete 0x%x", aEffect->Handle()); + iBridge.BridgerClient()->SendBlind(EAlfCompleteSignal, TIpcArgs(aEffect->Handle(), EAlfSignalEffectComplete)); + } + (*iEffectCount)--; + } + TInt* iEffectCount; + CAlfBridge& iBridge; + }; _LIT(KAlfEventThreadName,"alfevents"); NONSHARABLE_CLASS(CAlfEventCatcher): public CActive @@ -407,11 +432,7 @@ { iWsSession.ComputeMode(RWsSession::EPriorityControlDisabled); RThread thread; -#if defined(__EPOC32__) - thread.SetProcessPriority(EPriorityForeground); -#else - thread.SetPriority(EPriorityAbsoluteForegroundNormal); -#endif + thread.SetPriority(EPriorityAbsoluteForegroundNormal); iScreenDevice =new(ELeave) CWsScreenDevice(iWsSession); iScreenDevice->Construct(0); // For main display only @@ -627,20 +648,22 @@ iEventAo->Cancel(); } delete iEventAo; // before session is being terminated + if (iHuiEnv && iHuiEnv->EffectsEngine()) + { + iHuiEnv->EffectsEngine()->SetObserver(0); + delete iAlfEffectObserver; // cannot exist if huienv was not present + } delete iHuiEnv; delete iSharedWindow; -#ifdef SYMBIAN_BUILD_GCE delete iBridgeObj; -#endif // #ifdef SYMBIAN_BUILD_GCE } TBool iAllClientsClosed; // Boolean flag indicating if non-fading of shared window is enabled or disabled. TBool iSharedWindowNonFading; -#ifdef SYMBIAN_BUILD_GCE CAlfBridge* iBridgeObj; CAlfStreamerBridge* iBridge; -#endif // #ifdef SYMBIAN_BUILD_GCE + TAlfEffectObserver* iAlfEffectObserver; RWindow* iPlainWindow; CHuiDisplay* iMainDisplay; CHuiDisplay* iTVDisplay; @@ -756,10 +779,6 @@ { // In NGA master scene graph role, // we must not close the server even there were no hitchcock app clients present -#ifndef SYMBIAN_BUILD_GCE - iData->iAllClientsClosed = ETrue; - CAknEnv::Static()->RunAppShutter(); -#endif // #ifdef SYMBIAN_BUILD_GCE } // --------------------------------------------------------------------------- @@ -838,11 +857,7 @@ CHuiStatic::WsSession().ComputeMode(RWsSession::EPriorityControlDisabled); RThread thread; -#if defined(__EPOC32__) - thread.SetProcessPriority(EPriorityForeground); -#else - thread.SetPriority(EPriorityAbsoluteForegroundNormal); -#endif + thread.SetPriority(EPriorityAbsoluteForeground); // delegates.. iData->iResourceManager = CAlfSrvResourceManager::NewL( *iData->iHuiEnv ); @@ -868,11 +883,19 @@ iData->iPlainWindow->SetBackgroundColor(~0); } -#ifdef SYMBIAN_BUILD_GCE + iData->iBridge = CAlfStreamerBridge::NewL(0); + iData->iBridge->iAlfWindowData.iAlfWindowGrpId = mainWg.Identifier(); + iData->iBridge->iAlfWindowData.iAlfWindowHandle = iData->iPlainWindow->ClientHandle(); + iData->iBridge->iAlfWindowData.iScreenNumber = 0; // TBD multiple screen support iData->iBridgeObj = CAlfBridge::NewL( &iData->iBridge, iData->iHuiEnv ); iData->iBridgeObj->iAppUi = this; - + + iData->iBridge->SetObserver(iData->iBridgeObj); + + iData->iAlfEffectObserver = new (ELeave) TAlfEffectObserver(&iData->iBridge->iActiveEffectCount, *iData->iBridgeObj); + iData->iHuiEnv->EffectsEngine()->SetObserver(iData->iAlfEffectObserver); + if( !iData->iPlainWindow) { // Create default CAlfScreen already now to be able to show controlgroups early enough... @@ -898,16 +921,10 @@ } AppendDisplayOnSharedWindowL(*(iData->iBridgeObj->Display(0))); - - iData->iBridge = CAlfStreamerBridge::NewL(iData->iBridgeObj); - iData->iBridge->iAlfWindowData.iAlfWindowGrpId = mainWg.Identifier(); - iData->iBridge->iAlfWindowData.iAlfWindowHandle = iData->iPlainWindow->ClientHandle(); - iData->iBridge->iAlfWindowData.iScreenNumber = 0; // TBD multiple screen support - + TThreadId threadId; CAlfStreamerServer::LaunchServer(threadId, iData->iBridge); -#endif // #ifdef SYMBIAN_BUILD_GCE // Inform texture manager that env has been created. iData->iServer->TextureManager().HandleEnvCreateL( *iData->iHuiEnv ); @@ -1335,9 +1352,7 @@ // TInt CAlfAppUi::FirstAlfControlGroupIndex( TInt aScreenNumber ) { -#ifdef SYMBIAN_BUILD_GCE return iData->iBridgeObj->FirstAlfControlGroupIndex( aScreenNumber ); -#endif // #ifdef SYMBIAN_BUILD_GCE } // --------------------------------------------------------------------------- @@ -1346,9 +1361,7 @@ // TInt CAlfAppUi::LastAlfControlGroupIndex( TInt aScreenNumber ) { -#ifdef SYMBIAN_BUILD_GCE return iData->iBridgeObj->LastAlfControlGroupIndex( aScreenNumber ); -#endif // #ifdef SYMBIAN_BUILD_GCE } @@ -1358,10 +1371,8 @@ // void CAlfAppUi::ShowControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber ) { -#ifdef SYMBIAN_BUILD_GCE iData->iBridgeObj->ShowControlGroupL(aRoster, aGroup, aWhere, aScreenNumber); iData->iBridgeObj->HandleVisualVisibility( aScreenNumber ); -#endif // #ifdef SYMBIAN_BUILD_GCE } @@ -1458,9 +1469,14 @@ return iData->iBridgeObj->ReadPixels(aBitmap); } -void CAlfAppUi::SetAlfAppWindowGroup( TInt aID ) +void CAlfAppUi::SetAlfAppWindowGroup( TInt aId ) { - iData->iBridgeObj->SetWindowGroupAsAlfApp( aID ); + iData->iBridgeObj->SetWindowGroupAsAlfApp( aId ); + } + +void CAlfAppUi::RemoveAlfAppWindowGroup( TInt aId ) + { + iData->iBridgeObj->RemoveWindowGroupAsAlfApp( aId ); } CAlfAppSrvSessionBase* CAlfAppUi::SrvSessionForControlGroup(CHuiControlGroup& aGroup) @@ -1468,6 +1484,12 @@ return iData->iServer->SrvSessionForControlGroup(aGroup); } + +TInt CAlfAppUi::GetLastActiveClient() + { + return iData->iServer->GetLastActiveClient(); + } + void CAlfAppUi::DoBlankScreen(const RMessage2& aMessage) { __ALFLOGSTRING("CAlfAppUi::DoBlankScreen >>"); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Mon May 03 13:22:43 2010 +0300 @@ -70,6 +70,7 @@ #include "huicanvasrenderbuffer.h" #include "alfeffectutils.h" #include "alfrenderstageutils.h" // for KAlfPSUidSynchronizer & KAlfPSKeySynchronizer +#include "alfdrawerinternal.h" #ifdef HUI_DEBUG_TRACK_DRAWING #include @@ -100,7 +101,15 @@ const TInt KFadeAction = 6000; -// ======== MEMBER FUNCTIONS ======== +NONSHARABLE_CLASS( TAlfBridgeDrawerWrapper ) : public MAlfDrawerScreenInterface + { +public: + TAlfBridgeDrawerWrapper(CAlfBridge& aBridge); + TInt GetSizeAndRotation(TSize& aSize, TInt& aRotation); + TInt ReadPixels(CFbsBitmap* aBitmap); +private: + CAlfBridge& iBridge; + }; // ======== MEMBER FUNCTIONS ======== @@ -141,6 +150,7 @@ // CAlfBridge::~CAlfBridge() { + iAlfNativeClientsWgIds.Close(); delete iOrphanStorage; delete iFadeEffectFile; iWindowHashArray.Close(); @@ -343,6 +353,8 @@ iPreviouslySearchedVisual = aVisual; AMT_INC_COUNTER( iTotalVisualCount ); + + AMT_MAP_BRIDGE_ADD_VISUAL(); } // --------------------------------------------------------------------------- @@ -355,7 +367,10 @@ iWindowHashArray.Remove( aWindowNodeId ); iPreviouslySearchedVisualId = 0; - AMT_DEC_COUNTER( iTotalVisualCount ); + AMT_DEC_COUNTER( iTotalVisualCount ); + + AMT_MAP_INC_VALUE( iIntMap, aWindowNodeId, EAlfModuleTestTypeBridgeReleaseWindow ); + AMT_MAP_SET_VALUE( iBoolMap, aWindowNodeId, ETrue, EAlfModuleTestTypeBridgeReleaseWindow ); } // --------------------------------------------------------------------------- @@ -598,7 +613,7 @@ { iFullScreenEffectData->iFromSecureId = iAlfScreens[0]->iControlGroups[j].iSecureId; iFullScreenEffectData->iFromWg = iAlfScreens[0]->iControlGroups[j].iClientWindowGroupId; - __ALFFXLOGSTRING2("CAlfBridge::ResolveAfterEffectAppearingApplicationL - Found underneath application uid: 0x%x, window group: %d - Start track drawing for exit effect.", iFullScreenEffectData->iFromAppId, iFullScreenEffectData->iFromWg ); + __ALFFXLOGSTRING2("CAlfBridge::ResolveAfterEffectAppearingApplicationL - Found underneath application uid: 0x%x, window group: %d - Start track drawing for exit effect.", iFullScreenEffectData->iFromSecureId, iFullScreenEffectData->iFromWg ); break; } } @@ -619,6 +634,8 @@ { if (iAlfScreens[aScreenNumber]->iDisplay) { + RemoveWindowGroupAsAlfApp(iAlfScreens[aScreenNumber]->iControlGroups[i].iClientWindowGroupId); + CHuiControlGroup* controlGroup = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup; CHuiControl& control = controlGroup->Control(0); CHuiLayout* layout = (CHuiLayout*)&control.Visual(0); @@ -701,7 +718,10 @@ break; } - } + } + + AMT_MAP_INC_VALUE( iIntMap, aWindowGroupNodeId, + EAlfModuleTestTypeBridgeReleaseWindowGroup ); } @@ -736,6 +756,15 @@ // So that's why opaque flag is set to this layout. layout->SetFlag(EHuiVisualFlagOpaqueHint); + for( TInt i = 0 ; i < iAlfNativeClientsWgIds.Count() ; i++ ) + { + if(iAlfNativeClientsWgIds[i] == aClientWindowGroupId) + { + group->iAlfApp = ETrue; + break; + } + } + TAlfControlGroupEntry entry; entry.iControlGroup = group; entry.iWindowGroupNodeId = aWindowGroupNodeId; @@ -780,7 +809,8 @@ AMT_INC_COUNTER( iTotalControlGroupCount ); } - + + AMT_MAP_BRIDGE_CREATE_CONTROL_GROUP(); return *group; } @@ -892,6 +922,14 @@ TBool move = EFalse; // indicates that controlgroup is already in the roster somewhere below the new index. for (TInt i=FirstAlfControlGroupIndex(aScreenNumber); iFlags() & EHuiVisualFlagUnderOpaqueHint) + { + // If the visual is inactive, we should skip it so that alf control + // group ordering would be correct + continue; + } + if (index == aWhere) { if( move ) @@ -953,7 +991,24 @@ TBool lSyncAlfAppAndAlfEventGroup = EFalse; if ( i>0 && aRoster.ControlGroup(i).iAlfApp && aRoster.ControlGroup(i-1).ResourceId() == iAlfWindowGroupNodeId && &aRoster.ControlGroup(i) != &aGroup) { - lSyncAlfAppAndAlfEventGroup = ETrue; + // we still need to check that there are no other alf client window groups on top. + // if one native alf application is embedding another native alf application, WServ + // seems to update wg chains so that the following check must be done + TInt u = i+1; + TBool clienWgFoundOntop =EFalse; + for(;u < aRoster.Count() - screen->FixedControlGroupCount(); u++) + { + if(aRoster.ControlGroup(u).iAlfApp) + { + clienWgFoundOntop = ETrue; + break; + } + } + + if(!clienWgFoundOntop) + { + lSyncAlfAppAndAlfEventGroup = ETrue; + } } aRoster.ShowL(aGroup, i); added = ETrue; @@ -1319,11 +1374,9 @@ TBool fullscreenCovered = EFalse; CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL; - //iActiveVisualCount = 0; iBgSurfaceFound = EFalse; iHomeScreenWallpaperWindowFound = EFalse; - //iPaintedArea = 0; - + // Check if effect group has an effect with opaque hint. CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup); CHuiControl& fxcontrol = fxcontrolgroup.Control(0); @@ -1341,7 +1394,8 @@ TBool alfWindowGroupFoundVisible = EFalse; - + TBool alfClientWindowGroupVisible = EFalse; + AMT_SET_VALUE( iVisibleVisualCount, 0 ); // skip the topmost (effect) layer, start from floating sprite group @@ -1386,22 +1440,29 @@ { CHuiLayout* hostContainer = control.ContainerLayout( NULL ); TInt flags = hostContainer->Flags(); - if (!fullscreenCovered) + if (!fullscreenCovered || alfClientWindowGroupVisible) { // clear inactive flag if client has not made this controlgroup hidden if(!(flags&EHuiVisualFlagUnderOpaqueHint)) { - alfWindowGroupFoundVisible = ETrue; if(iAppUi) { topMostAlfSrvSession = iAppUi->SrvSessionForControlGroup(controlgroup); } - hostContainer->ClearFlags(EHuiVisualFlagInactive); - - // just add the rect to covered region because alf draws solid background - iTempRegion.AddRect(fullscreen); - iTempRegion.Tidy(); - fullscreenCovered = ETrue; + 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 + } } else // else put as inactive { @@ -1446,14 +1507,49 @@ #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 = - HandleLayoutVisualVisibility( layout, controlgroup, control, - fullscreenCovered, fullscreen, screen, - subTreeCovered, hasLayers, IsVisualOpaque(*layout) ); + + TBool hasActiveVisualsInVisualTree(EFalse); + + //embedded 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)) + { + hasActiveVisualsInVisualTree = + HandleLayoutVisualVisibility( layout, controlgroup, control, + hasActiveVisualsInVisualTree, fullscreen, screen, + subTreeCovered, hasLayers, IsVisualOpaque(*layout),alfClientWindowGroupVisible ); + } + + else + { + hasActiveVisualsInVisualTree = + HandleLayoutVisualVisibility( layout, controlgroup, control, + fullscreenCovered, fullscreen, screen, + subTreeCovered, hasLayers, IsVisualOpaque(*layout) ); + } + + TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree); + if(!fullscreenCovered && alfClientWindowGroupVisible) + { + iTempRegion.AddRect(fullscreen); + iTempRegion.Tidy(); + fullscreenCovered = ETrue; + } + // If root visuals effect is marked as opaque, then add whole screen area as covered. if (!fullscreenCovered) { @@ -1511,8 +1607,8 @@ #endif } - - if (iActivated) + + if (iActivated && !iLayoutSwitchInProgress) { if (iBgSurfaceFound || iHomeScreenWallpaperWindowFound) { @@ -1522,6 +1618,11 @@ SetLowMemory(ETrue); iInLowMemMode = ETrue; } + else if (!iBgSurfaceFound && iInLowMemMode) + { + SetLowMemory(EFalse); + iInLowMemMode = EFalse; + } // if the background animation is not hidden yet, hide it now if (!iBgAnimHidden) @@ -1601,7 +1702,8 @@ CAlfScreen* aScreen, TBool& aSubtreeVisible, TBool& aHasVisualsWithLayers, - TBool aChildCanBeOpaque ) + TBool aChildCanBeOpaque, + TBool aOnlyForEmbeddedAlfApp) { TBool visualTreeActive = EFalse; TRect visualDisplayRect; @@ -1663,10 +1765,18 @@ visualDisplayRect = canvasVisual->DisplayRect(); // Make sure we clip visual rect to visible screen area + ClipVisualRect(visualDisplayRect, aLayout->DisplayRect()); ClipVisualRect(visualDisplayRect, aFullscreen); - // Check if this visual is covered by other opaque visuals which rects are in "covered" region - visualRectIsCovered = IsRectCoveredByRegion(visualDisplayRect, iTempRegion); + + // Check if this visual is covered by other opaque visuals which rects are in "covered" region + // it should not check for alf event window group, when we have embedded alf application, + // because we have assumed that alf app will have full screen covered + if(!aOnlyForEmbeddedAlfApp) + { + visualRectIsCovered = IsRectCoveredByRegion(visualDisplayRect, iTempRegion); + } + } /* if ( layout->Effect() || canvasVisual->Effect() ) @@ -1762,12 +1872,22 @@ canvasVisual->LayerExtent() != TRect() && !canvasVisual->LayerUsesAlphaFlag() ) { - // if paintedareacount is exactly one, it means that the window + // if paintedareacount is exactly one or two, it means that the window // has background surface but no drawing commands - if (canvasVisual->PaintedAreaCount() == 1) + TInt areaCount = canvasVisual->PaintedAreaCount(); + // special handling for camera... + TBool incamera = aControlGroup.SecureId() == 0x101f857a; + if (areaCount == 1 || areaCount == 2 || incamera) { - THuiCanvasPaintedArea pa = canvasVisual->PaintedArea(0); - TRect r = pa.iPaintedRect.Round(); + TBool onlyFullScreenAreas = ETrue; + for (TInt count = 0; count < areaCount; count++) + { + TRect area = canvasVisual->PaintedArea(count).iPaintedRect.Round(); + if (area != Display(0)->VisibleArea()) + { + onlyFullScreenAreas = EFalse; + } + } // if we found a fullscreen surface with no other drawing commands // we can safely assume that it's about the only thing to be visible // and we can release memory occupied by other parts of the system @@ -1778,7 +1898,7 @@ // memory state. We want to do it like this as otherwise // we would be triggering for example background animation // on / off quite rapidly........ - if ( r == Display(0)->VisibleArea()) + if ( onlyFullScreenAreas || incamera) { // Final test. Surface must not be ALF surface, but some other surface. CHuiControlGroup* alfControlGroup = FindControlGroupBySecureId( iAlfSecureId ); @@ -1829,6 +1949,7 @@ if ( !canvasVisual->HasCustomShape() ) { TRect displayRect(canvasVisual->DisplayRect()); + ClipVisualRect(displayRect, aLayout->DisplayRect()); ClipVisualRect(displayRect, aFullscreen); #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER @@ -1893,7 +2014,20 @@ visualTreeActive |= visualIsActive; // iVisibleVisualCount is cleared in HandleVisualVisibility() - AMT_INC_COUNTER_IF( visualIsActive && !visualRectIsCovered , iVisibleVisualCount ); + AMT_INC_COUNTER_IF( visualIsActive && visualIsOpaque && !visualRectIsCovered, iVisibleVisualCount ); + + AMT_MAP_SET_VALUE_IF( + visualIsActive && visualIsOpaque && !visualRectIsCovered && (canvasVisual->CanvasFlags() & EHuiCanvasFlagIncludeToVisibilityCalculation), + iBoolMap, + AMT_MAP_CPTR_TO_KEY_CAST( canvasVisual ), + ETrue, + EAlfModuleTestTypeBridgeVisualVisibility); + AMT_MAP_SET_VALUE_IF( + !visualIsActive || !visualIsOpaque || visualRectIsCovered || !(canvasVisual->CanvasFlags() & EHuiCanvasFlagIncludeToVisibilityCalculation), + iBoolMap, + AMT_MAP_CPTR_TO_KEY_CAST( canvasVisual ), + EFalse, + EAlfModuleTestTypeBridgeVisualVisibility); } // for loop end : children checking loop return visualTreeActive; @@ -2300,6 +2434,7 @@ { HandleSetLayoutSwitchEffectL(); iAlfScreens[0]->iDisplay->SetOrientation(huiOrientation); + UpdateRootVisualsToFullscreen(); if (iAppUi) { iAppUi->AdjustWindowGroupPositionL(0,CAlfAppServer::EAlfWindowSize); // hackish, but one way to enforce alf window resizing @@ -2658,9 +2793,9 @@ AMT_INC_COUNTER_IF( viz, iVisualPositionChangedCount ); AMT_SET_VALUE_IF( viz, iLatestVisualExtentRect, TRect( windowAttributes->iPosition, windowAttributes->iSize ) ); - AMT_MAP_SET_VALUE_IF( ( viz && iWindowHashArray.Find( windowNodeId ) ), - iPositionMap, iWindowHashArray.Find( windowNodeId )->iClientSideId, - windowAttributes->iPosition, EAlfModuleTestTypeBridgeChangePosition ); + AMT_MAP_SET_VALUE_IF( viz, iPositionMap, windowNodeId, + windowAttributes->iPosition, + EAlfModuleTestTypeBridgeChangeWindowPosition ); } // --------------------------------------------------------------------------- @@ -2692,9 +2827,10 @@ AMT_INC_COUNTER_IF(viz, iVisualSizeChangedCount ); AMT_SET_VALUE_IF(viz, iLatestVisualExtentRect, TRect( windowAttributes->iPosition, windowAttributes->iSize ) ); - AMT_MAP_SET_VALUE_IF( ( viz && iWindowHashArray.Find( windowNodeId ) ), - iSizeMap, iWindowHashArray.Find( windowNodeId )->iClientSideId, - windowAttributes->iSize, EAlfModuleTestTypeBridgeChangeSize ); + + AMT_MAP_SET_VALUE_IF( viz, iSizeMap, windowNodeId, + windowAttributes->iSize, + EAlfModuleTestTypeBridgeChangeWindowSize ); } // --------------------------------------------------------------------------- @@ -3106,7 +3242,6 @@ && iFullScreenEffectData->iEffectType != CFullScreenEffectState::ENotDefinedEffect && !iFullScreenEffectData->iEndFullScreen) { - CHuiControlGroup *to_group = NULL; if (iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect) { @@ -3122,22 +3257,10 @@ // 2. only the first drawing commands will trigger EndFullScreen // (this mechanism is here because we want to remove delay from fullscreen effects - and EndFullScreens are coming from application too late) - if (viz->Owner().ControlGroup() == to_group) + if (viz && viz->Owner().ControlGroup() == to_group) { - if (!iFullScreenEffectData->iDrawingCompleteTimer) - { - iFullScreenEffectData->InitDelayedEffectL(this, iAlfScreens[0]->Size()); - } - THuiCanvasPaintedArea p = viz->PaintedArea(0); - iFullScreenEffectData->iPaintedRegion.AddRect( p.iPaintedRect.Round() ); - TRect b = iFullScreenEffectData->iPaintedRegion.BoundingRect(); - __ALFFXLOGSTRING3( - "CAlfBridge::HandlePostCanvasBufferL : Effect to visual 0x%x, Covered rect: iTl.iX: %d , iTl.iY: %d", - viz, - b.iTl.iX, - b.iTl.iY); - __ALFFXLOGSTRING2("CAlfBridge::HandlePostCanvasBufferL : iBr.iX: %d, iBr.iY: %d", b.iBr.iX, b.iBr.iY); - } + GfxTriggerEffectWhenFullScreenDrawn(to_group); + } } #endif } @@ -3146,7 +3269,7 @@ // HandleGfxEndFullScreenTimeout // --------------------------------------------------------------------------- // -void CAlfBridge::HandleGfxEndFullScreenTimeout(CFullScreenEffectState* aFullScreenEffectData) +void CAlfBridge::GfxTriggerEndFullScreen(CFullScreenEffectState* aFullScreenEffectData) { if (aFullScreenEffectData->iEndFullScreen) { @@ -3206,6 +3329,7 @@ } else { + __ALFFXLOGSTRING2("CAlfBridge::SetWindowActiveL 0x%x has active effect. New state: %d", aVisual, aActive); // Has effect // these flags are put to action in RemoveTemporaryPresenterItem if (aActive) @@ -3213,8 +3337,11 @@ // this prevents windows appearing before their "effected" time if (!iEffectCleanupStack[effectIndex].iHideWhenFinished) { - // this is appear effect. Lets show it + // this is appear effect. Lets show it. if effect would be stopped + // by some other effect, then EHuiVisualFlagShouldBeShown assures the correct state + // after cleanup. aVisual->iOpacity.Set(KAlfVisualDefaultOpacity); + aVisual->SetFlag(EHuiVisualFlagShouldBeShown); } else { @@ -3229,7 +3356,10 @@ // will only break the "live view" if (iEffectCleanupStack[effectIndex].iCanDestroyOrHideImmediately && !aVisual->Effect()) { - aVisual->ClearFlags(EHuiVisualFlagShouldBeShown | EHuiVisualFlagShouldBeHidden); + aVisual->ClearFlags(EHuiVisualFlagShouldBeShown); + aVisual->SetFlag(EHuiVisualFlagShouldBeHidden); + //if effect would be stopped by some other effect, then EHuiVisualFlagShouldBeShown flag + // assures the correct state after cleanup. aVisual->iOpacity.Set(0.0f); } else @@ -3320,9 +3450,11 @@ AMT_INC_COUNTER( iTotalVisualFlagChangedCount ); AMT_INC_COUNTER_IF( windowAttributes->iActive, iActiveVisualCount ); AMT_INC_COUNTER_IF( !windowAttributes->iActive, iPassiveVisualCount ); - AMT_MAP_INC_VALUE_IF( ( iWindowHashArray.Find( windowNodeId ) ), - iIntMap, iWindowHashArray.Find( windowNodeId )->iClientSideId, - EAlfModuleTestTypeBridgeChangeFlag ); + + AMT_MAP_SET_VALUE( iBoolMap, windowNodeId, windowAttributes->iActive, + EAlfModuleTestTypeBridgeChangeWindowVisibility ); + AMT_MAP_SET_VALUE( iBoolMap, windowNodeId, windowAttributes->iActive, + EAlfModuleTestTypeBridgeActiveWindow ); } @@ -3883,6 +4015,37 @@ return has; } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAlfBridge::UpdateRootVisualsToFullscreen() + { + if (!iAlfScreens.Count()) + { + return; + } + + // update all the layouts even inactive ones. + CAlfScreen* screen = iAlfScreens[0]; + TRect fullscreen = TRect(TPoint(0,0), screen->Size()); + for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) + { + CHuiControlGroup& controlgroup = screen->iDisplay->Roster().ControlGroup(j); + CHuiControl& control = controlgroup.Control(0); + + if( control.Role() == EAlfWindowGroupContainer) + { + // Only update layout which are made to correspond window groups. + // Layouts that fullscreen effects are applied to + CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0); + layout->SetPos(fullscreen.iTl); + layout->SetSize(fullscreen.Size()); + } + } + } + + // --------------------------------------------------------------------------- // SetupFadeEffectL @@ -4167,7 +4330,9 @@ __ALFLOGSTRING1("CAlfBridge::HandleSetCursorDataL - WARNING! Cursor node 0x%x not found!", windowNodeId); } - AMT_INC_COUNTER_IF(viz, iTotalVisualAttributeChangedCount); + AMT_INC_COUNTER_IF(viz, iTotalVisualAttributeChangedCount); + + AMT_MAP_BRIDGE_TEXT_CURSOR_CHANGE(); } // --------------------------------------------------------------------------- @@ -4226,9 +4391,48 @@ { return aEngine->FxmlUsesInput1(aFileName); } - +TBool FxmlHasOpaqueHint(CHuiFxEngine *aEngine, const TDesC &aFileName) + { + return aEngine->FxmlUsesOpaqueHint(aFileName); + } + +// --------------------------------------------------------------------------- +// StoreLayoutIfRequiredByEffectL +// +// Certains effects require screenshot to be taken when BeginFullScreen event +// is triggered. This method will take a screenshot (of the whole screen), if +// there is enough memory available. +// --------------------------------------------------------------------------- +// +TBool CAlfBridge::StoreLayoutIfRequiredByEffectL(CHuiLayout* aLayout, CFullScreenEffectState& aEvent, TBool& aNeededStoredLayout) + { + aNeededStoredLayout = NeedsStoredBuffers(iHuiEnv->EffectsEngine(), *aEvent.iEffectName); + __ALFFXLOGSTRING2("CAlfBridge::StoreLayoutIfRequiredByEffectL - aHandle: %d, Take screenhot: %d", aEvent.iHandle, aNeededStoredLayout); + if (aNeededStoredLayout) + { + TRAPD(err,StoreRenderBufferStartL(aLayout)); + __ALFFXLOGSTRING1("CAlfBridge::StoreLayoutIfRequiredByEffectL - Screenshot result: KErrNone == %d", err); + if (err == KErrNone) + { + aLayout->SetFreezeState(ETrue); + aEvent.iCanDestroyOrHideImmediately = ETrue; // if children of this layout are hidden or destroyed during effect, that can happen immediately + return ETrue; // storing of content requesteds, could store the content => success + } + else + { + return EFalse; // could not store the content => failed + } + } + else + { + __ALFFXLOGSTRING("CAlfBridge::StoreLayoutIfRequiredByEffectL - Storing not required"); + return ETrue; // no storing requred, no screenshot required => success + } + } + TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout) { + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - To SecureUid: 0x%x, From SecureUid: 0x%x", aEvent.iToSecureId, aEvent.iFromSecureId); __ALFFXLOGSTRING4("CAlfBridge::HandleGfxEventL - To layout: 0x%x, From layout: 0x%x, Effect handle: %d, Action: %d", aToLayout, aFromLayout, aEvent.iHandle, aEvent.iAction); TInt err = KErrNone; TBool failed = EFalse; @@ -4251,22 +4455,26 @@ case MAlfGfxEffectPlugin::EBeginFullscreen: { aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); - TBool needStoredBuffers = NeedsStoredBuffers(engine, *aEvent.iEffectName); - __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - EBeginFullScreen: %d, Take screenhot: %d", aEvent.iHandle, needStoredBuffers); - if (needStoredBuffers) + TBool neededStoredBuffers; + TBool success = StoreLayoutIfRequiredByEffectL(aToLayout, aEvent, neededStoredBuffers); + + // if screenshot was requested and it was possible to take one, then add this layout + // to effectcleanup stack + if (neededStoredBuffers) { - TRAP(err,StoreRenderBufferStartL(aToLayout)); - __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EBeginFullScreen: Screenshot result: KErrNone == %d", err); - if (err == KErrNone) - { - aToLayout->SetFreezeState(ETrue); - aEvent.iCanDestroyOrHideImmediately = ETrue; // if children of this layout are hidden or destroyed during effect, that can happen immediately - } - else - { - return ETrue; // failed, effect will be canceled - } + TInt dummy; + if (!HasActiveEffect(aToLayout, dummy)) + { + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Add layout 0x%x with handle %d to cleanupstack", aToLayout, aEvent.iHandle); + AddEffectItemL(aEvent.iHandle, aToLayout, NULL, NULL, EFalse, dummy, EFalse); + } } + // Screenshot was requested, but it could not be taken. Lets cancel the effect. + if (!success) + { + return ETrue; // this will cause effect cleanup + } + switch(aEvent.iAction) { @@ -4279,6 +4487,7 @@ 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); aEvent.iEffectType = CFullScreenEffectState::EStartEffect; + aEvent.iCanDestroyOrHideImmediately = ETrue; // enable hiding of windows during application start/activate effects break; } case AknTransEffect::EApplicationExit: @@ -4299,8 +4508,18 @@ __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Found effect on layout 0x%x. Removing effect 0x%x", aToLayout, aToLayout->Effect()); aToLayout->SetEffect(NULL); } - if ( aEvent.iAction == AknTransEffect::EApplicationExit && !(aToLayout->Flags() & EHuiVisualFlagInactive)) + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Layout 0x%x is active: %d", aToLayout, !TBool(aToLayout->Flags() & EHuiVisualFlagInactive) ); + if (!(aToLayout->Flags() & EHuiVisualFlagInactive)) { + TInt index; + if (aToLayout->StoredRenderBuffer() && HasActiveEffect(aToLayout, index) && index != KErrNotFound) + { + // a screenshot has been saved into the layout, and the layout was added to cleanupstack + // for cleaning. SetupEffectLayoutContainerL will add the same layout + // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); + iEffectCleanupStack.Remove(index); + } // this will tag the visual, that they cannot be hidden by HandleVisualVisibility // Initialize layout for the exit effect iLayoutInitializedForExitEffect = SetupEffectLayoutContainerL(aEvent.iHandle, aToLayout, ETrue, aEvent.iCanDestroyOrHideImmediately); @@ -4311,6 +4530,7 @@ { iLayoutInitializedForExitEffect = EFalse; aEvent.iSetupDone = EFalse; + failed = ETrue; } return failed; } @@ -4337,21 +4557,37 @@ { // Exit effect was initialized earlier with EBeginFullscreen event layoutEffectable = aEvent.iSetupDone; - __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EEndFullScreen: %d", layoutEffectable); + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EEndFullScreen: iSetupDone: %d", layoutEffectable); } else { // add visuals to visual cleanupstack aToLayout->SetStoredRenderBufferModificationsEnabled(EFalse); + TInt index; + if (aToLayout->StoredRenderBuffer() && HasActiveEffect(aToLayout, index) && index != KErrNotFound) + { + // a screenshot has been saved into the layout, and the layout was added to cleanupstack + // for cleaning. SetupEffectLayoutContainerL will add the same layout + // to the cleanupstack, but double cleaning is not a good idea. Thus it is removed here. + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Removing the layout 0x%x with screenshot from iEffectCleanupStack", aToLayout); + iEffectCleanupStack.Remove(index); + } layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, EFalse, aEvent.iCanDestroyOrHideImmediately); aEvent.iSetupDone = layoutEffectable; aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); } if (layoutEffectable) - { - TInt effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; - if (NeedsStoredBuffers(iHuiEnv->EffectsEngine(), *aEvent.iEffectName)) + { + TInt effectFlags = 0; + TInt activeEffectGroup = engine->ActiveGroupEffect(); + if (activeEffectGroup != KErrNotFound) + { + engine->AddEffectToGroup(activeEffectGroup); + } + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - Active effect group: %d", activeEffectGroup); + effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; + if (FxmlHasOpaqueHint(iHuiEnv->EffectsEngine(), *aEvent.iEffectName)) { // Performance improvement, but this would be better to be a special hint param in the fxml effectFlags |= KHuiFxOpaqueHint; @@ -4359,11 +4595,11 @@ if (aEvent.iRect != TRect()) { - TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), &aEvent.iRect, this, aEvent.iHandle, effectFlags )); + TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), activeEffectGroup, &aEvent.iRect, this, aEvent.iHandle, effectFlags )); } else { - TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle, effectFlags ) ); + TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), activeEffectGroup, NULL, this, aEvent.iHandle, effectFlags ) ); } effect = NULL; // only use the effect if the effect file was correctly parsed @@ -4419,6 +4655,8 @@ { __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEvent - END: none"); RemoveAllTemporaryPresenterVisuals(); + delete iControlEffectData; + iControlEffectData = NULL; return; } @@ -4426,7 +4664,7 @@ iFullScreenEffectData = NULL; CleanupStack::PushL( fxData ); - __ALFFXLOGSTRING2(" - handle: %d, toAppUid: 0x%x", fxData->iHandle, fxData->iToAppId); + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxStopEvent - handle: %d, toAppUid: 0x%x", fxData->iHandle, fxData->iToAppId); // clean effects with this handle RemoveTemporaryPresenterVisual(NULL, fxData->iHandle); @@ -4440,6 +4678,9 @@ // abort ALL other possible control effects RemoveAllTemporaryPresenterVisuals(); + delete iControlEffectData; + iControlEffectData = NULL; + iHuiEnv->ContinueRefresh(); if ( !aClientRequest ) @@ -4507,6 +4748,14 @@ // operation tells if this is begin full screen or end full screen TInt operation = stream.ReadInt32L(); + // If we are in low memory state, we don't want to do any effects + if(iHuiEnv->MemoryLevel() < EHuiMemoryLevelReduced) + { + __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - Returning because memory level below NORMAL"); + stream.Release(); + return; + } + if ( operation == MAlfGfxEffectPlugin::EBeginFullscreen ) { if ( !iFullScreenEffectData || !iFullScreenEffectData->iSetupDone ) @@ -4542,7 +4791,13 @@ RemoveEffectFromApp(iFullScreenEffectData->iFromSecureId, iFullScreenEffectData->iFromWg); // 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; iFullScreenEffectData = fxData; iFullScreenEffectData->iAppStartScreenshotItemHandle = fxData->iHandle; @@ -4595,43 +4850,11 @@ __ALFFXLOGSTRING3("CAlfBridge::HandleGfxEffectsL - Operation: %d, handle: %d, type: %d", operation, fxData->iHandle, fxData->iType); __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEffectsL - towg: %d, fromwg: %d", fxData->iToWg, fxData->iFromWg); - // find root nodes and attach effects to them - // First we need a windowgroup node id. So far we have a list of window ids - - // wg2 is the window group that is supposed to disappear from view - // when a new application starts. We don't have any use for it now... - - // This is the group that is disappearing - // Currently we don't add an effect to it. - - // TODO: when ids available from wserv... - // if ( appUid2 ) - //{ - // group2 = FindControlGrouAppUId( appUid2, screen2, &alfGroup ); - // } - //if ( toAppId2 ) - // { - // group2 = FindControlGroupByAppId(toAppId2); - // } - //if ( wg2 && wg2 != KErrNotFound ) - // { - // group2 = FindControlGroupByWindowGroupId( wg2, screen2 ); - // } - // if ( group2 ) - // { - // CHuiControl& control = group2->Control(0); - // layout2 = (CHuiLayout*)&control.Visual(0); - // } - - // This effect is triggered either by BeginFullScreen or by EndFullScreen - // depending on if we have an application that is already running or not - - // TAlfControlGroupEntry* alfGroup = NULL; - + CHuiControlGroup* toGroup = NULL; + TBool failed = EFalse; if (fxData->iToAppId && fxData->iToAppId != KErrNotFound) { - CHuiControlGroup* toGroup = NULL; CHuiLayout* toLayout = NULL; toGroup = FindControlGroupByFullScreenToEffect(); @@ -4670,6 +4893,18 @@ // Effect failed, reset state HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData } + else + { + // it might be that the application is already having drawing for the whole screen. + // If so, then trigger EndFullScreen immediately. + if (fxData && + toGroup + && fxData->iOperation == MAlfGfxEffectPlugin::EBeginFullscreen + && fxData->iEffectType == CFullScreenEffectState::EStartEffect) + { + GfxTriggerEffectWhenFullScreenDrawn(toGroup); + } + } for (TInt i = 0; i < iAlfScreens.Count(); i++) { @@ -4681,6 +4916,37 @@ __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END"); } +TBool CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn(CHuiControlGroup* aToGroup) + { + if (!aToGroup || (aToGroup && aToGroup->Count() == 0)) + { + return EFalse; + } + iTempRegion.Clear(); + + CAlfScreen* screen = iAlfScreens[0]; + TRect fullscreen = TRect(TPoint(0,0), screen->Size()); + TBool fullscreenCovered(EFalse); + TInt dummy = 0; + + CHuiControl& control = aToGroup->Control(0); + CHuiLayout* toLayout = control.VisualCount() > 0 ? (CHuiLayout*)&control.Visual(0) : NULL; + if (!toLayout) + { + return EFalse; + } + TBool opaque = ETrue; // in app start case the layout is propably not opaque. Fake it. + IsFullScreenDrawnRecursive(toLayout, *aToGroup, control, fullscreenCovered, fullscreen, screen, dummy, opaque, iAlfScreens[0]->iDisplay->Orientation()); + fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion); + __ALFFXLOGSTRING1("CAlfBridge::GfxTriggerEffectWhenFullScreenDrawn - Covered: %d", fullscreenCovered); + if (fullscreenCovered) + { + GfxTriggerEndFullScreen(iFullScreenEffectData); + return ETrue; + } + return EFalse; + } + // TODO: add effect type to effect struct. remove all fullscreen effects. currently some might hang around void CAlfBridge::HandleGfxStopEffectsL(TAlfBridgerData data) { @@ -4728,6 +4994,9 @@ TInt handle = stream.ReadInt32L(); stream.Release(); + delete iControlEffectData; + iControlEffectData = NULL; + if (handle != KErrNotFound) { __ALFFXLOGSTRING1("CAlfBridge::HandleGfxStopControlEffectsL - Remove effect with handle: %d", handle); @@ -4886,7 +5155,13 @@ CHuiLayout& layout = static_cast (aSourceLayout->Visual(i)); AddToEffectLayoutContainerL(aEffectHandle, &layout, NULL, aEffectControl, aItemsDestroyed, EFalse,aIsExitEffect, aCanDestroyOrHideImmediately ); } + TInt oldItemsDestroyed = aItemsDestroyed; AddEffectItemL(aEffectHandle, &sourceVisual, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsExitEffect, aCanDestroyOrHideImmediately); + if (oldItemsDestroyed != aItemsDestroyed) + { + // Visual was destroyed. If so, then we must adjust index. + --i; + } } __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x end of children", aSourceLayout, aSourceLayout->Count()); } @@ -4947,6 +5222,15 @@ delete iControlEffectData; iControlEffectData = NULL; } + + // If we are in low memory state, we don't want to do any effects + if(iHuiEnv->MemoryLevel() < EHuiMemoryLevelReduced) + { + __ALFFXLOGSTRING("CAlfBridge::HandleGfxControlEffectsL - Returning because memory level below NORMAL"); + stream.Release(); + return; + } + CControlEffectState* fxData = new (ELeave) CControlEffectState; CleanupStack::PushL(fxData); fxData->ConstructL(action, stream); @@ -4969,7 +5253,7 @@ } else { - __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle 0x%x, iClientGroupHandle 0x%x", + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle %d, iClientGroupHandle %d", iControlEffectData->iClientHandle, iControlEffectData->iClientGroupHandle); return; @@ -5009,7 +5293,6 @@ RemoveTemporaryPresenterVisual(aCanvasVisual); } TBool layoutEffectable(EFalse); - aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity); if (aEvent.iAction == KGfxControlDisappearAction) { // TODO: revise // The control stays visible because the inactive flag is not set @@ -5030,7 +5313,21 @@ } if (layoutEffectable) { - TRAP( err, engine->LoadGroupEffectL(*aEvent.iEffectName, effect, aCanvasVisual->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle, KHuiFxDelayRunUntilFirstFrameHasBeenDrawn ) ); + TInt effectFlags = 0; + + // effect will start delayed anyway when it is syncronized. this flag would break syncronization between effects. + effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; + if (FxmlHasOpaqueHint(iHuiEnv->EffectsEngine(), *aEvent.iEffectName)) + { + effectFlags |= KHuiFxOpaqueHint; + } + + TInt activeEffectGroup = engine->ActiveGroupEffect(); + if (activeEffectGroup != KErrNotFound) + { + engine->AddEffectToGroup(activeEffectGroup); + } + TRAP( err, engine->LoadGroupEffectL(*aEvent.iEffectName, effect, aCanvasVisual->Effectable(), activeEffectGroup, NULL, this, aEvent.iHandle, effectFlags ) ); } else { @@ -5348,12 +5645,12 @@ // iFinishedCleanupStackEffects.Append(aHandle); if (!iEffectEndTimer->IsActive()) { - iEffectEndTimer->AddFinishedHandleL(aHandle); + TRAP_IGNORE(iEffectEndTimer->AddFinishedHandleL(aHandle)); iEffectEndTimer->Start(KEffectCleanupDelayInMs * 1000); } else { - iEffectEndTimer->AddFinishedHandleL(aHandle); + TRAP_IGNORE(iEffectEndTimer->AddFinishedHandleL(aHandle)); } // We should do visual visibility scan after effect is ended @@ -5583,8 +5880,8 @@ void CAlfBridge::PostQTCommandBufferL( TAlfQtCommandBufferParams params ) { CHuiCanvasVisual* huiVisual = NULL; - if ((*iHost)) - { +/* if ((*iHost)) + { if( (*iHost)->StreamerServer() ) { if ((*iHost)->StreamerServer()->WindowMgr()) @@ -5606,7 +5903,7 @@ } } } - +*/ if ( huiVisual ) { TPtrC8 commands( (TUint8 *)params.iPtr, params.iLength ); @@ -5640,10 +5937,10 @@ // visual // --------------------------------------------------------------------------- // -void CAlfBridge::SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, - CHuiVisual* aExternalContentVisual) +void CAlfBridge::SetClientWindowForDrawingL(TInt /*aWindowGroupId*/, TInt /*aClientWindowHandle*/, + CHuiVisual* /*aExternalContentVisual*/) { - RArray winInfoList; + /* RArray winInfoList; CleanupClosePushL(winInfoList); // Find canvas visual for the RWindow @@ -5696,7 +5993,7 @@ } CleanupStack::PopAndDestroy(); // winInfoList - } +*/ } void CAlfBridge::SetVisualTreeVisibilityChanged(TBool aChanged) { @@ -5728,11 +6025,17 @@ iAlfScreens[i]->iDisplay->SetForegroundBitmapL( iAlfScreens[i]->iSwRenderingTarget ); CleanupStack::Pop(texture); iAlfScreens[i]->iDisplay->SetForegroundTexture(texture); +#ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK + iHuiEnv->SetRefreshMode(EHuiRefreshModeManual); +#endif // #ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK } else { iAlfScreens[i]->iDisplay->SetForegroundBitmapL(NULL); iAlfScreens[i]->iDisplay->SetForegroundTexture(NULL); +#ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK + iHuiEnv->SetRefreshMode(EHuiRefreshModeAutomatic); +#endif // #ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK } // SetCapturingBufferL is called from HandleVisualVisibility. @@ -5771,6 +6074,11 @@ // For tests //TUint32* data = aScreen->iSwRenderingTarget->DataAddress(); } + + if (modified && aScreen->iSwRenderingTarget) + { + InitializeSwRenderingTarget(aScreen->iSwRenderingTarget); + } } else { @@ -5785,6 +6093,18 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // +void CAlfBridge::InitializeSwRenderingTarget(CFbsBitmap* aBitmap) + { + __ALFLOGSTRING("CAlfBridge::InitializeSwRenderingTarget"); + TAlfBridgeDrawerWrapper wrapper(*this); + AlfDrawerInternal::CopyScreenToBitmap(&wrapper, aBitmap, + TRect(aBitmap->SizeInPixels())); + __ALFLOGSTRING("CAlfBridge::InitializeSwRenderingTarget ok"); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// void CAlfBridge::SetMemoryLevel(THuiMemoryLevel aMemoryLevel) { iCurrentMemoryLevel = aMemoryLevel; @@ -5818,9 +6138,9 @@ void CAlfBridge::DoUpdateMemoryLevel() { THuiMemoryLevel memoryLevel = iCurrentMemoryLevel; - if ( iLowMemoryMode && ( memoryLevel > EHuiMemoryLevelLow ) ) - { - memoryLevel = EHuiMemoryLevelLow; + if ( iLowMemoryMode && ( memoryLevel > EHuiMemoryLevelReduced ) ) + { + memoryLevel = EHuiMemoryLevelReduced; } if ( iForcedSwRendering && ( memoryLevel > EHuiMemoryLevelLowest ) ) { @@ -5831,9 +6151,10 @@ if ( memoryLevel != iHuiEnv->MemoryLevel() ) { + __ALFLOGSTRING1("CAlfBridge::DoUpdateMemoryLevel -> %d", memoryLevel); - TBool nowGoodMemory = !(memoryLevel < EHuiMemoryLevelNormal); - TBool wasGoodMemory = !(iHuiEnv->MemoryLevel() < EHuiMemoryLevelNormal); + TBool nowGoodMemory = !(memoryLevel < EHuiMemoryLevelReduced); + TBool wasGoodMemory = !(iHuiEnv->MemoryLevel() < EHuiMemoryLevelReduced); if (iActivated) { @@ -5851,7 +6172,7 @@ } } - if ( memoryLevel <= EHuiMemoryLevelLowest) + if ( memoryLevel < EHuiMemoryLevelReduced) { OnLowMemoryModifyAllEffects(); } @@ -5966,7 +6287,39 @@ if ( lBreak ) break; } - + TBool alreadyExists = EFalse; + for( TInt i = 0 ; i < iAlfNativeClientsWgIds.Count() ; i++ ) + { + if(iAlfNativeClientsWgIds[i] == aId) + { + alreadyExists = ETrue; + } + } + if(!alreadyExists) + { + iAlfNativeClientsWgIds.Append(aId); + } + } + +void CAlfBridge::RemoveWindowGroupAsAlfApp( TInt aId ) + { + for ( TInt j = 0; j < iAlfScreens.Count(); j++ ) + { + for ( TInt i = 0; i < iAlfScreens[j]->iControlGroups.Count(); i++ ) + { + if ( iAlfScreens[j]->iControlGroups[i].iClientWindowGroupId == aId ) + { + iAlfScreens[j]->iControlGroups[i].iControlGroup->iAlfApp = EFalse; + } + } + } + for( TInt i = 0 ; i < iAlfNativeClientsWgIds.Count() ; i++ ) + { + if(iAlfNativeClientsWgIds[i] == aId) + { + iAlfNativeClientsWgIds.Remove(i); + } + } } // --------------------------------------------------------------------------- @@ -5990,11 +6343,7 @@ __ALFFXLOGSTRING3("CAlfBridge::IsFullScreenDrawn - new orientation %d, screen size: (%d,%d)", aOrientation, fullscreen.iBr.iX, fullscreen.iBr.iY ); TBool fullscreenCovered = EFalse; CAlfAppSrvSessionBase* topMostAlfSrvSession = NULL; - - //iActiveVisualCount = 0; - iBgSurfaceFound = EFalse; - //iPaintedArea = 0; - + // Check if effect group has an effect with opaque hint. CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[0]->iFullscreenEffectControlGroup); CHuiControl& fxcontrol = fxcontrolgroup.Control(0); @@ -6011,21 +6360,16 @@ } TBool alfWindowGroupFoundVisible = EFalse; + + AMT_SET_VALUE( iVisibleVisualCount, 0 ); // skip the topmost (effect) layer, start from floating sprite group for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) { CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j); CHuiControl& control = controlgroup.Control(0); - - for (TInt ii=0; iiiControlGroups.Count();ii++) - { - if( iAlfScreens[0]->iControlGroups[ii].iControlGroup == &controlgroup ) - { - __ALFFXLOGSTRING1("CAlfBridge::IsFullScreenDrawn : Group owner 0x%x", iAlfScreens[0]->iControlGroups[ii].iSecureId); - break; - } - } + __ALFFXLOGSTRING1("CAlfBridge::IsFullScreenDrawn : Group owner 0x%x", controlgroup.SecureId()); + if (control.Role() == EAlfFpsIndicatorContainer) { @@ -6043,7 +6387,6 @@ 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 ); - return ETrue; } } @@ -6205,6 +6548,9 @@ } } visualTreeActive |= visualIsActive; + + // iVisibleVisualCount is cleared in HandleVisualVisibility() + AMT_INC_COUNTER_IF( visualIsActive && !visualRectIsCovered , iVisibleVisualCount ); } // for loop end : children checking loop return visualTreeActive; } @@ -6217,6 +6563,7 @@ { return; } + iLayoutSwitchInProgress = ETrue; CAlfScreen* screen = iAlfScreens[0]; // skip the topmost (effect) layer, start from floating sprite group for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) @@ -6252,8 +6599,9 @@ if (!canvasVisual->LayerExtent().IsEmpty()) { - canvasVisual->ClearCanvasFlags(EHuiCanvasFlagSurfaceVisible); - canvasVisual->SetCanvasFlags(EHuiCanvasFlagSurfaceInvisible); + // Force update + canvasVisual->ClearCanvasFlags( EHuiCanvasFlagSurfaceInvisible ); + canvasVisual->ClearCanvasFlags( EHuiCanvasFlagSurfaceVisible ); } } } @@ -6268,6 +6616,7 @@ } */ // request syncronized frame + iLayoutSwitchInProgress = EFalse; if ( iHuiEnv ) { iIdForLayoutSwitchFrameSync = iIdForEAlfDSSynchronizeOp - KPreventingCollisionOfIdsInSynchDrawRequests; @@ -6275,5 +6624,29 @@ } } +TAlfBridgeDrawerWrapper::TAlfBridgeDrawerWrapper(CAlfBridge& aBridge) + : iBridge( aBridge ) + { + } + +TInt TAlfBridgeDrawerWrapper::GetSizeAndRotation(TSize& aSize, TInt& aRotation) + { + return iBridge.GetSizeAndRotation(aSize, aRotation); + } + +TInt TAlfBridgeDrawerWrapper::ReadPixels(CFbsBitmap* aBitmap) + { + return iBridge.ReadPixels(aBitmap); + } + +RAlfBridgerClient* CAlfBridge::BridgerClient() + { + if (iActivated) + { + return &iBridgerClient; + } + return 0; + } + // end of file diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp Mon May 03 13:22:43 2010 +0300 @@ -21,8 +21,6 @@ #include const TInt KRosterFreezeEndTimeoutInMs = 100; -const TInt KFirstTimeoutForApplicationEndFullScreenInMs = 20; -const TReal KMinimumPaintedAreaBeforeForcedEffect = 0.75; // --------------------------------------------------------- // CAlfRosterFreezeEndTimer @@ -60,6 +58,7 @@ __ALFLOGSTRING("CAlfRosterFreezeEndTimer::Start"); if (!IsActive()) { + iSafeCounter = 0; After( aPeriod ); } } @@ -657,7 +656,7 @@ // TBool CAlfLayoutSwitchEffectCoordinator::IsThemeEffectEnabled() const { - TBool memoryOk = !( iBridge.iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLowest ); + TBool memoryOk = !( iBridge.iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLow ); TBool tfxOn = CAknTransitionUtils::TransitionsEnabled(AknTransEffect::ELayoutswitchTransitionsOff ); TBool tfxExists = LayoutSwitchEffectsExist(); @@ -847,46 +846,6 @@ iCompletionHandle = iHandle; } -TInt doNotifyDrawingTimeout( TAny* aPtr ) - { - ((CFullScreenEffectState*)aPtr)->NotifyDrawingTimeout(); - return 0; // must return something - } - -TBool CFullScreenEffectState::InitDelayedEffectL(CAlfBridge* aBridge, TSize aDisplaySize) - { - iBridge = aBridge; - iDisplaySize = aDisplaySize; - if (!iDrawingCompleteTimer) - { - iDrawingCompleteTimer = CPeriodic::NewL( EPriorityNormal ); - iDrawingCompleteTimer->Start( - KFirstTimeoutForApplicationEndFullScreenInMs * 1000 , - KFirstTimeoutForApplicationEndFullScreenInMs * 1000 , TCallBack( doNotifyDrawingTimeout, this )); - return ETrue; - } - return EFalse; - } - -void CFullScreenEffectState::NotifyDrawingTimeout() - { - - iPaintedRegion.ClipRect(TRect(0,0, iDisplaySize.iWidth, iDisplaySize.iHeight)); - iPaintedRegion.Tidy(); // remove overlapping regions - TInt size(0); - for(TInt i=0; i< iPaintedRegion.Count();i++ ) - { - size += iPaintedRegion[i].Width()*iPaintedRegion[i].Height(); - } - // lets continue, if the covered area is more than 75% of the screen. This is usually enough. - if ( size > KMinimumPaintedAreaBeforeForcedEffect * (iDisplaySize.iWidth * iDisplaySize.iHeight)) - { - iBridge->HandleGfxEndFullScreenTimeout(this); - delete iDrawingCompleteTimer; - iDrawingCompleteTimer = NULL; - } - } - void CControlEffectState::ConstructL(TInt aAction, RMemReadStream& aStream) { diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Mon May 03 13:22:43 2010 +0300 @@ -734,6 +734,14 @@ case MWsWindowTreeNode::EWinTreeNodeClient: { node = CAlfNodeWindow::NewL( this, iStream, iScreenNumber ); + + #ifdef __WINS__ + if (++iDebug_CheckNodeTableItegrityCounter > 100) // Do not check too often as is can be slow + { + Debug_CheckNodeTableItegrity(_L("CAlfHierarchyModel::DoNodeCreatedL")); + } + #endif + break; } case MWsWindowTreeNode::EWinTreeNodeRoot: @@ -797,7 +805,12 @@ AMT_INC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeCount ); AMT_INC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeGroup), iWindowGroupNodeCount ); - AMT_INC_COUNTER_IF(node, iTotalNodeCount ); + AMT_INC_COUNTER_IF(node, iTotalNodeCount ); + + AMT_MAP_INC_VALUE_IF( node && nodeType == MWsWindowTreeNode::EWinTreeNodeClient, + iIntMap, node->iId, EAlfModuleTestTypeHierarchyModelCreateWindow ); + AMT_MAP_INC_VALUE_IF( node && nodeType == MWsWindowTreeNode::EWinTreeNodeGroup, + iIntMap, node->iId, EAlfModuleTestTypeHierarchyModelCreateWindowGroup ); } // --------------------------------------------------------------------------- @@ -830,7 +843,12 @@ AMT_DEC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeCount ); AMT_DEC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeGroup), iWindowGroupNodeCount ); - AMT_DEC_COUNTER_IF(node, iTotalNodeCount ); + AMT_DEC_COUNTER_IF(node, iTotalNodeCount ); + + AMT_MAP_INC_VALUE_IF( node && nodeType == MWsWindowTreeNode::EWinTreeNodeClient, + iIntMap, nodeId, EAlfModuleTestTypeHierarchyModelReleaseWindow ); + AMT_MAP_INC_VALUE_IF( node && nodeType == MWsWindowTreeNode::EWinTreeNodeGroup, + iIntMap, nodeId, EAlfModuleTestTypeHierarchyModelReleaseWindowGroup ); } // --------------------------------------------------------------------------- @@ -851,7 +869,11 @@ USER_INVARIANT(); } - AMT_INC_COUNTER_IF( node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeActivatedCount ); + AMT_INC_COUNTER_IF( node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeActivatedCount ); + + AMT_MAP_SET_VALUE_IF( node && nodeType == MWsWindowTreeNode::EWinTreeNodeClient, + iBoolMap, nodeId, ETrue, + EAlfModuleTestTypeHierarchyModelActiveWindow ); } // --------------------------------------------------------------------------- @@ -884,12 +906,12 @@ AMT_INC_COUNTER_IF(node, iNodeExtentChangedCount ); AMT_SET_VALUE_IF(node, iLatestNodeExtentRect, rect ); - AMT_MAP_SET_VALUE_IF( ( node && node->iWindow ), + AMT_MAP_SET_VALUE_IF( node && node->iWindow, iSizeMap, node->iWindow->WsInfo().iClientSideId.iWindowIdentifer, - rect.Size(), EAlfModuleTestTypeHierarchyModelChangeSize ); - AMT_MAP_SET_VALUE_IF( ( node && node->iWindow ), + rect.Size(), EAlfModuleTestTypeHierarchyModelChangeWindowSize ); + AMT_MAP_SET_VALUE_IF( node && node->iWindow, iPositionMap, node->iWindow->WsInfo().iClientSideId.iWindowIdentifer, - rect.iTl, EAlfModuleTestTypeHierarchyModelChangePosition ); + rect.iTl, EAlfModuleTestTypeHierarchyModelChangeWindowPosition ); } // --------------------------------------------------------------------------- @@ -951,9 +973,11 @@ } AMT_INC_COUNTER_IF(node, iTotalNodeFlagChangedCount ); - AMT_MAP_INC_VALUE_IF( ( node && node->iWindow ), - iIntMap, node->iWindow->WsInfo().iClientSideId.iWindowIdentifer, - EAlfModuleTestTypeHierarchyModelChangeFlag ); + AMT_MAP_SET_VALUE_IF( node && node->iWindow && MWsWindowTreeObserver::EVisible == flag, + iBoolMap, + node->iWindow->WsInfo().iClientSideId.iWindowIdentifer, + newValue, + EAlfModuleTestTypeHierarchyModelChangeWindowVisibility ); } // --------------------------------------------------------------------------- @@ -1152,7 +1176,7 @@ USER_INVARIANT(); // attribute change for unexpected node type. new code needed! } - AMT_INC_COUNTER_IF(node, iTotalNodeAttributeChangedCount ); + AMT_INC_COUNTER_IF(node, iTotalNodeAttributeChangedCount ); } // --------------------------------------------------------------------------- @@ -1271,5 +1295,35 @@ } } } + + +#ifdef __WINS__ +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAlfHierarchyModel::Debug_CheckNodeTableItegrity(const TDesC16& aContext) + { + iDebug_CheckNodeTableItegrityCounter = 0; + // Loop through the all items + TInt count = 0; + THashMapIter ptrHashSetIter(iNodeHashArray); + for ( ; ; ) + { + const CNodeHashStruct* resNext = ptrHashSetIter.NextValue(); + if (!resNext) + { + break; + } + count++; + if (resNext->iNode->Type() == MWsWindowTreeNode::EWinTreeNodeClient) + { + resNext->iNode->Debug_CheckSiblingOrder(aContext); + } + } + } +#endif + + diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp Mon May 03 13:22:43 2010 +0300 @@ -1082,9 +1082,18 @@ // ^^^ // if iterNode gets to NULL, then we must have found both matches // - i.e. either the new or current/old position is the rightmost node - ASSERT(oldPrevNode!=NULL && newPrevNode!=NULL); + if (oldPrevNode == NULL || newPrevNode == NULL ) + { + // Fatal error! Node tree is corrupted. + __ALFLOGSTRING4("CAlfNode::SiblingOrderChanged(). Fatal error! Node tree is corrupted. oldPrevNode=0x%x, newPrevNode=0x%x, iterNodePosition=%d, aNewPos=%d", + oldPrevNode, newPrevNode, iterNodePosition, aNewPos); + __ALFLOGSTRING4("CAlfNode::SiblingOrderChanged(). This node=0x%x, type = %d, parent node=0x%x, parent type=%d", this, Type(), iParent, iParent->Type()); + __ALFLOGSTRING2("CAlfNode::SiblingOrderChanged(). This node id=0x%x, parent node id=0x%x", iId, iParent->iId); + __ASSERT_ALWAYS(EFalse, USER_INVARIANT()); + //__ASSERT_DEBUG(EFalse, USER_INVARIANT()); + return; + } } - ASSERT(iterPrevNode!=NULL); } // end while loop @@ -1720,6 +1729,8 @@ ResolveParent( iNodeWindowConstructionStruct.iParentId, iId ); CreateWindowL( iNodeWindowConstructionStruct.iWindowGroupHandle, iNodeWindowConstructionStruct.iWindowHandle, iNodeWindowConstructionStruct.iParentId ); UpdateOrdinalPosition(); + + AMT_MAP_STREAMER_NODE_WINDOW_CONSTRUCT(); } // --------------------------------------------------------------------------- @@ -1900,6 +1911,8 @@ iGroupId, iId, (TAny*)offset ); + + AMT_MAP_STREAMER_NODE_GROUP_CONSTRUCT(); } // --------------------------------------------------------------------------- @@ -2133,6 +2146,8 @@ (TAny*)offset ); UpdateOrdinalPosition(); + + AMT_MAP_STREAMER_TEXT_CURSOR_CONSTRUCT(); } // --------------------------------------------------------------------------- @@ -2151,6 +2166,8 @@ void CAlfNodeTextCursor::AttributeChangedL( RMemReadStream* aStream ) { + AMT_MAP_BRIDGE_ADD_TEXT_CURSOR(); + // TODO: PASS FORWARD!!! TInt attribute = aStream->ReadInt32L(); switch ( attribute ) @@ -2189,6 +2206,8 @@ iGroupId, iId, (TAny*)offset ); + + AMT_MAP_STREAMER_TEXT_CURSOR_CHANGE(); } CAlfNodeTextCursor::~CAlfNodeTextCursor( ) { @@ -2204,5 +2223,50 @@ } } +#ifdef __WINS__ +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CAlfNode::Debug_CheckSiblingOrder(const TDesC16& aContext) + { + if (!iParent || Type() != MWsWindowTreeNode::EWinTreeNodeClient) + { + return; + } + + TBool foundMyself = EFalse; + TInt iterNodePosition = 0; + + // Search for myselk in iParent sibling list + for(CAlfNode* iterNode = iParent->iChild; iterNode != NULL; iterNode = iterNode->iSibling, iterNodePosition++) + { + if (iterNode == this) + { + foundMyself = ETrue; + } + } + + if(!foundMyself) + { + // Did not find myself from the parent sibling list ==> error! + __ALFLOGSTRING2("CAlfNode::Test_CheckSiblingOrder(). Fatal error! Node tree is corrupted. at %S: iId=0x%x", &aContext, iId ); + __ALFLOGSTRING3("CAlfNode::Test_CheckSiblingOrder(). iterNodePosition=%d, iChild=0x%x, iSibling=0x%x", iterNodePosition, iChild, iSibling ); + __ALFLOGSTRING3("CAlfNode::Test_CheckSiblingOrder(). iSpriteChild=0x%x, iAnimChild=0x%x, iTextCursor=0x%x", iSpriteChild, iAnimChild, iTextCursor ); + __ALFLOGSTRING4("CAlfNode::Test_CheckSiblingOrder(). This node=0x%x, type = %d, parent node=0x%x, parent type=%d", this, Type(), iParent, iParent->Type()); + // Print sibling list + iterNodePosition=0; + __ALFLOGSTRING("CAlfNode::Test_CheckSiblingOrder(). SIBLINGS:"); + for(CAlfNode* iterNode2 = iParent->iChild; iterNode2!=NULL; iterNode2 = iterNode2->iSibling, iterNodePosition++) + { + __ALFLOGSTRING4("CAlfNode::Test_CheckSiblingOrder(). *** iterNodePosition=%d, id=%d, this=0x%x, iChild=0x%x", iterNodePosition, iterNode2->iId, iterNode2, iterNode2->iChild ); + __ALFLOGSTRING3("CAlfNode::Test_CheckSiblingOrder(). iSpriteChild=0x%x, iAnimChild=0x%x, iTextCursor=0x%x", iterNode2->iSpriteChild, iterNode2->iAnimChild, iterNode2->iTextCursor ); + } + + __ASSERT_ALWAYS(EFalse, USER_INVARIANT()); + } + } +#endif + // end of file diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp Mon May 03 13:22:43 2010 +0300 @@ -234,7 +234,16 @@ #endif } - + // if this is a last displaysubsession remove "alfnative client wg" tag from bridge + RPointerArray displays; + CleanupClosePushL( displays ); + Session().GetSubsessionsByTypeL( displays, EHuiObjectTypeDisplay ); + + if( displays.Count() == 0 ) + { + Session().AlfAppUi()->RemoveAlfAppWindowGroup(Session().ClientWindowGroup()); + } + CleanupStack::PopAndDestroy( &displays ); // displays.Close() } // --------------------------------------------------------------------------- diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp Mon May 03 13:22:43 2010 +0300 @@ -21,6 +21,7 @@ #include #include "alfstreamerbridge.h" #include "alfstreamerserver.h" +#include "alfbridge.h" #include "alflogger.h" #ifdef ALF_DEBUG_TRACK_DRAWING @@ -28,7 +29,8 @@ #endif -// #define EGL_TALKS_TO_WINDOW_SERVER +// From MMP macro nowadays +//#define ALF_DRAW_FRAME_BEFORE_END_CALLBACK // --------------------------------------------------------------------------- // constructor @@ -83,7 +85,6 @@ #ifdef ALF_DEBUG_TRACK_DRAWING iCommandDebugger = CAlfCommandDebug::NewL(); #endif - CHuiEnv::Static()->iSwapObserver = this; } // --------------------------------------------------------------------------- @@ -93,7 +94,6 @@ // CAlfStreamerBridge::~CAlfStreamerBridge() { - CHuiEnv::Static()->iSwapObserver = 0; iDataBuf.Close(); iQueueSema.Close(); #ifdef ALF_DEBUG_TRACK_DRAWING @@ -173,21 +173,14 @@ // TInt CAlfStreamerBridge::AddData( TAlfDecoderServerBindings aOp,TInt aI1,TInt aI2 ,TAny* aPtr ) { - if (iSwapActive && aOp == EAlfRequestCommitBatch) - { - __ALFLOGSTRING("CAlfStreamerBridge::AddData() just release window server"); - iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER,KRELEASEDBEFOREQUEUE); - return KErrNone; - } - TInt err = KErrNotFound; { #ifdef ALF_DEBUG_TRACK_DRAWING iCommandDebugger->SetDescription( aOp, R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY ); __ALFLOGSTRING2("CAlfStreamerBridge::AddData op %S, iQueue.Length = %d", &iCommandDebugger->Text(), iQueue.Count()); - #else +#else __ALFLOGSTRING2("CAlfStreamerBridge::AddData op %d, iQueue.Length = %d", aOp, iQueue.Count()); - #endif +#endif err = KErrNone; for(TInt i = 0; i < iMessages.Count(); i++ ) { @@ -229,56 +222,6 @@ return data; } -void CAlfStreamerBridge::PrepareSwap() - { -#ifdef EGL_TALKS_TO_WINDOW_SERVER - __ALFLOGSTRING("CAlfStreamerBridge:: Prepare swap, flush the queue"); - iSwapActive = ETrue; - if (iStatus.Int() >=0 && iMessages.Count() > iStatus.Int() ) - { - Cancel(); // remove from scheduler - RunL(); // run manually (and activate) - } - __ALFLOGSTRING("CAlfStreamerBridge:: Prepare swap, the queue emptied"); -#endif //#ifdef EGL_TALKS_TO_WINDOW_SERVER - } - -void CAlfStreamerBridge::SwapComplete() - { -#ifdef EGL_TALKS_TO_WINDOW_SERVER - __ALFLOGSTRING("CAlfStreamerBridge:: Swap buffers complete"); - iSwapActive = EFalse; -#endif // #ifdef EGL_TALKS_TO_WINDOW_SERVER - - } - -#ifdef EGL_TALKS_TO_WINDOW_SERVER -void CAlfStreamerBridge::ReleaseWindowServer(TBool aRelease) - { - __ALFLOGSTRING1("CAlfStreamerBridge::ReleaseWindowServer: %d",aRelease); - if (aRelease) - { - iMakeCurrentActive = ETrue; - if (iBatchObserver && !iSwapActive) - { - iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER); - } - } - else - { - iMakeCurrentActive = EFalse; - } -#else -void CAlfStreamerBridge::ReleaseWindowServer(TBool) - { -#endif - } - -void CAlfStreamerBridge::SetWgIdArray(TInt* aArray) - { - iWgArray = aArray; - } - EXPORT_C TUid CAlfStreamerBridge::FindAppUidForWgId(TInt /*aWgId*/) { __ASSERT_DEBUG(EFalse, User::Leave(KErrNotSupported)); @@ -308,8 +251,16 @@ #endif switch ( operation ) { - // Just call back to Alf decoder thread case EAlfRequestCommitBatch: +#ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK + { + CAlfBridge* bridge = dynamic_cast(iObserver); + if (bridge) + { + bridge->iHuiEnv->RefreshCallBack((TAny*)bridge->iHuiEnv); + } + } // fall through +#endif case EAlfRequestCommandReadNotification: case EAlfReleaseTemporaryChunk: { @@ -324,6 +275,7 @@ { // Handle command __ALFLOGSTRING("CAlfStreamerBridge:: calling observer callback"); + __ASSERT_ALWAYS(iObserver, User::Invariant()); iObserver->HandleCallback(iStatus.Int()); // For "getters" also call back to Alf decoder thread @@ -353,6 +305,15 @@ switch ( operation2 ) { case EAlfRequestCommitBatch: +#ifdef ALF_DRAW_FRAME_BEFORE_END_CALLBACK + { + CAlfBridge* bridge = dynamic_cast(iObserver); + if (bridge) + { + bridge->iHuiEnv->RefreshCallBack((TAny*)bridge->iHuiEnv); + } + } // fall through +#endif case EAlfRequestCommandReadNotification: case EAlfReleaseTemporaryChunk: { @@ -368,6 +329,7 @@ { // Handle command __ALFLOGSTRING("CAlfStreamerBridge:: calling observer callback"); + __ASSERT_ALWAYS(iObserver, User::Invariant()); iObserver->HandleCallback(iQueue[0]); // For "getters" also call back to Alf decoder thread @@ -416,13 +378,7 @@ { // 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 ); - if ( iSwapActive || iMakeCurrentActive ) - { - __ALFLOGSTRING("CAlfStreamerBridge::StartNewBlock() just release window server"); - iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER,KRELEASEDBEFOREQUEUE); - return; - } + //__ALFLOGSTRING1("CAlfStreamerBridge:: Request command read notification, swap active: %d", iSwapActive ); AddData(EAlfRequestCommitBatch,0,0,0); } @@ -503,21 +459,3 @@ { return GetVarDataL(aIndex); } - -// --------------------------------------------------------------------------- -// SetStreamerServer -// --------------------------------------------------------------------------- -// -void CAlfStreamerBridge::SetStreamerServer( CAlfStreamerServer& aStreamerServer ) - { - iStreamerServer = &aStreamerServer; - } - -// --------------------------------------------------------------------------- -// StreamerServer -// --------------------------------------------------------------------------- -// -CAlfStreamerServer* CAlfStreamerBridge::StreamerServer() - { - return iStreamerServer; - } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Mon May 03 13:22:43 2010 +0300 @@ -149,7 +149,6 @@ iWindowHierarcy = CAlfHierarchyModel::NewL(*this); iWindowMgr = CAlfWindowManager::NewL(iWindowHierarcy); - iBridge->SetStreamerServer( *this ); iThemesListener = CThemeRepositoryListener::NewL(); iThemesListener->IssueRequest(); iRendezvous = new (ELeave) CAsyncCallBack(EPriorityHigh*3); @@ -199,6 +198,16 @@ { WindowMgr()->HandleClientExit(aClient->ThreadId()); } + + for (TInt i = iSignals.Count()-1; i >= 0 ; i--) + { + if (iSignals[i].iSession == aClient) + { + // Don't complete because client is already being deleted + iSignals.Remove(i); + } + } + if (!iSessions) { // CActiveScheduler::Stop(); // TODO: lets not die, if client dies. @@ -692,6 +701,28 @@ __ALFLOGSTRING("CAlfStreamerServer::GetListOfWGsHavingInactiveSurfacesL <<") } +void CAlfStreamerServer::AddSignal(CAlfStreamerServerSession* aSession, const RMessage2& aMessage) + { + TAlfSignal signal = { aSession, aMessage, aMessage.Int0(), aMessage.Int1()}; + if (iSignals.Append(signal)) + { + aMessage.Complete(KErrNoMemory); + } + } + +void CAlfStreamerServer::CompleteSignal(TInt aSignal, TInt aType) + { + for (TInt i = iSignals.Count()-1; i >= 0 ; i--) + { + if (iSignals[i].iHandle == aSignal && (iSignals[i].iFlags & aType)) + { + iSignals[i].iMessage.Complete(iSignals[i].iHandle); + iSignals.Remove(i); + //break; + } + } + } + // --------------------------------------------------------------------------- // constructor // --------------------------------------------------------------------------- @@ -846,7 +877,7 @@ } case EAlfGetNativeWindowHandles: { - TPckgC data(server->Bridge()->iAlfWindowData); + TPckgC data(server->Bridge()->iAlfWindowData); aMessage.WriteL(0, data); break; } @@ -907,7 +938,7 @@ } case EAlfGetListOfWGsHavingInactiveSurfaces: { - server->GetListOfWGsHavingInactiveSurfacesL(aMessage, EFalse); + server->GetListOfWGsHavingInactiveSurfacesL(aMessage, aMessage.Int1()); break; } @@ -930,8 +961,24 @@ } break; } - - + case EAlfGetNumberOfActiveEffects: + { + if (server->Bridge()) // though always there + { + aMessage.Complete(server->Bridge()->iActiveEffectCount); + } + break; + } + case EAlfRequestSignal: + { + server->AddSignal(this, aMessage); + return; + } + case EAlfCompleteSignal: + { + server->CompleteSignal(aMessage.Int0(), aMessage.Int1()); + break; + } default: { aMessage.Complete(KErrNotSupported); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h --- a/uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h Mon May 03 13:22:43 2010 +0300 @@ -111,4 +111,5 @@ RAknsSrvSession iSkinSrv; HBufC* iCurrentPluginDllName; HBufC* iCurrentPluginAssetDir; + TBool iIsUIReady; }; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Mon May 03 13:22:43 2010 +0300 @@ -21,7 +21,7 @@ #include #include "bganimhost.h" - +#include typedef void* (*plugingetinterfacefunc)(int); @@ -31,7 +31,7 @@ static const TUint KMaxGPUMemUsage = 1024*1024*4; -CBgAnimHost::CBgAnimHost() +CBgAnimHost::CBgAnimHost():iIsUIReady(EFalse) { } @@ -516,6 +516,19 @@ { return; } + if (!iIsUIReady) + { + TInt lValOfNoUse; + TInt err = RProperty::Get( KPSUidStartup, + KPSStartupUiPhase, + lValOfNoUse); + if (err == KErrNotFound) + { + iTimer->CallBack(500); + return; + } + } + iIsUIReady = ETrue; TTime start; start.UniversalTime(); iPlugin->produceframe(); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Mon May 03 13:22:43 2010 +0300 @@ -1390,7 +1390,7 @@ ??1CHuiFxEngine@@UAE@XZ @ 1389 NONAME ; CHuiFxEngine::~CHuiFxEngine(void) ?RegisterParameterL@CHuiFxVisualLayer@@IAEXABVTDesC16@@PAM@Z @ 1390 NONAME ; void CHuiFxVisualLayer::RegisterParameterL(class TDesC16 const &, float *) ?NewL@CHuiFxEffect@@SAPAV1@AAVCHuiFxEngine@@@Z @ 1391 NONAME ; class CHuiFxEffect * CHuiFxEffect::NewL(class CHuiFxEngine &) - ?ConstructL@CHuiFxVisualLayer@@IAEXAAVMHuiEffectable@@@Z @ 1392 NONAME ; void CHuiFxVisualLayer::ConstructL(class CHuiVisual &) + ?ConstructL@CHuiFxVisualLayer@@IAEXPAVMHuiEffectable@@@Z @ 1392 NONAME ; void CHuiFxVisualLayer::ConstructL(class MHuiEffectable *) ?Draw@CHuiFxEffect@@QAEHAAVCHuiGc@@ABVTRect@@@Z @ 1393 NONAME ; int CHuiFxEffect::Draw(class CHuiGc &, class TRect const &) ?TargetRect@CHuiFxLayer@@QBEABVTRect@@XZ @ 1394 NONAME ; class TRect const & CHuiFxLayer::TargetRect(void) const ?AdvanceTime@CHuiFxVisualLayer@@UAEXM@Z @ 1395 NONAME ; void CHuiFxVisualLayer::AdvanceTime(float) @@ -1428,7 +1428,7 @@ ?AdvanceTime@CHuiFxLayer@@UAEXM@Z @ 1427 NONAME ; void CHuiFxLayer::AdvanceTime(float) ?SetEffectEndObserver@CHuiFxEffect@@QAEXPAVMAlfGfxEffectObserver@@H@Z @ 1428 NONAME ; void CHuiFxEffect::SetEffectEndObserver(class MAlfGfxEffectObserver *, int) ?BufferType@CHuiFxRenderbuffer@@QBEABW4TRenderBufferType@@XZ @ 1429 NONAME ; enum TRenderBufferType const & CHuiFxRenderbuffer::BufferType(void) const - ?NewL@CHuiFxVisualLayer@@SAPAV1@AAVMHuiEffectable@@@Z @ 1430 NONAME ; class CHuiFxVisualLayer * CHuiFxVisualLayer::NewL(class CHuiVisual &) + ?NewL@CHuiFxVisualLayer@@SAPAV1@PAVMHuiEffectable@@@Z @ 1430 NONAME ; class CHuiFxVisualLayer * CHuiFxVisualLayer::NewL(class MHuiEffectable *) ?RegisterParameterL@CHuiFxVisualLayer@@IAEXABVTDesC16@@PAVTRgb@@@Z @ 1431 NONAME ; void CHuiFxVisualLayer::RegisterParameterL(class TDesC16 const &, class TRgb *) ?SetVisualRect@CHuiFxLayer@@QAEXABVTRect@@@Z @ 1432 NONAME ; void CHuiFxLayer::SetVisualRect(class TRect const &) ?SetVisualRect@CHuiFxFilter@@QAEXABVTRect@@@Z @ 1433 NONAME ; void CHuiFxFilter::SetVisualRect(class TRect const &) @@ -1595,4 +1595,6 @@ ?SecureId@CHuiControlGroup@@QAEHXZ @ 1594 NONAME ; int CHuiControlGroup::SecureId(void) ?SetSecureId@CHuiControlGroup@@QAEXH@Z @ 1595 NONAME ; void CHuiControlGroup::SetSecureId(int) ?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 &) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Mon May 03 13:22:43 2010 +0300 @@ -1785,14 +1785,14 @@ _ZN17CHuiFxFilterLayer11AdvanceTimeEf @ 1784 NONAME _ZN17CHuiFxFilterLayer12PrepareDrawLER12CHuiFxEngine @ 1785 NONAME _ZN17CHuiFxFilterLayer4DrawER12CHuiFxEngineR6CHuiGcR18CHuiFxRenderbufferS5_ @ 1786 NONAME - _ZN17CHuiFxVisualLayer10ConstructLER14MHuiEffectable @ 1787 NONAME + _ZN17CHuiFxVisualLayer10ConstructLEP14MHuiEffectable @ 1787 NONAME _ZN17CHuiFxVisualLayer10VisualAreaER5TRect @ 1788 NONAME _ZN17CHuiFxVisualLayer11AdvanceTimeEf @ 1789 NONAME _ZN17CHuiFxVisualLayer12PrepareDrawLER12CHuiFxEngine @ 1790 NONAME _ZN17CHuiFxVisualLayer18RegisterParameterLERK7TDesC16P4TRgb @ 1791 NONAME _ZN17CHuiFxVisualLayer18RegisterParameterLERK7TDesC16Pf @ 1792 NONAME _ZN17CHuiFxVisualLayer4DrawER12CHuiFxEngineR6CHuiGcR18CHuiFxRenderbufferS5_ @ 1793 NONAME - _ZN17CHuiFxVisualLayer4NewLER14MHuiEffectable @ 1794 NONAME + _ZN17CHuiFxVisualLayer4NewLEP14MHuiEffectable @ 1794 NONAME _ZN17CHuiFxVisualLayer9ParameterERK7TDesC16 @ 1795 NONAME _ZN17CHuiFxVisualLayerD0Ev @ 1796 NONAME _ZN17CHuiFxVisualLayerD1Ev @ 1797 NONAME @@ -1996,4 +1996,6 @@ _ZN16CHuiControlGroup11SetSecureIdEi @ 1995 NONAME _ZN16CHuiControlGroup8SecureIdEv @ 1996 NONAME _ZNK16CHuiCanvasVisual19HasTransParentClearEv @ 1997 NONAME + _ZN12CHuiFxEngine16AddEffectToGroupEi @ 1998 NONAME + _ZN12CHuiFxEngine18FxmlUsesOpaqueHintERK7TDesC16 @ 1999 NONAME diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h Mon May 03 13:22:43 2010 +0300 @@ -94,7 +94,7 @@ // parameter for visual _LIT(KLitSrc, "src" ); // source for the effect - +_LIT(KLitOpaque, "opaque"); _LIT(KLitBlending, "blending" ); _LIT(KLitParam, "param" ); _LIT(KLitReplace, "replace" ); @@ -129,6 +129,8 @@ _LIT(KLitAccelerate, "accelerate"); _LIT(KLitImpulse, "impulse"); */ +_LIT(KLitTrue,"true"); +_LIT(KLitFalse,"false"); _LIT(KLitAt, "at" ); _LIT(KLitMarker, "marker" ); _LIT(KLitLoopStart, "loop_start" ); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Mon May 03 13:22:43 2010 +0300 @@ -40,7 +40,10 @@ /** Effect is not applied to children visuals. */ const TInt KHuiFxEffectExcludeChildrenFlag = 0x4; -/** Effect is grouped and syncronized with other effect(s)*/ +/** Effect is grouped and syncronized with other effect(s) + * + * Indicates that the EndGroup event has not yet been received. + */ const TInt KHuiFxWaitGroupSyncronization = 0x8; /** Effect duration is started after it has first time been drawn. */ @@ -61,6 +64,16 @@ /** Background pixels are not read for every frame (only once in a while), thus background content looks frozen if it is visible. */ const TInt KHuiFxFrozenBackground = 0x200; +/** + * EndGroup request has been received, but this effect has not yet drawn itself. + */ +const TInt KHuiFxWaitGroupToStartSyncronized = 0x400; + +/** EndGroup request has been received and this effect has drawn itself once and it is + * now waiting for the others in the group to be drawn. + */ +const TInt KHuiFxReadyAndWaitingGroupToStartSyncronized = 0x800; + class MAlfGfxEffectObserver { public: @@ -98,6 +111,9 @@ IMPORT_C void SetEngine( CHuiFxEngine *aEngine ); IMPORT_C void SetEffectFlags( TInt aFlags ); + void SetEffectFlag( TInt aFlag ); + void ClearEffectFlag( TInt aFlag ); + IMPORT_C void SetEffectGroup(TInt aGroupId); IMPORT_C TInt EffectFlags(); IMPORT_C TInt GroupId(); @@ -137,6 +153,13 @@ TBool CachedDraw(CHuiGc& aGc, const TRect& aDisplayRect, TBool aRefreshCachedRenderTarget, TBool aOpaque); void FxmlVisualInputs(RArray &aArray); + + TBool FxmlUsesOpaqueHint() const; + + TInt Handle() const + { + return iHandle; + } private: TBool IsAppliedToBackground(); @@ -167,6 +190,8 @@ TInt iGroupId; TInt iFramesDrawn; + TReal32 iElapsedTime; + TBool iNotifiedEffectReady; }; #endif /*HUIFXEFFECT_H_*/ diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h Mon May 03 13:22:43 2010 +0300 @@ -40,6 +40,8 @@ virtual void ParsingEndedBefore()=0; virtual void ParsingEndedAfter(MHuiFxEffectCacheNode *aCached)=0; virtual TBool FxmlUsesInput1()=0; + virtual TBool FxmlUsesOpaqueHint() const=0; + virtual void Delete()=0; }; @@ -53,8 +55,9 @@ IMPORT_C void UnUse(MHuiFxEffectCacheNode *aNode); IMPORT_C ~CHuiFxEffectCache(); void ParsingEnded(TInt aHandle); - MHuiFxEffectCacheNode *FindCached(const TDesC &aId); + MHuiFxEffectCacheNode *FindCached(const TDesC &aId) const; TBool FxmlUsesInput1(const TDesC &aFileName); + TBool FxmlUsesOpaqueHint(const TDesC &aFileName) const; private: struct IDNode { @@ -88,7 +91,7 @@ { public: CHuiFxEffectCacheEffectNode(const TDesC &aFileName, CHuiFxEffect *&aEffect, MHuiEffectable *aVisual, TRect *extRect, CHuiFxEngine *aEngine) - : iFileName(aFileName.AllocL()), iEffect(aEffect), iVisual(aVisual), iExtRect(extRect), iEffectCached(0), iEngine(aEngine), iRefCount(0), iParser(0) { } + : iFileName(aFileName.AllocL()), iEffect(aEffect), iVisual(aVisual), iExtRect(extRect), iEffectCached(0), iEngine(aEngine), iRefCount(0), iParser(0), iGroup(KErrNotFound) { } IMPORT_C ~CHuiFxEffectCacheEffectNode(); void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle ); void SetEffectFlags( TInt aFlags ); @@ -104,6 +107,7 @@ void ParsingEndedBefore(); void ParsingEndedAfter(MHuiFxEffectCacheNode *aCached); TBool FxmlUsesInput1(); + TBool FxmlUsesOpaqueHint() const; void Delete(); private: diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectParser.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectParser.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectParser.h Mon May 03 13:22:43 2010 +0300 @@ -92,6 +92,7 @@ THuiFxFilterType GetFilterTypeL( CMDXMLNode* aNode ); THuiFxReferencePoint GetReferencePointL( CMDXMLNode* aNode, TReal32& aRefValue, TBool& aNeedRefValue ); THuiFxVisualSrcType GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap ); + TBool GetOpaqueHintL( CMDXMLNode *aNode ); TReal32 ParseFloatValueL(CMDXMLNode* aNode); TRgb ParseColorValueL(CMDXMLNode* aNode); TReal32 ParseFloatAttributeL(CMDXMLNode* aNode, const TDesC& aName, TBool aMustExist = ETrue); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h Mon May 03 13:22:43 2010 +0300 @@ -39,6 +39,13 @@ class MAlfGfxEffectObserver; class CHuiGc; +class MHuiEffectObserver + { + public: + virtual void EffectAdded(CHuiFxEffect* aEffect) = 0; + virtual void EffectComplete(CHuiFxEffect* aEffect) = 0; + }; + class CHuiFxEngine : public CBase, public MHuiLowMemoryObserver, public MHuiMemoryLevelObserver { // important constant! Affects memory fragmentation in backend too small @@ -107,7 +114,7 @@ TInt aFlags = 0 ); IMPORT_C TBool FxmlUsesInput1(const TDesC &aFileName); - + IMPORT_C TBool FxmlUsesOpaqueHint(const TDesC &aFileName); IMPORT_C void AdvanceTime(TReal32 aElapsedTime); @@ -126,10 +133,10 @@ * time. */ IMPORT_C void BeginGroupEffect(TInt aGroup); - IMPORT_C TInt ActiveGroupEffect(); + IMPORT_C TBool AddEffectToGroup(TInt aGroup); /* * StartGroupEffect * @@ -140,6 +147,7 @@ TInt LowMemoryState(); TBool HasActiveEffects() const; + TBool HasActiveFadeEffect() const; void ClearCache(); @@ -147,6 +155,19 @@ IMPORT_C void SetMemoryLevel(THuiMemoryLevel aLevel); + void SetObserver(MHuiEffectObserver* aObserver) + { + iEffectObserver = aObserver; + } + + /** + * Group effects wait until each effect has been drawn once. + * + * Group effects are set into motion by NotifyEffectReady, when all effects in + * the group have been drawn at least once. + */ + void NotifyEffectReady(TInt aGroupId); + protected: IMPORT_C void AddEffectL(CHuiFxEffect* aEffect); IMPORT_C void RemoveEffect(CHuiFxEffect* aEffect); @@ -157,6 +178,7 @@ private: TBool FxmlUsesInput1(CHuiFxEffect& aEffect); + TInt FindEffectGroup(TInt aGroup); private: // Render buffer management --- native implementations @@ -189,7 +211,24 @@ TRect iExtRect; CHuiFxEffectCache *iCache; TInt iLowGraphicsMemoryMode; - RArray iActiveEffectGroups; + + NONSHARABLE_STRUCT(TEffectGroupStruct) + { + public: + + TEffectGroupStruct(TInt aGroup) : iGroup(aGroup), iWaiting(0), iEndCalled(EFalse){}; + + TInt iGroup; + TInt iWaiting; + TBool iEndCalled; + }; + + /** + * Only one simultanious effect group is supported + */ + RArray iActiveEffectGroups; + + MHuiEffectObserver* iEffectObserver; }; #endif /*HUIFXENGINE_H_*/ diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h Mon May 03 13:22:43 2010 +0300 @@ -51,6 +51,7 @@ TInt LayerCount() const; CHuiFxLayer& Layer(TInt aIndex) const; void FxmlVisualInputs(RArray &aArray); + TBool FxmlUsesOpaqueHint() const; virtual void EnableMarginApplyChildren(TBool aEnable); virtual void SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h Mon May 03 13:22:43 2010 +0300 @@ -56,6 +56,7 @@ IMPORT_C virtual void SetExtRect( TRect *aExtRect )=0; IMPORT_C virtual void SetVisual( CHuiVisual *aVisual )=0; IMPORT_C virtual void SetVisual( MHuiEffectable *aVisual )=0; + virtual TBool FxmlUsesOpaqueHint() const { return EFalse; } IMPORT_C void CopyFromL(const CHuiFxLayer *aOldLayer); @@ -78,7 +79,7 @@ // Internal flag to tell wheter transparency is enabled virtual TBool IsSemitransparent() const; - virtual void FxmlVisualInputs(RArray &aArray) { } + virtual void FxmlVisualInputs(RArray & /*aArray*/) { } TBool AlwaysReadSurfacePixels() const; virtual void SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.inl --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.inl Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.inl Mon May 03 13:22:43 2010 +0300 @@ -221,7 +221,7 @@ template void CHuiFxGenericParameter::AdvanceTime(TReal32 aElapsedTime) { - if (!iTimeLine) + if (!iTimeLine || iAnimationFinished) { return; } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/HuiFxVisualLayer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxVisualLayer.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxVisualLayer.h Mon May 03 13:22:43 2010 +0300 @@ -29,7 +29,7 @@ class CHuiFxVisualLayer: public CHuiFxLayer { public: - IMPORT_C static CHuiFxVisualLayer* NewL(MHuiEffectable& aVisual); + IMPORT_C static CHuiFxVisualLayer* NewL(MHuiEffectable* aVisual); // param mandatory IMPORT_C ~CHuiFxVisualLayer(); IMPORT_C TBool PrepareDrawL(CHuiFxEngine& aEngine); IMPORT_C void Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource); @@ -51,8 +51,11 @@ IMPORT_C void SetVisual( MHuiEffectable *aVisual ); void FxmlVisualInputs(RArray &aArray); + void SetFxmlUsesOpaqueHint(TBool aValue); + TBool FxmlUsesOpaqueHint() const; + protected: - IMPORT_C void ConstructL(MHuiEffectable& aVisual); + IMPORT_C void ConstructL(MHuiEffectable* aVisual); void RegisterParameterL(const TDesC& aName, TRgb* aValue); void RegisterParameterL(const TDesC& aName, TReal32* aValue); @@ -93,7 +96,7 @@ HBufC* iExtBitmapFile; TReal32 iOpacity; - + TBool iOpaqueHint; }; #endif /*HUIFXVISUALLAYER_*/ diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/huiextension.h --- a/uiacceltk/hitchcock/coretoolkit/inc/huiextension.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huiextension.h Mon May 03 13:22:43 2010 +0300 @@ -83,4 +83,7 @@ TInt iErrorCode; }; +// Uid for Release Cached Textures extension for CHuiSkin. +const TUid KHuiSkinReleaseCachedTextures = { 0x2002E6D4 }; + #endif // __HUIEXTENSION_H__ diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/inc/huistatictlsdata.h --- a/uiacceltk/hitchcock/coretoolkit/inc/huistatictlsdata.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huistatictlsdata.h Mon May 03 13:22:43 2010 +0300 @@ -22,6 +22,14 @@ #define __HUISTATICTLSDATA_H__ +// For testing purposes, insert additional test data into TLS. +// Notice, that TTlsData object is inserted into TLS. So, test +// object needs to be added into TTLSData and not inserted directly +// into TLS. +#define AMT_CONTROL() static_cast(Dll::Tls())->iAlfModuleTestDataControl +#include "alfmoduletest.h" + + LOCAL_D const TInt KMaxClocks = 10; @@ -109,7 +117,12 @@ RFs* iFs; CAppFwProxy* iAppFwProxy; - + +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // For testing purposes, test data needs to be included into TLS object. + CAlfModuleTestDataControl* iAlfModuleTestDataControl; +#endif + CWsScreenDevice* WsScreenDevice(TInt aScreenNumber) { if (aScreenNumber < iScreenDevices.Count()) @@ -138,6 +151,13 @@ void DoInitL() { +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // For testing purposes, test data needs to be included into TTlsData object because + // TTlsData object itself is inserted into TLS. + iAlfModuleTestDataControl = new(ELeave) CAlfModuleTestDataControl(); + User::LeaveIfError( iAlfModuleTestDataControl->OpenGlobalObjects() ); +#endif + CCoeEnv* coe = CCoeEnv::Static(); if (coe) { @@ -206,6 +226,11 @@ iFs = 0; RFbsSession::Disconnect(); + +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + delete iAlfModuleTestDataControl; + iAlfModuleTestDataControl = NULL; +#endif } }; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OnscreenRenderbuffer.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OnscreenRenderbuffer.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OnscreenRenderbuffer.h Mon May 03 13:22:43 2010 +0300 @@ -46,6 +46,10 @@ protected: void ConstructL(CHuiVg10RenderPlugin& aPlugin, CHuiVg10RenderSurface& aSurface); void PrepareForReuse(const TSize& /* aReusedRect */); + + void CreateVgImage(); + void ReleaseVgImage(); + private: CHuiVg10RenderPlugin* iPlugin; CHuiVg10RenderSurface* iSurface; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h Mon May 03 13:22:43 2010 +0300 @@ -385,7 +385,7 @@ */ void SetPaintPattern(CHuiTexture* aTexture, const TPoint& aTextureOrigin); - void DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie); + void DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie) __SOFTFP; protected: @@ -482,7 +482,7 @@ TReal32 aBorderWidth, TReal32 aBorderHeight, THuiRealPoint aOffset, - const THuiImage* aImage); + const THuiImage* aImage) __SOFTFP; /** @@ -495,7 +495,7 @@ TReal32 aRightBorderWidth, TReal32 aTopBorderHeight, TReal32 aBottomBorderHeight, - const THuiImage* aImage); + const THuiImage* aImage) __SOFTFP; void CreateVgObjectsL(); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OnscreenRenderbuffer.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OnscreenRenderbuffer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OnscreenRenderbuffer.cpp Mon May 03 13:22:43 2010 +0300 @@ -36,33 +36,12 @@ iPlugin = &aPlugin; iSurface = &aSurface; iTextureUsage = ERenderbufferUsageReadWrite; - -#ifndef __WINS__ // Should possibly query the supported mode instead? - VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE; -#else - VGImageFormat imageInternalFormat = VG_sARGB_8888; -#endif - - iImage = vgCreateImage(imageInternalFormat, Size().iWidth, Size().iHeight, VG_IMAGE_QUALITY_NONANTIALIASED); - HUIFX_VG_INVARIANT(); - - // Initialize the context - iGc = iPlugin->CreateGcL(); - BindAsRenderTarget(); - iGc->InitState(); - UnbindAsRenderTarget(); - - // Let renderer know that we have been fiddlling with OpenVg state directly - // "iGc->InitState" confuses scissoring setting, so lets notify it. - CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer(); - renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor); - renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode); } + CHuiFxVg10OnscreenRenderbuffer::~CHuiFxVg10OnscreenRenderbuffer() { - vgDestroyImage(iImage); - HUIFX_VG_INVARIANT(); + ReleaseVgImage(); delete iGc; } @@ -87,6 +66,7 @@ iTextureUsage = aUsage; if (aUsage == ERenderbufferUsageReadWrite || aUsage == ERenderbufferUsageReadOnly) { + CreateVgImage(); BindAsRenderTarget(); vgGetPixels(iImage, 0, 0, 0, 0, Size().iWidth, Size().iHeight); HUIFX_VG_INVARIANT(); @@ -103,6 +83,7 @@ vgSetPixels(0, 0, iImage, 0, 0, Size().iWidth, Size().iHeight); HUIFX_VG_INVARIANT(); UnbindAsRenderTarget(); + ReleaseVgImage(); } } @@ -123,3 +104,34 @@ // this should never happen. ASSERT(FALSE); } + +void CHuiFxVg10OnscreenRenderbuffer::CreateVgImage() + { +#ifndef __WINS__ // Should possibly query the supported mode instead? + VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE; +#else + VGImageFormat imageInternalFormat = VG_sARGB_8888; +#endif + + iImage = vgCreateImage(imageInternalFormat, Size().iWidth, Size().iHeight, VG_IMAGE_QUALITY_NONANTIALIASED); + HUIFX_VG_INVARIANT(); + + // Initialize the context + iGc = iPlugin->CreateGcL(); + BindAsRenderTarget(); + iGc->InitState(); + UnbindAsRenderTarget(); + + // Let renderer know that we have been fiddlling with OpenVg state directly + // "iGc->InitState" confuses scissoring setting, so lets notify it. + CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer(); + renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor); + renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode); + } + +void CHuiFxVg10OnscreenRenderbuffer::ReleaseVgImage() + { + vgDestroyImage(iImage); + HUIFX_VG_INVARIANT(); + } + diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Mon May 03 13:22:43 2010 +0300 @@ -1555,7 +1555,7 @@ } -void CHuiVg10Gc::DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie) +void CHuiVg10Gc::DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie) __SOFTFP { // Fix given destination rect to be in th middle of openvg pixels THuiRealRect destinationRect = aRect; @@ -1759,7 +1759,7 @@ TReal32 aBorderWidth, TReal32 aBorderHeight, THuiRealPoint aOffset, - const THuiImage* aImage) + const THuiImage* aImage) __SOFTFP { // If there is no image, draw a solid border if (!aImage || !aImage->HasTexture()) @@ -1872,7 +1872,7 @@ TReal32 aRightBorderWidth, TReal32 aTopBorderHeight, TReal32 aBottomBorderHeight, - const THuiImage* aImage) + const THuiImage* aImage) __SOFTFP { // If there is no image, draw a solid border if (!aImage || !aImage->HasTexture()) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Mon May 03 13:22:43 2010 +0300 @@ -2100,7 +2100,7 @@ CHuiCanvasTextureCache::CHuiCanvasTextureCache() { SetMemoryLevel(EHuiMemoryLevelNormal); - CHuiStatic::Env().AddLowMemoryObserver(this); + CHuiStatic::Env().AddMemoryLevelObserver(this); } // --------------------------------------------------------------------------- @@ -2109,7 +2109,7 @@ // CHuiCanvasTextureCache::~CHuiCanvasTextureCache() { - CHuiStatic::Env().RemoveLowMemoryObserver(this); + CHuiStatic::Env().RemoveMemoryLevelObserver(this); iCachedTexts.ResetAndDestroy(); iCachedImages.ResetAndDestroy(); iRecycledTextures.ResetAndDestroy(); @@ -3170,7 +3170,7 @@ for(TInt i=entries.Count() - 1; i >= 0; i--) { - if (iCachedRenderBuffers[i]->iCanvasRenderBuffer) + if (entries[i]->iCanvasRenderBuffer) { TSize renderBufferSize = entries[i]->iCanvasRenderBuffer->Size(); totalUnusedRenderBufferBytes += renderBufferSize.iWidth * renderBufferSize.iHeight * KHuiCanvasRenderBufferEstimatedBpp/8.f; @@ -3473,6 +3473,25 @@ delete entry; } } + else if(iMemoryLevel <= EHuiMemoryLevelReduced) + { + // free all the caches but allow using renderbuffers + #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL + RDebug::Print(_L("-- CHuiCanvasTextureCache::SetMemoryLevel: Enabling recuded memory state")); + RDebug::Print(_L("-- CHuiCanvasTextureCache::SetMemoryLevel: Caching of textures disabled but renderbuffers enabled")); + #endif + // Set cache sizes to minimum + iMaxTextureMemoryInKBytes = 0; + iMaxRenderBufferMemoryInKBytes = 0; + + // Set flags to make sure we check all entries + iHasReleasedTexts = ETrue; + iHasReleasedImages = ETrue; + iHasReleasedRenderBuffers = ETrue; + + // Delete released cached entries + DeleteAllReleasedEntries(EFalse); + } else { #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Mon May 03 13:22:43 2010 +0300 @@ -80,6 +80,9 @@ RRegionBuf<5> iShapeRegion; TPoint iShapeOrigin; + + // Flag to indicate if this has received commands while inactive + TBool iCommandsReceivedWhileNoCache; }; EXPORT_C CHuiCanvasVisual* CHuiCanvasVisual::AddNewL(CHuiControl& aOwnerControl, @@ -125,6 +128,8 @@ iCanvasVisualData->iShapeOrigin = TPoint(); + iCanvasVisualData->iCommandsReceivedWhileNoCache = EFalse; + // subwindow effects //EnableBrushesL(ETrue); } @@ -274,6 +279,15 @@ void CHuiCanvasVisual::HandleBuffer(TRect& aDisplayRect, TInt aAction, CHuiGc* aGc) const { + TBool touchCountWasEnabled = EFalse; + if (iCanvasVisualData->iCommandsReceivedWhileNoCache) + { + // Commands were received while this visual didn't keep cache. + // So it's possible that some images are still in texture cache but haven't been updated. + touchCountWasEnabled = Env().CanvasTextureCache().IsTouchCountCheckEnabled(); + Env().CanvasTextureCache().EnableTouchCountCheck(); + } + if (iCanvasVisualData->iCommandSetType == ECommandBufferWs || iCanvasVisualData->iCommandSetType == ECommandBufferAlf) { TRAPD(err, iCanvasVisualData->iCanvasPainter->HandleBufferL(aDisplayRect, aAction, *this, aGc, DisplayRect().iTl.Round())); @@ -287,6 +301,14 @@ // do nothing } + if (iCanvasVisualData->iCommandsReceivedWhileNoCache) + { + Env().CanvasTextureCache().EnableTouchCountCheck( touchCountWasEnabled ); + if ( !KeepNoCache() && aAction == EDrawBuffer ) + { + iCanvasVisualData->iCommandsReceivedWhileNoCache = EFalse; + } + } } @@ -772,13 +794,9 @@ TRAP_IGNORE(iCanvasVisualData->iCanvasPainter->SetCommandSetL(aCommands)); // Memory optimization. Do not prepare cache if visual is inactive. - TBool rosterFrozen = Display() && Display()->Roster().IsVisibleContentFrozen(); - TBool inactive = EFalse; - inactive |= Flags() & EHuiVisualFlagInactive; - inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint; - - if (rosterFrozen || inactive) + if (KeepNoCache()) { + iCanvasVisualData->iCommandsReceivedWhileNoCache = ETrue; ClearCache(); } else @@ -846,13 +864,9 @@ TRAP_IGNORE(iCanvasVisualData->iCanvasPainter->AddCommandSetL(aMoreCommands)); // Memory optimization. Do not prepare cache if visual is inactive. - TBool rosterFrozen = Display() && Display()->Roster().IsVisibleContentFrozen(); - TBool inactive = EFalse; - inactive |= Flags() & EHuiVisualFlagInactive; - inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint; - - if (rosterFrozen || inactive) + if (KeepNoCache()) { + iCanvasVisualData->iCommandsReceivedWhileNoCache = ETrue; ClearCache(); } else @@ -998,7 +1012,11 @@ background.iPaintedRect = DisplayRect(); background.iPaintType = /*(iCanvasVisualData->iBackground->BackgroundColor().Alpha() == 255) ?*/ EHuiCanvasPaintTypeOpaque;// : EHuiCanvasPaintTypeTransparent; return background; - } + } + else + { + aIndex--; + } } } @@ -1543,3 +1561,13 @@ { return iCanvasVisualData->iCanvasPainter->HasCommandBuffers(EHuiCanvasBufferContainsTransparentClear); } + +TBool CHuiCanvasVisual::KeepNoCache() const + { + TBool rosterFrozen = Display() && Display()->Roster().IsVisibleContentFrozen(); + TBool inactive = EFalse; + inactive |= Flags() & EHuiVisualFlagInactive; + inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint; + + return rosterFrozen || inactive; + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Mon May 03 13:22:43 2010 +0300 @@ -638,6 +638,12 @@ return EFalse; } + if (!iForegroundTextureTransparency && iForegroundTexture) + { + // When we can blit foreground texture, we shouldn't need any textures in skin side. + iEnv.Skin().ReleaseCachedTextures(); + } + TBool useDirtyRects = (RenderSurface().Flags() & MHuiRenderSurface::EFlagUseDirtyRects) == MHuiRenderSurface::EFlagUseDirtyRects; @@ -748,6 +754,23 @@ iGc->SetPenColor(iBackgroundColor); iGc->InitNewFrame(); + + // if there is a fade effect in progress, we + // 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() + || RosterImpl().IsVisibleContentFrozen() // guaranteen, that transparent pixels of the UI surface are drawn correctly during layout switch. + ) + { + iGc->SetPenColor(KRgbBlack); + iGc->SetPenAlpha(0); + iGc->Disable(CHuiGc::EFeatureClipping); + iGc->Disable(CHuiGc::EFeatureBlending); + iGc->Clear(); + } + + if ( iDrawDirtyRegions ) { // Show dirty. @@ -1035,6 +1058,12 @@ iClearBackground = aClearBackground; iBackgroundItems.Reset(); + + // release background texture if clearing is set to None + if(aClearBackground == EClearNone) + { + iEnv.Skin().ReleaseTexture(EHuiSkinBackgroundTexture); + } } @@ -1628,6 +1657,12 @@ EXPORT_C void CHuiDisplay::SetForegroundTextureOptions(TBool aTransparency) { iForegroundTextureTransparency = aTransparency; + + if (!iForegroundTextureTransparency && iForegroundTexture) + { + // When we can blit foreground texture, we shouldn't need any textures in skin side. + iEnv.Skin().ReleaseCachedTextures(); + } } void CHuiDisplay::UpdateForegroundTexture(const TRect& aRect) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Mon May 03 13:22:43 2010 +0300 @@ -76,12 +76,20 @@ { delete iRoot; iRoot = NULL; - NotifyEffectEndObserver(); ReleaseCachedRenderTarget(); iEngine->RemoveEffect(this); + if (iEngine && iGroupId != KErrNotFound && !iNotifiedEffectReady) + { + // 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; + iEngine->NotifyEffectReady(iGroupId); + } + #ifdef HUIFX_TRACE RDebug::Print(_L("CHuiFxEffect::~CHuiFxEffect - 0x%x"), this); #endif @@ -89,12 +97,18 @@ void CHuiFxEffect::NotifyEffectEndObserver() { - if ( iEffectEndObserver ) + // fade effect should not have observers + if (iFlags & KHuiFadeEffectFlag) + { + return; + } + if (iEffectEndObserver) { // The callback can be called only once when the effect finishes - iEffectEndObserver->AlfGfxEffectEndCallBack( iHandle ); + MAlfGfxEffectObserver* effectEndObserver = iEffectEndObserver; iEffectEndObserver = NULL; - iHandle = 0; + // Note: The call below may synchronously delete me (CHuiFxEffect instance) + effectEndObserver->AlfGfxEffectEndCallBack( iHandle ); } } @@ -308,10 +322,9 @@ } // Write cached buffer to the display - if (cachedRenderTargetNeedsRefresh) - { - iEngine->Composite(aGc, *iCachedRenderTarget, targetRect.iTl, aOpaque && !(EffectFlags() & KHuiFxAlwaysBlend), aAlpha); - } + + iEngine->Composite(aGc, *iCachedRenderTarget, targetRect.iTl, aOpaque && !(EffectFlags() & KHuiFxAlwaysBlend), aAlpha); + if (aClipRegion.Count()) { @@ -437,7 +450,11 @@ EXPORT_C void CHuiFxEffect::SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle ) { iEffectEndObserver = aEffectEndObserver; - iHandle = aHandle; + + if (aHandle != 0) // override handle only if someone is interested + { + iHandle = aHandle; + } } EXPORT_C void CHuiFxEffect::SetEffectFlags( TInt aFlags ) @@ -445,6 +462,22 @@ iFlags = aFlags; } +void CHuiFxEffect::SetEffectFlag( TInt aFlag ) + { +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEffect::SetEffectFlag - Setting flag 0x%x for 0x%x, before: iFlags: 0x%x", aFlag, this, iFlags); +#endif + iFlags |= aFlag; + } + +void CHuiFxEffect::ClearEffectFlag( TInt aFlag ) + { +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEffect::ClearEffectFlag - Clearing flag 0x%x for 0x%x, before: iFlags: 0x%x", aFlag, this, iFlags); +#endif + iFlags &= ~aFlag; + } + EXPORT_C void CHuiFxEffect::SetEffectGroup(TInt aGroupId) { iGroupId = aGroupId; @@ -462,25 +495,63 @@ EXPORT_C void CHuiFxEffect::AdvanceTime(TReal32 aElapsedTime) { +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEffect::AdvanceTime 0x%x, aElapsed time: %f, Total elapsed time: %f, Frames drawn: %d, iFlags: 0x%x, iGroup %d, iHandle: %d", + this, + aElapsedTime, + iElapsedTime, + iFramesDrawn, + iFlags, + iGroupId, + iHandle); +#endif + // KHuiFxDelayRunUntilFirstFrameHasBeenDrawn flag is for giving effect chance to run + // its whole timeline by starting the time only when first frame has been drawn. if (iFlags & KHuiFxDelayRunUntilFirstFrameHasBeenDrawn) { + // Sometimes the effect does not get any frames. Force the time to start, because + // otherwise will jam itself and possible the group, where the effect is. + if (iElapsedTime > 0.2 && iFramesDrawn == 0) + { + iFramesDrawn = 1; +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEffect::AdvanceTime - Not drawn, but cannot wait. release 0x%x in time %f", this, iElapsedTime); +#endif + } + if (iFramesDrawn) - { + { + if (iFlags & KHuiFxReadyAndWaitingGroupToStartSyncronized) + { + // this has drawn atleast once, but all the effect in this group have not drawn. Must hang on little more. + return; + } + + if (iFlags & KHuiFxWaitGroupToStartSyncronized) + { + // Group has been started, waiting the others in the group to be drawn + ClearEffectFlag(KHuiFxWaitGroupToStartSyncronized); + SetEffectFlag(KHuiFxReadyAndWaitingGroupToStartSyncronized); + // NotifyEffectReady will clear KHuiFxReadyAndWaitingGroupToStartSyncronized flag + // if all items in the group are ready. + iEngine->NotifyEffectReady(iGroupId); + iNotifiedEffectReady = ETrue; + return; + } + if (iFramesDrawn == 1) { aElapsedTime = 0; iFramesDrawn++; } - iRoot->AdvanceTime(aElapsedTime); - } - else - { + iRoot->AdvanceTime(aElapsedTime); } } else { iRoot->AdvanceTime(aElapsedTime); } + iElapsedTime += aElapsedTime; } EXPORT_C TBool CHuiFxEffect::IsAnimated() const @@ -560,3 +631,8 @@ { iRoot->FxmlVisualInputs(aArray); } + +TBool CHuiFxEffect::FxmlUsesOpaqueHint() const + { + return iRoot->FxmlUsesOpaqueHint(); + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp Mon May 03 13:22:43 2010 +0300 @@ -234,7 +234,7 @@ } return 0; } -MHuiFxEffectCacheNode *CHuiFxEffectCache::FindCached(const TDesC &aId) +MHuiFxEffectCacheNode *CHuiFxEffectCache::FindCached(const TDesC &aId) const { TInt size2 = iCachedEffects.Count(); for(TInt i=0;iFxmlUsesOpaqueHint(); + else + return EFalse; + } + + void CHuiFxEffectCache::Remove(RHashMap & /*aMap*/, MHuiFxEffectCacheNode * /*aNode*/) { @@ -431,3 +441,9 @@ array.Close(); return EFalse; } + +TBool CHuiFxEffectCacheEffectNode::FxmlUsesOpaqueHint() const + { + CHuiFxEffect *effect = iEffect; + return effect->FxmlUsesOpaqueHint(); + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp Mon May 03 13:22:43 2010 +0300 @@ -345,9 +345,11 @@ #endif TPtrC16 extBitmap; THuiFxVisualSrcType srcType = GetSrcTypeL( aNode, extBitmap ); - CHuiFxVisualLayer* visual = CHuiFxVisualLayer::NewL( *iVisual ); + TBool opaqueHint = GetOpaqueHintL(aNode); + CHuiFxVisualLayer* visual = CHuiFxVisualLayer::NewL( iVisual ); CleanupStack::PushL( visual ); visual->SetSourceType( srcType ); + visual->SetFxmlUsesOpaqueHint( opaqueHint ); if ( srcType == EVisualSrcBitmap && extBitmap.Length() > 0 ) { visual->SetExtBitmapFileL( extBitmap ); @@ -1159,6 +1161,35 @@ #endif return ref; } +TBool CHuiFxEffectParser::GetOpaqueHintL( CMDXMLNode *aNode ) + { + if (aNode->NodeType() != CMDXMLNode::EElementNode) + { + FAIL(KErrGeneral, _L("Text node expected while reading visual source type")); + } + TInt attributeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitOpaque ); + if (attributeIndex == KErrNotFound) + { + // If src not found, the source defaults to visual itself + return EFalse; + } + + TPtrC attributeValue; + TPtrC attributeName; + User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( attributeIndex, attributeName, attributeValue )); + + if( attributeValue.Compare( KLitTrue ) == 0 ) + { + return ETrue; + } + + if( attributeValue.Compare( KLitFalse ) == 0 ) + { + return EFalse; + } + + return EFalse; + } THuiFxVisualSrcType CHuiFxEffectParser::GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap ) { diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Mon May 03 13:22:43 2010 +0300 @@ -16,7 +16,6 @@ */ - #include "HuiFxEngine.h" #include "HuiFxEffectParser.h" #include "HuiFxEffect.h" @@ -66,6 +65,7 @@ #endif #endif CHuiStatic::Env().AddMemoryLevelObserver(this); + iActiveEffectGroups.Reserve(2); } EXPORT_C TBool CHuiFxEngine::FxmlUsesInput1(const TDesC &aFileName) @@ -77,6 +77,15 @@ return EFalse; #endif } +EXPORT_C TBool CHuiFxEngine::FxmlUsesOpaqueHint(const TDesC &aFileName) + { +#ifdef HUIFX_EFFECTCACHE_ENABLED + return iCache->FxmlUsesOpaqueHint(aFileName); +#endif +#ifndef HUIFX_EFFECTCACHE_ENABLED + return EFalse; +#endif + } TBool CHuiFxEngine::FxmlUsesInput1(CHuiFxEffect& aEffect) { @@ -282,8 +291,11 @@ for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- ) { CHuiFxEffect* effect = iActiveEffects[i]; - if (!effect->Changed()) + if (!(effect->EffectFlags() & KHuiFadeEffectFlag) && !effect->Changed()) { +#ifdef HUIFX_TRACE + RDebug::Printf("void CHuiFxEngine::NotifyEffectEndObservers() calling NotifyEffectEndObserver"); +#endif effect->NotifyEffectEndObserver(); } } @@ -295,13 +307,14 @@ TInt i; TBool refreshRequired = EFalse; #ifdef HUIFX_TRACE - RDebug::Print(_L("CHuiFxEngine::AdvanceTime - 0x%x "), this); + RDebug::Print(_L("CHuiFxEngine::AdvanceTime - 0x%x, effect count: %d"), this, iActiveEffects.Count()); #endif // Go through the list in reverse order. // If the effect has ended, and has the callback set, // the effect will be removed, and will no longer be part of iActiveEffects set. // We must check if the effect is still in our list, but the indices change // if something is removed from the middle of the list + TInt skipGroup = KErrNotFound; for ( i = iActiveEffects.Count() - 1; i >= 0; i-- ) { CHuiFxEffect* effect = iActiveEffects[i]; @@ -309,10 +322,26 @@ { refreshRequired = ETrue; } - if ( i < iActiveEffects.Count() && effect == iActiveEffects[i] && !(effect->EffectFlags() & KHuiFxWaitGroupSyncronization)) + TInt flags = effect->EffectFlags(); + if ( !(flags & KHuiFxWaitGroupSyncronization) + && !(flags & KHuiFadeEffectFlag) // fade is not animated. Note, if animated effect would be used, remove this! + && (skipGroup == KErrNotFound || skipGroup != effect->GroupId()) + ) { // The effect is still in its place, it did not go away yet + TBool waitingGroupBefore = flags & KHuiFxWaitGroupToStartSyncronized; effect->AdvanceTime(aElapsedTime); + + if (waitingGroupBefore) + { + flags = effect->EffectFlags(); + if (!(flags & KHuiFxReadyAndWaitingGroupToStartSyncronized) && !(flags & KHuiFxWaitGroupToStartSyncronized)) + { + // effects in this group are all ready to start drawing. Skip this group in AdvanceTime, + // that they can start syncronized on the next round + skipGroup = effect->GroupId(); + } + } } } @@ -332,6 +361,10 @@ #endif // #ifdef HUIFX_TRACE iActiveEffects.AppendL(aEffect); + if (iEffectObserver) + { + iEffectObserver->EffectAdded(aEffect); + } } EXPORT_C void CHuiFxEngine::RemoveEffect(CHuiFxEffect* aEffect) @@ -343,6 +376,10 @@ if (i >= 0) { iActiveEffects.Remove(i); + if (iEffectObserver) + { + iEffectObserver->EffectComplete(aEffect); + } } } @@ -489,7 +526,7 @@ ASSERT((aBuffer) && (iBuffersInUse > 0)); #ifdef HUIFX_RBCACHE_ENABLED - if(iLowGraphicsMemoryMode || IsCacheFull()) + if(iLowGraphicsMemoryMode < EHuiMemoryLevelReduced || IsCacheFull()) { #ifdef HUIFX_TRACE RDebug::Print(_L("CHuiFxEngine::ReleaseRenderbuffer() --- Renderbuffer cache full! Suspectible for memory fragmentation! Cache size is %d entries."), CACHE_SIZE); @@ -572,7 +609,7 @@ EXPORT_C void CHuiFxEngine::SetMemoryLevel(THuiMemoryLevel aLevel) { iLowGraphicsMemoryMode = aLevel; - if(iLowGraphicsMemoryMode) // != Normal + if(iLowGraphicsMemoryMode < EHuiMemoryLevelReduced) { ClearCache(); } @@ -585,19 +622,37 @@ TInt CHuiFxEngine::LowMemoryState() { - return iLowGraphicsMemoryMode; + return iLowGraphicsMemoryMode < EHuiMemoryLevelReduced; } TBool CHuiFxEngine::HasActiveEffects() const { // Don't report active effects if in SW-rendering mode - if(iLowGraphicsMemoryMode) // != Normal + if(iLowGraphicsMemoryMode < EHuiMemoryLevelReduced) { return EFalse; } return iActiveEffects.Count() > 0; } +TBool CHuiFxEngine::HasActiveFadeEffect() const + { + // Don't report active effects if in SW-rendering mode + if(iLowGraphicsMemoryMode < EHuiMemoryLevelReduced) + { + return EFalse; + } + TInt effectCount = iActiveEffects.Count(); + for (TInt count = 0; count < effectCount; count++) + { + if (iActiveEffects[count]->EffectFlags() & KHuiFadeEffectFlag) + { + return ETrue; + } + } + return EFalse; + } + void CHuiFxEngine::ClearCache() { // Release cached render targets from effects @@ -626,48 +681,142 @@ ASSERT(iBuffersInCache == 0); } - + +TInt CHuiFxEngine::FindEffectGroup(TInt aGroup) + { + for (TInt i=0 ; i < iActiveEffectGroups.Count();i++) + { + if (iActiveEffectGroups[i].iGroup == aGroup) + { + return i; + } + } + return KErrNotFound; + } + EXPORT_C void CHuiFxEngine::BeginGroupEffect(TInt aGroup) { - TInt index = iActiveEffectGroups.Find(aGroup); +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEngine::BeginGroupEffect(TInt aGroup %d) >>", aGroup); +#endif + // Multiple grouped effects at the same time are not supported. + // Same visual might participate different groups, which will mess up the effect + if (iActiveEffectGroups.Count()>0) + { + // delete previous groups + while(iActiveEffectGroups.Count()) + { + TInt groupId = iActiveEffectGroups[0].iGroup; + for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- ) + { + if (iActiveEffects[i]->GroupId() == groupId) + { + iActiveEffects[i]->ClearEffectFlag(KHuiFxReadyAndWaitingGroupToStartSyncronized); + iActiveEffects[i]->ClearEffectFlag(KHuiFxWaitGroupToStartSyncronized); + iActiveEffects[i]->ClearEffectFlag(KHuiFxWaitGroupSyncronization); + } + + } + iActiveEffectGroups.Remove(0); + } + } + + TInt index = FindEffectGroup(aGroup); + if (index == KErrNotFound) { - iActiveEffectGroups.Append(aGroup); - } - else - { - // group already exists + const TEffectGroupStruct item(aGroup); + iActiveEffectGroups.Append(item); } } +// This will add effect to this group. Do not call this function more than once for single effect EXPORT_C TInt CHuiFxEngine::ActiveGroupEffect() { - if (iActiveEffectGroups.Count() > 0) - { - return iActiveEffectGroups[iActiveEffectGroups.Count()-1]; - } - else - { - return KErrNotFound; - } + TInt index = iActiveEffectGroups.Count(); + if (index == 0) + { + return KErrNotFound; + } + while(--index >= 0) + { + // group is alive until all its effects have been drawn once. .iEndCalled is to prevent + // another effect entering into this group + const TEffectGroupStruct& item = iActiveEffectGroups[index]; + if (!item.iEndCalled) + { + return iActiveEffectGroups[index].iGroup; + } + } + return KErrNotFound; } +EXPORT_C TBool CHuiFxEngine::AddEffectToGroup(TInt aGroup) + { + TInt index = FindEffectGroup(aGroup); + if (index != KErrNotFound) + { + // keep count of effects in this group. All must draw atleast once, before + // syncronized group effect may start + iActiveEffectGroups[index].iWaiting++; +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEngine::AddEffectToGroup - %d, waiting in group: %d", aGroup, iActiveEffectGroups[index].iWaiting); +#endif + return ETrue; + } + return EFalse; + } + EXPORT_C void CHuiFxEngine::StartGroupEffect(TInt aGroup) { - TInt index = iActiveEffectGroups.Find(aGroup); +#ifdef HUIFX_TRACE + RDebug::Printf("CHuiFxEngine::StartGroupEffect(TInt aGroup %d) >>", aGroup); +#endif + TInt index = FindEffectGroup(aGroup); if (index != KErrNotFound) { - iActiveEffectGroups.Remove(index); - + iActiveEffectGroups[index].iEndCalled = ETrue; // this group will not take any more participants for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- ) { CHuiFxEffect* effect = iActiveEffects[i]; TInt flags = effect->EffectFlags(); if ((flags & KHuiFxWaitGroupSyncronization) && (effect->GroupId() == aGroup)) { - flags &= ~KHuiFxWaitGroupSyncronization; - effect->SetEffectFlags(flags); + effect->ClearEffectFlag(KHuiFxWaitGroupSyncronization); + effect->SetEffectFlag(KHuiFxWaitGroupToStartSyncronized); } } } } + +void CHuiFxEngine::NotifyEffectReady(TInt aGroupId) + { +#ifdef HUIFX_TRACE + RDebug::Print(_L("CHuiFxEngine::NotifyEffectReady - %d"), aGroupId); +#endif + TInt index = FindEffectGroup(aGroupId); + if (index != KErrNotFound) + { + iActiveEffectGroups[index].iWaiting--; +#ifdef HUIFX_TRACE + RDebug::Print(_L("CHuiFxEngine::NotifyEffectReady - waiting %d in group %d"), iActiveEffectGroups[index].iWaiting , aGroupId); +#endif + if (iActiveEffectGroups[index].iWaiting == 0) + { + // set in motion all effects in this group + iActiveEffectGroups.Remove(index); + for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- ) + { + CHuiFxEffect* effect = iActiveEffects[i]; + TInt flags = effect->EffectFlags(); +#ifdef HUIFX_TRACE + RDebug::Print(_L("CHuiFxEngine::NotifyEffectReady - effect 0x%x, group: %d, flags 0x%x"), effect, effect->GroupId(), effect->EffectFlags()); +#endif + if ((flags & KHuiFxReadyAndWaitingGroupToStartSyncronized) && (effect->GroupId() == aGroupId)) + { + effect->ClearEffectFlag(KHuiFxReadyAndWaitingGroupToStartSyncronized); + } + } + } + } + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxFilterLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxFilterLayer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxFilterLayer.cpp Mon May 03 13:22:43 2010 +0300 @@ -59,7 +59,7 @@ { // iFilter does not need these } -EXPORT_C void CHuiFxFilterLayer::SetVisual( MHuiEffectable *aVisual ) +EXPORT_C void CHuiFxFilterLayer::SetVisual( MHuiEffectable * /*aVisual*/ ) { // iFilter does not need these } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp Mon May 03 13:22:43 2010 +0300 @@ -456,6 +456,16 @@ } } +TBool CHuiFxGroupLayer::FxmlUsesOpaqueHint() const + { + TBool b = EFalse; + for( TInt i=0 ; i < iLayers.Count() ; i++ ) + { + b |= iLayers[i]->FxmlUsesOpaqueHint(); + } + return b; + } + void CHuiFxGroupLayer::SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels) { CHuiFxLayer::SetAlwaysReadSurfacePixels(aAlwaysReadSurfacePixels); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp Mon May 03 13:22:43 2010 +0300 @@ -25,7 +25,7 @@ #include #include "HuiCmdBufferBrush.h" -EXPORT_C CHuiFxVisualLayer* CHuiFxVisualLayer::NewL(MHuiEffectable& aVisual) +EXPORT_C CHuiFxVisualLayer* CHuiFxVisualLayer::NewL(MHuiEffectable* aVisual) { CHuiFxVisualLayer* e = new (ELeave) CHuiFxVisualLayer(); CleanupStack::PushL(e); @@ -34,14 +34,14 @@ return e; } -EXPORT_C void CHuiFxVisualLayer::ConstructL(MHuiEffectable& aVisual) +EXPORT_C void CHuiFxVisualLayer::ConstructL(MHuiEffectable* aVisual) { #ifdef HUIFX_TRACE RDebug::Print(_L("CHuiFxVisualLayer::ConstructL - 0x%x "), this); #endif CHuiFxLayer::ConstructL( ELayerTypeVisual ); iParameterManager = CHuiFxParameterManager::NewL(); - iVisual = &aVisual; + iVisual = aVisual; iSrcType = EVisualSrcVisual; iExtBitmapFile = NULL; @@ -174,6 +174,7 @@ else layer->iExtBitmapFile = NULL; layer->iOpacity = iOpacity; + layer->iOpaqueHint = iOpaqueHint; return layer; } EXPORT_C void CHuiFxVisualLayer::SetExtRect( TRect * /*aExtRect*/ ) @@ -446,7 +447,17 @@ { aArray.Append(iSrcType); } - + +TBool CHuiFxVisualLayer::FxmlUsesOpaqueHint() const + { + return iOpaqueHint; + } + +void CHuiFxVisualLayer::SetFxmlUsesOpaqueHint(TBool aValue) + { + iOpaqueHint = aValue; + } + TBool CHuiFxVisualLayer::IsSemitransparent() const { if (iOpacity < 1.f) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp Mon May 03 13:22:43 2010 +0300 @@ -106,6 +106,9 @@ void CHuiRosterImpl::ShowL(CHuiControlGroup& aGroup, TInt aWhere) { + + // The group will automatically accept input events once shown. + aGroup.SetAcceptInput(ETrue); // If the group is already shown on the display, just adjust its position // according to the parameters. if(Find(&aGroup) != KErrNotFound) @@ -142,8 +145,7 @@ InsertL(&aGroup, aWhere); } - // The group will automatically accept input events once shown. - aGroup.SetAcceptInput(ETrue); + // Show all the controls of the group. for(TInt i = 0; i < aGroup.Count(); ++i) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp Mon May 03 13:22:43 2010 +0300 @@ -32,7 +32,7 @@ #include #include "huiskinbackroundlayout.h" - +#include "huiextension.h" struct TBackgroundTexture { @@ -296,7 +296,14 @@ EXPORT_C void CHuiS60Skin::SkinExtension(const TUid& aExtensionUid, TAny** aExtensionParameters) { - CHuiSkin::SkinExtension(aExtensionUid,aExtensionParameters); + if (aExtensionUid == KHuiSkinReleaseCachedTextures) + { + FreeAllBackgroundTextureResources(); + } + else + { + CHuiSkin::SkinExtension(aExtensionUid, aExtensionParameters); + } } EXPORT_C THuiSkinOrientation CHuiS60Skin::Orientation() const @@ -513,7 +520,7 @@ bgTexture = ((TPrivData*)(iSpare))->iBackgrounds[index]; if (bgTexture.iID == aID) { - if(!bgTexture.iBackgroundTexture && !bgTexture.iBackgroundTexture->HasContent()) + if(!bgTexture.iBackgroundTexture || !bgTexture.iBackgroundTexture->HasContent()) { delete bgTexture.iBackgroundTexture; bgTexture.iBackgroundTexture = NULL; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiSkin.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiSkin.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiSkin.cpp Mon May 03 13:22:43 2010 +0300 @@ -27,6 +27,7 @@ #include "uiacceltk/HuiUtil.h" #include "uiacceltk/HuiPanic.h" #include "uiacceltk/HuiDisplay.h" +#include "huiextension.h" CHuiSkin::CHuiSkin(CHuiEnv& aEnv) : iEnv(aEnv) @@ -192,6 +193,10 @@ return err; } +void CHuiSkin::ReleaseCachedTextures() + { + SkinExtension(KHuiSkinReleaseCachedTextures, NULL); + } void CHuiSkin::PrepareShadowTextureL(CHuiTexture& aTexture) { diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Mon May 03 13:22:43 2010 +0300 @@ -390,6 +390,14 @@ iChangeNotifier->Start(); #ifndef __WINSCW__ globalWriteableData = *iData; + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // For testing purposes, test data needs to be included into TLS + // because test cases require information stored in TLS. + if ( !Dll::Tls() ) + { + Dll::SetTls( iData ); + } + #endif #else Dll::SetTls(iData); #endif @@ -417,7 +425,7 @@ } iChangeNotifier->Cancel(); delete iChangeNotifier; -#ifdef __WINSCW__ +#if defined( __WINSCW__ ) || defined( USE_MODULE_TEST_HOOKS_FOR_ALF ) Dll::FreeTls(); #endif delete iData; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp Mon May 03 13:22:43 2010 +0300 @@ -34,6 +34,15 @@ #include +#include "alfmoduletestconf.h" +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // Provides TLS object data for test cases. + // This is used only if module test hooks are set on. + #include "huistatictlsdata.h" +#endif // USE_MODULE_TEST_HOOKS_FOR_ALF +// Provides module test hook defines. +#include "alfmoduletestdefines.h" + EXPORT_C CHuiCanvasGc::CHuiCanvasGc(): iPenColor(KRgbBlack), @@ -44,7 +53,7 @@ iHorizontalTextAlign(EHuiAlignHLeft), iTextStyleId(EHuiTextStyleNormal), iEffectiveOpacityEnabled(ETrue) - { + { } EXPORT_C CHuiCanvasGc::~CHuiCanvasGc() @@ -640,6 +649,10 @@ DisableDelayedClippingIfNeeded(); Cleanup(); + + AMT_MAP_SET_VALUE_IF( iVisual && aRects.Count() > 0, iRectMap, + AMT_MAP_CPTR_TO_KEY_CAST( iVisual ), aRects[ aRects.Count() - 1 ].Round(), + EAlfModuleTestTypeCoreToolkitDrawWindow ); } EXPORT_C void CHuiCanvasGc::DoDrawRects(RArray& aRects) @@ -1346,7 +1359,12 @@ DisableDelayedClippingIfNeeded(); - Cleanup(); + Cleanup(); + + AMT_MAP_SET_VALUE_IF( iVisual, iRectMap, + AMT_MAP_CPTR_TO_KEY_CAST( iVisual ), + destinationRect.Round(), + EAlfModuleTestTypeCoreToolkitDrawFromRenderBuffer ); } EXPORT_C void CHuiCanvasGc::ClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect ) diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp Mon May 03 13:22:43 2010 +0300 @@ -56,6 +56,7 @@ { iTexture->SetTextureChanged(ETrue); } + CHuiStatic::ContinueRefresh(); } EXPORT_C void CHuiGifAnimationTexture::Stop() @@ -78,6 +79,7 @@ { iAnimationState = ClearFlag(TInt(iAnimationState), TInt(EEnabled)); } + CHuiStatic::ContinueRefresh(); } EXPORT_C TInt CHuiGifAnimationTexture::Id() @@ -139,7 +141,16 @@ } iElapsedTime = 0.0f; - } + } + // not enough time was elapsed, + // if the animation is not stopped + // request continuerefresh in order + // not to go to sleep + else + { + iTexture->SetTextureChanged(ETrue); + CHuiStatic::ContinueRefresh(); + } } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/data/goomconfig.xml --- a/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Mon May 03 13:22:43 2010 +0300 @@ -18,7 +18,13 @@ actions are needed. This value is meaningful only when "check" or "estimate" sync mode is used with plugins. --> - + - + @@ -70,8 +76,9 @@ - - + + + diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomaction.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomaction.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomaction.h Mon May 03 13:22:43 2010 +0300 @@ -46,7 +46,7 @@ * @since S60 5.0 * @param aBytesRequested ?description */ - virtual void FreeMemory(TInt aBytesRequested) = 0; + virtual void FreeMemory(TInt aBytesRequested, TBool aUseSwRendering) = 0; /** * @since S60 5.0 diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomactionlist.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomactionlist.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionlist.h Mon May 03 13:22:43 2010 +0300 @@ -184,6 +184,19 @@ */ void AppNotExiting(TInt aWgId); + /** + * Sets the flag to free memory using sw rendering. For Alf and other plugins that use sw rendering to reduces gpu mem usage. + * @since S60 5.0 + * @param aUseSwRendering ETrue if sw rendering to be used. + */ + void SetUseSwRendering(TBool aUseSwRendering); + + /** + * Returns the flag to free memory using sw rendering. For Alf and other plugins that use sw rendering to reduces gpu mem usage. + * @since S60 5.0 + */ + TBool UseSwRendering(); + // from MGOomActionObserver /** @@ -251,6 +264,7 @@ TUint iCurrentPluginRun; RArray iLowOnMemWgs; + TBool iUseSwRendering; }; #include "goomactionlist.inl" diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.h Mon May 03 13:22:43 2010 +0300 @@ -73,6 +73,7 @@ TUint iLowRamThreshold; TUint iTargetFree; TUint iSkipPluginId; + TBool iUseSwRendering; private: diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.h Mon May 03 13:22:43 2010 +0300 @@ -52,7 +52,7 @@ * Call the CGOomAction::MemoryFreed when it is done * @param aBytesRequested not used for clsoe app actions */ - virtual void FreeMemory(TInt aBytesRequested); + virtual void FreeMemory(TInt aBytesRequested, TBool aUseSwRendering); ~CGOomCloseApp(); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.h Mon May 03 13:22:43 2010 +0300 @@ -44,7 +44,7 @@ // Run the GOOM plugin in order to free memory // Call the CGOomAction::MemoryFreed when it is done - virtual void FreeMemory(TInt aBytesRequested); + virtual void FreeMemory(TInt aBytesRequested, TBool aUseSwRendering); // Call the memory good function on the plugin but... // only if there is an outstanding FreeMemory request @@ -76,6 +76,8 @@ CGOomPluginWaiter* iPluginWaiter; TBool iFreeMemoryCalled; // True if FreeMemory has been called since the last call to MemoryGood + + TBool iFreeMemoryWithSwRenderingCalled; }; #include "goomrunplugin.inl" diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.inl --- a/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.inl Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.inl Mon May 03 13:22:43 2010 +0300 @@ -31,7 +31,12 @@ inline TBool CGOomRunPlugin::IsRunning() { - return iPluginWaiter->IsActive(); + if(iPluginWaiter) + { + return iPluginWaiter->IsActive(); + } + + return EFalse; } inline void CGOomRunPlugin::WaitCompleted() diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.h --- a/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.h Mon May 03 13:22:43 2010 +0300 @@ -56,6 +56,10 @@ inline TGOomPluginType PluginType(); + inline void SetSwRend(TBool aSwRend); + + inline TBool IsSwRendSupported(); + private: CGOomRunPluginConfig(TUint aPluginId, TGOomPluginType aPluginType); @@ -68,6 +72,8 @@ TInt iWaitAfterPlugin; // The period to wait after a plugin has been called TGOomPluginType iPluginType; + + TBool iSwRenderingSupported; }; #include "goomrunpluginconfig.inl" diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.inl --- a/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.inl Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.inl Mon May 03 13:22:43 2010 +0300 @@ -60,4 +60,13 @@ return iTargetAppId; } +inline void CGOomRunPluginConfig::SetSwRend(TBool aSwRend) + { + iSwRenderingSupported = aSwRend; + } + +inline TBool CGOomRunPluginConfig::IsSwRendSupported() + { + return iSwRenderingSupported; + } #endif /*GOOMRUNPLUGINCONFIGINL_H_*/ diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/inc/traceconfiguration.hrh --- a/uiacceltk/hitchcock/goommonitor/inc/traceconfiguration.hrh Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/inc/traceconfiguration.hrh Mon May 03 13:22:43 2010 +0300 @@ -25,11 +25,11 @@ // // just to make it easier to enable traces on rel builds also -#ifdef _DEBUG +//#ifdef _DEBUG #define _GOOM_DEBUG #define __GOOM_INFO_TRACE__ #define __GOOM_FUNC_TRACE__ -#endif +//#endif /** * Error trace enabled diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp Mon May 03 13:22:43 2010 +0300 @@ -380,7 +380,7 @@ iFreeingMemory = ETrue; TRACES2("CGOomActionList::FreeMemory: Running action %d which has priority %d", iCurrentActionIndex,ref.Priority()); - action->FreeMemory(iCurrentTarget - memoryEstimate); + action->FreeMemory(iCurrentTarget - memoryEstimate, iUseSwRendering); iCurrentPluginRun = 0; memoryFreeingActionRun = ETrue; @@ -414,6 +414,12 @@ } // ... otherwise continue running actions, don't wait for any existing ones to complete iCurrentActionIndex++; + + if (iCurrentActionIndex >= iActionRefs.Count()) + { + StateChanged(); + return; + } } @@ -742,3 +748,13 @@ { return iRunningKillAppActions; } + +void CGOomActionList::SetUseSwRendering(TBool aUseSwRendering) + { + iUseSwRendering = aUseSwRendering; + } + +TBool CGOomActionList::UseSwRendering() + { + return iUseSwRendering; + } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goomcloseapp.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomcloseapp.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomcloseapp.cpp Mon May 03 13:22:43 2010 +0300 @@ -38,7 +38,7 @@ // Close the application in order to free memory // Call the CGOomAction::MemoryFreed when it is done -void CGOomCloseApp::FreeMemory(TInt) +void CGOomCloseApp::FreeMemory(TInt, TBool) { FUNC_LOG; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp Mon May 03 13:22:43 2010 +0300 @@ -57,6 +57,7 @@ KGOomErrBadGoodThresholdValueForAppConfig, KGOomErrBadTargetFreeValueForAppConfig, KGOomErrBadSkipPluginValueForAppConfig, +KGOomErrBadUseSwRenderingValueForAppConfig, KGOomErrSystemPluginSettingsMustComeAfterAppCloseSettings, KGOomErrAppPluginSettingsMustComeAfterSystemPluginSettings, KGOomErrAppPluginIdleTimeRulesMustComeAfterAppPluginSettings, @@ -80,7 +81,8 @@ KGOomErrAppCloseIdleRuleOutsideAppCloseElement, KGOomErrForegroundAppRuleOutsideAppCloseElement, KGOomErrPluginIdleRuleOutsideAppPluginElement, -KGOomErrPluginForegroundRuleOutsidePluginElement +KGOomErrPluginForegroundRuleOutsidePluginElement, +KGOomErrInvalidSwRendConfig }; @@ -127,6 +129,9 @@ //App specific _LIT8(KGOomAttributeTargetFreeOnStartup, "target_free_on_startup"); _LIT8(KGOomAttributeSkipPlugin, "skip_plugin"); +_LIT8(KGOomAttributeUseSwRendering, "use_sw_rend"); +_LIT8(KGOomConfigUseSwRend, "Yes"); +_LIT8(KGOomConfigNotUseSwRend, "No"); // System plugins @@ -173,6 +178,10 @@ _LIT8(KGOomConfigBusyAppUid, "BUSY_APP"); _LIT8(KGOomConfigHighPriorityAppUid, "HIGH_PRIORITY_APP"); +_LIT8(KGOomAttibuteSwRend, "sw_rend"); +_LIT8(KGOomConfigSwRendSupported, "supported"); +_LIT8(KGOomConfigSwRendNotSupported, "not_supported"); + CGOomConfigParser::CGOomConfigParser(CGOomConfig& aConfig, RFs& aFs) : iConfig(aConfig), iFs(aFs), iState(EGOomParsingStateNone) { } @@ -501,7 +510,33 @@ ConfigError(KGOomErrBadSkipPluginValueForAppConfig); } - + // Get the software rendering config + if (err == KErrNone) + { + TPtrC8 swrendString; + TInt err = GetValueFromAttributeList(aAttributes, KGOomAttributeUseSwRendering, swrendString); + if (err == KErrNone) + { + if (swrendString == KGOomConfigUseSwRend) + { + TRACES1("Sw Rend configured for App %x", uid); + appConfig->iUseSwRendering = ETrue; + } + else + { + appConfig->iUseSwRendering = EFalse; + } + } + else if (err == KErrNotFound) + { + err = KErrNone; + appConfig->iUseSwRendering = EFalse; + } + + if (err != KErrNone) + ConfigError(KGOomErrBadUseSwRenderingValueForAppConfig); + } + // Add the applciation config to the main config if ((err == KErrNone) && (appConfig)) { @@ -772,8 +807,21 @@ { // Get the config for the sync mode for this plugin (if one is specified) and set it SetPluginSyncMode(aAttributes, *pluginConfig); + + TPtrC8 swrendString; + TInt err = GetValueFromAttributeList(aAttributes, KGOomAttibuteSwRend, swrendString); + if (err == KErrNone) + { + if (swrendString == KGOomConfigSwRendSupported) + pluginConfig->SetSwRend(ETrue); + else if (swrendString == KGOomConfigSwRendNotSupported) + pluginConfig->SetSwRend(EFalse); + else + ConfigError(KGOomErrInvalidSwRendConfig); + } + } - + iConfig.AddPluginConfigL(pluginConfig); CleanupStack::Pop(pluginConfig); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp Mon May 03 13:22:43 2010 +0300 @@ -231,7 +231,7 @@ TRACES1("FreeMemThresholdCrossedL : crossed low threshold %d", iLowThreshold); iMemAllocationsGrowing->Stop(); iMemAllocationsGoingDown->Continue(); - if(iTrigger == EGOomTriggerNone) + if((iTrigger == EGOomTriggerNone) && !NeedToPostponeMemGood() && !iSynchTimer->IsActive() ) StartFreeSomeRamL(iGoodThreshold, EGOomTriggerThresholdCrossed); } #endif @@ -251,9 +251,11 @@ // Refresh the low and good memory thresholds as they may have changed due to the new foreground application RefreshThresholds(aForegroundAppUid); - // Not very elegant, now we poll on each window group change - // Should have better trigger e.g. from window server - StartFreeSomeRamL(iCurrentTarget, EGOomTriggerFocusChanged); + + if(iCurrentTarget) + { + StartFreeSomeRamL(iCurrentTarget, EGOomTriggerFocusChanged); + } } void CMemoryMonitor::StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority, TGOomTrigger aTrigger) // The maximum priority of action to run @@ -275,14 +277,17 @@ if (freeMemoryAboveCurrentTarget) { - ResetTargets(); /*if(freeMemory >= iGoodThreshold && !NeedToPostponeMemGood()) { iGOomActionList->MemoryGood(); } */ - iServer->CloseAppsFinished(freeMemory, ETrue); - return; + if(!iGOomActionList->UseSwRendering()) + { + iServer->CloseAppsFinished(freeMemory, ETrue); + WaitAndSynchroniseMemoryState(); + return; + } } // update wg list only when actually about to use it @@ -379,11 +384,12 @@ // Calculate the desired good threshold, this could be the globally configured value... iGoodThreshold = CMemoryMonitor::GlobalConfig().iGoodRamThreshold; iLowThreshold = CMemoryMonitor::GlobalConfig().iLowRamThreshold; - if(iCurrentTarget < iLowThreshold) - iCurrentTarget = iLowThreshold; + //if(iCurrentTarget < iLowThreshold) + // iCurrentTarget = iLowThreshold; TRACES2("CMemoryMonitor::RefreshThresholds: Global Good Threshold = %d, Global Low Threshold = %d", iGoodThreshold, iLowThreshold); + TBool useSwRendering = EFalse; // The global value can be overridden by an app specific value // Find the application config entry for the foreground application if (aForegroundAppUid == KErrNotFound) @@ -412,7 +418,15 @@ TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Target Free on Startup = %d", aForegroundAppUid, iCurrentTarget); } + + if (iConfig->GetApplicationConfig(aForegroundAppUid).iUseSwRendering != KGOomThresholdUnset) + { + useSwRendering = iConfig->GetApplicationConfig(aForegroundAppUid).iUseSwRendering; + TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, UseSwRendering = %d", aForegroundAppUid, useSwRendering); + } + iGOomActionList->SetCurrentTarget(iCurrentTarget); + iGOomActionList->SetUseSwRendering(useSwRendering); #ifdef USE_ASYNCYH_NOTIFICATIONS @@ -467,7 +481,10 @@ iCurrentTarget = aTarget; iGOomActionList->SetCurrentTarget(iCurrentTarget); if(!aTarget) + { iTrigger = EGOomTriggerNone; //reset the trigger condition + } + iGOomActionList->SetUseSwRendering(EFalse); } void CMemoryMonitor::SetPriorityBusy(TInt aWgId) @@ -592,7 +609,17 @@ break; } case EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK: + { + TUint mem = prof_data[i]; + TRACES1("Private memory Usage by app is %d", mem); + break; + } case EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK: + { + TUint mem = prof_data[i]; + TRACES1("Shared memory Usage by app is %d", mem); + break; + } default: { i++; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goommonitorplugin.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goommonitorplugin.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goommonitorplugin.cpp Mon May 03 13:22:43 2010 +0300 @@ -101,12 +101,12 @@ { } -void CAppGOomMonitorPlugin::FreeRam(TInt) +void CAppGOomMonitorPlugin::FreeRam(TInt, TBool) { SendMessageToApp(KAppGOomMonitor_FreeRam); } -void CAppGOomMonitorPlugin::MemoryGood() +void CAppGOomMonitorPlugin::MemoryGood(TBool) { SendMessageToApp(KAppGOomMonitor_MemoryGood); } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goomrunplugin.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomrunplugin.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomrunplugin.cpp Mon May 03 13:22:43 2010 +0300 @@ -36,7 +36,7 @@ // Run the GOOM plugin in order to free memory // Call the CGOomAction::MemoryFreed when it is done -void CGOomRunPlugin::FreeMemory(TInt aBytesRequested) +void CGOomRunPlugin::FreeMemory(TInt aBytesRequested, TBool aUseSwRendering) { FUNC_LOG; TRACES1("CGOomRunPlugin::FreeMemory: iPluginId = 0x%x", iPluginId); @@ -47,12 +47,25 @@ TInt clientId = iStateChangeObserver.ClientId(); TAny* anyp = (TAny*) &clientId; iPlugin.ExtensionInterface(TUid::Uid(KGoomClientSecureId), anyp); - iPlugin.FreeRam(aBytesRequested); + + if(aUseSwRendering && iConfig.IsSwRendSupported()) + { + TInt flags = KGOomUseSwRendering; + iPlugin.FreeRam(aBytesRequested, flags); + iFreeMemoryWithSwRenderingCalled = ETrue; + } + else + { + iPlugin.FreeRam(aBytesRequested, 0); + } iFreeMemoryCalled = ETrue; // Wait for the required time before we signal completion. - iPluginWaiter->Start(); + if(iPluginWaiter) + { + iPluginWaiter->Start(); + } } // Call the memory good function on the plugin but... @@ -63,8 +76,12 @@ if (iFreeMemoryCalled) { - iPlugin.MemoryGood(); + TInt flags = 0; + if(iFreeMemoryWithSwRenderingCalled) + flags = KGOomUseSwRendering; + iPlugin.MemoryGood(flags); iFreeMemoryCalled = EFalse; + iFreeMemoryWithSwRenderingCalled = EFalse; } } @@ -86,13 +103,15 @@ TInt waitDuration = CMemoryMonitor::GlobalConfig().iDefaultWaitAfterPlugin; - if (aPluginConfig.WaitAfterPluginDefined()) + if(aPluginConfig.iSyncMode == ECheckRam) { - // If the wait duration for this plugin is overridden then use the overridden value - waitDuration = aPluginConfig.WaitAfterPlugin(); + if (aPluginConfig.WaitAfterPluginDefined()) + { + // If the wait duration for this plugin is overridden then use the overridden value + waitDuration = aPluginConfig.WaitAfterPlugin(); + } + iPluginWaiter = CGOomPluginWaiter::NewL(waitDuration, *this); } - - iPluginWaiter = CGOomPluginWaiter::NewL(waitDuration, *this); } TUint CGOomRunPlugin::Id() diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp --- a/uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp Mon May 03 13:22:43 2010 +0300 @@ -73,10 +73,14 @@ User::LeaveIfError(iAlfClient.Connect()); } iLowOnMemWgs.Reset(); - User::LeaveIfError(iAlfClient.GetListOfInactiveWindowGroupsWSurfaces(&iLowOnMemWgs)); + RArray inactiveSurfaces; - RArray& inactiveSurfaces = iLowOnMemWgs; + User::LeaveIfError(iAlfClient.GetListOfInactiveWindowGroupsWSurfaces(&inactiveSurfaces)); + User::LeaveIfError(iAlfClient.GetListOfWindowGroupsWSurfaces(&iLowOnMemWgs)); + TRACES1("Inactive surfaces count %d", inactiveSurfaces.Count()); + TRACES1("Windowgroups w/ surfaces count %d", iLowOnMemWgs.Count()); + RArray processIds; RArray privMemUsed; RArray sparedProcessIds; @@ -213,9 +217,9 @@ TWsEvent event; event.SetType(KGoomMemoryLowEvent); // naive - for (TInt i = inactiveSurfaces.Count()-1; i>=0; i--) + for (TInt i = iLowOnMemWgs.Count()-1; i>=0; i--) { - iWs.SendEventToWindowGroup(inactiveSurfaces[i], event); + iWs.SendEventToWindowGroup(iLowOnMemWgs[i], event); } #endif diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/group/core_exports.inc --- a/uiacceltk/hitchcock/group/core_exports.inc Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/group/core_exports.inc Mon May 03 13:22:43 2010 +0300 @@ -3,7 +3,7 @@ * Name : core_exports.inc * Part of : Alfred UI Toolkit * Description : Exported header files. -* Version : %version: tr1sido#8.1.33 % +* Version : %version: tr1sido#8.1.36 % * * Copyright © 2006-2007 Nokia. All rights reserved. * This material, including documentation and any related computer @@ -33,18 +33,23 @@ // for EMULATOR UREL ../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_add_page.fxml -../coretoolkit/data/activeidle_viewswitch_bg_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_bg_appear.fxml +../coretoolkit/data/activeidle_viewswitch_bg_anim_to_image.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_bg_anim_to_image.fxml +../coretoolkit/data/activeidle_viewswitch_bg_image_to_image.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_bg_image_to_image.fxml ../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_close_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left.fxml -../coretoolkit/data/activeidle_viewswitch_left_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_appear.fxml -../coretoolkit/data/activeidle_viewswitch_left_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_lsc.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_prt.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_lsc.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_prt.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left_disappear_prt.fxml ../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_open_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_remove_page.fxml ../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right.fxml -../coretoolkit/data/activeidle_viewswitch_right_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_appear.fxml -../coretoolkit/data/activeidle_viewswitch_right_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_lsc.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_prt.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_lsc.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_prt.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right_disappear_prt.fxml ../coretoolkit/data/app_activate.fxml /epoc32/release/winscw/urel/z/resource/effects/app_activate.fxml ../coretoolkit/data/app_exit.fxml /epoc32/release/winscw/urel/z/resource/effects/app_exit.fxml ../coretoolkit/data/app_start.fxml /epoc32/release/winscw/urel/z/resource/effects/app_start.fxml @@ -87,8 +92,8 @@ ../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/optionsmenu_disappear.fxml ../coretoolkit/data/photos_fullscreen_close.fxml /epoc32/release/winscw/urel/z/resource/effects/photos_fullscreen_close.fxml ../coretoolkit/data/photos_fullscreen_open.fxml /epoc32/release/winscw/urel/z/resource/effects/photos_fullscreen_open.fxml +../coretoolkit/data/photos_gridview_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/photos_gridview_appear.fxml ../coretoolkit/data/photos_gridview_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/photos_gridview_disappear.fxml -../coretoolkit/data/photos_gridview_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/photos_gridview_appear.fxml ../coretoolkit/data/popup_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_appear.fxml ../coretoolkit/data/popup_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_disappear.fxml ../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_disappear_screenshot.fxml @@ -100,7 +105,6 @@ ../coretoolkit/data/systemnotify_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/systemnotify_appear.fxml ../coretoolkit/data/systemnotify_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/systemnotify_disappear.fxml ../coretoolkit/data/tab_effect.fxml /epoc32/release/winscw/urel/z/resource/effects/tab_effect.fxml -../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_app_start_disappear.fxml ../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_app_start_rect.fxml ../coretoolkit/data/taskswapper_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_appear.fxml ../coretoolkit/data/taskswapper_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_disappear.fxml @@ -121,18 +125,23 @@ // for EMULATOR UDEB ../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_add_page.fxml -../coretoolkit/data/activeidle_viewswitch_bg_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_bg_appear.fxml +../coretoolkit/data/activeidle_viewswitch_bg_anim_to_image.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_bg_anim_to_image.fxml +../coretoolkit/data/activeidle_viewswitch_bg_image_to_image.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_bg_image_to_image.fxml ../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_close_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left.fxml -../coretoolkit/data/activeidle_viewswitch_left_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_appear.fxml -../coretoolkit/data/activeidle_viewswitch_left_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_lsc.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_prt.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_lsc.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_prt.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left_disappear_prt.fxml ../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_open_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_remove_page.fxml ../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right.fxml -../coretoolkit/data/activeidle_viewswitch_right_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_appear.fxml -../coretoolkit/data/activeidle_viewswitch_right_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_lsc.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_prt.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_lsc.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_prt.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right_disappear_prt.fxml ../coretoolkit/data/app_activate.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_activate.fxml ../coretoolkit/data/app_exit.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_exit.fxml ../coretoolkit/data/app_start.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_start.fxml @@ -173,10 +182,10 @@ ../coretoolkit/data/optionsmenu_cascade_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_cascade_appear.fxml ../coretoolkit/data/optionsmenu_cascade_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_cascade_disappear.fxml ../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_disappear.fxml +../coretoolkit/data/photos_fullscreen_close.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_fullscreen_close.fxml +../coretoolkit/data/photos_fullscreen_open.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_fullscreen_open.fxml ../coretoolkit/data/photos_gridview_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_gridview_appear.fxml ../coretoolkit/data/photos_gridview_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_gridview_disappear.fxml -../coretoolkit/data/photos_fullscreen_close.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_fullscreen_close.fxml -../coretoolkit/data/photos_fullscreen_open.fxml /epoc32/release/winscw/udeb/z/resource/effects/photos_fullscreen_open.fxml ../coretoolkit/data/popup_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_appear.fxml ../coretoolkit/data/popup_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_disappear.fxml ../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_disappear_screenshot.fxml @@ -188,7 +197,6 @@ ../coretoolkit/data/systemnotify_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/systemnotify_appear.fxml ../coretoolkit/data/systemnotify_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/systemnotify_disappear.fxml ../coretoolkit/data/tab_effect.fxml /epoc32/release/winscw/udeb/z/resource/effects/tab_effect.fxml -../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_app_start_disappear.fxml ../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_app_start_rect.fxml ../coretoolkit/data/taskswapper_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_appear.fxml ../coretoolkit/data/taskswapper_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_disappear.fxml @@ -209,18 +217,23 @@ // For ROM ../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_add_page.fxml -../coretoolkit/data/activeidle_viewswitch_bg_appear.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_bg_appear.fxml +../coretoolkit/data/activeidle_viewswitch_bg_anim_to_image.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_bg_anim_to_image.fxml +../coretoolkit/data/activeidle_viewswitch_bg_image_to_image.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_bg_image_to_image.fxml ../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_close_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left.fxml -../coretoolkit/data/activeidle_viewswitch_left_appear.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_appear.fxml -../coretoolkit/data/activeidle_viewswitch_left_disappear.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_lsc.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_appear_prt.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_lsc.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_left_disappear_prt.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left_disappear_prt.fxml ../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_open_editmode.fxml ../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml ../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_remove_page.fxml ../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right.fxml -../coretoolkit/data/activeidle_viewswitch_right_appear.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_appear.fxml -../coretoolkit/data/activeidle_viewswitch_right_disappear.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_disappear.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_lsc.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_appear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_appear_prt.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_appear_prt.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_lsc.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_disappear_lsc.fxml +../coretoolkit/data/activeidle_viewswitch_right_disappear_prt.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right_disappear_prt.fxml ../coretoolkit/data/app_activate.fxml /epoc32/data/z/resource/effects/app_activate.fxml ../coretoolkit/data/app_exit.fxml /epoc32/data/z/resource/effects/app_exit.fxml ../coretoolkit/data/app_start.fxml /epoc32/data/z/resource/effects/app_start.fxml @@ -261,10 +274,10 @@ ../coretoolkit/data/optionsmenu_cascade_appear.fxml /epoc32/data/z/resource/effects/optionsmenu_cascade_appear.fxml ../coretoolkit/data/optionsmenu_cascade_disappear.fxml /epoc32/data/z/resource/effects/optionsmenu_cascade_disappear.fxml ../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/data/z/resource/effects/optionsmenu_disappear.fxml +../coretoolkit/data/photos_fullscreen_close.fxml /epoc32/data/z/resource/effects/photos_fullscreen_close.fxml +../coretoolkit/data/photos_fullscreen_open.fxml /epoc32/data/z/resource/effects/photos_fullscreen_open.fxml ../coretoolkit/data/photos_gridview_appear.fxml /epoc32/data/z/resource/effects/photos_gridview_appear.fxml ../coretoolkit/data/photos_gridview_disappear.fxml /epoc32/data/z/resource/effects/photos_gridview_disappear.fxml -../coretoolkit/data/photos_fullscreen_close.fxml /epoc32/data/z/resource/effects/photos_fullscreen_close.fxml -../coretoolkit/data/photos_fullscreen_open.fxml /epoc32/data/z/resource/effects/photos_fullscreen_open.fxml ../coretoolkit/data/popup_appear.fxml /epoc32/data/z/resource/effects/popup_appear.fxml ../coretoolkit/data/popup_disappear.fxml /epoc32/data/z/resource/effects/popup_disappear.fxml ../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/data/z/resource/effects/popup_disappear_screenshot.fxml @@ -276,7 +289,6 @@ ../coretoolkit/data/systemnotify_appear.fxml /epoc32/data/z/resource/effects/systemnotify_appear.fxml ../coretoolkit/data/systemnotify_disappear.fxml /epoc32/data/z/resource/effects/systemnotify_disappear.fxml ../coretoolkit/data/tab_effect.fxml /epoc32/data/z/resource/effects/tab_effect.fxml -../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/data/z/resource/effects/taskswapper_app_start_disappear.fxml ../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/data/z/resource/effects/taskswapper_app_start_rect.fxml ../coretoolkit/data/taskswapper_appear.fxml /epoc32/data/z/resource/effects/taskswapper_appear.fxml ../coretoolkit/data/taskswapper_disappear.fxml /epoc32/data/z/resource/effects/taskswapper_disappear.fxml diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp --- a/uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp Mon May 03 13:22:43 2010 +0300 @@ -30,8 +30,8 @@ void ConstructL(); public: - void FreeRam(TInt aBytesToFree); - void MemoryGood(); + void FreeRam(TInt aBytesToFree, TInt aFlags); + void MemoryGood(TInt aFlags); private: RAlfDirectClient iAlfDirectClient; @@ -68,18 +68,20 @@ // Tries to free RAM. // ----------------------------------------------------------------------------- // -void CAlfOogmMonitorPlugin::FreeRam(TInt aBytesToFree) +void CAlfOogmMonitorPlugin::FreeRam(TInt aBytesToFree, TInt aFlags) { - iAlfDirectClient.EnableLowMemoryState(aBytesToFree); + TBool useSwRend = aFlags & KGOomUseSwRendering; + iAlfDirectClient.EnableLowMemoryState(aBytesToFree, useSwRend); } // ----------------------------------------------------------------------------- // CAlfOogmMonitorPlugin::MemoryGood // ----------------------------------------------------------------------------- // -void CAlfOogmMonitorPlugin::MemoryGood() +void CAlfOogmMonitorPlugin::MemoryGood(TInt aFlags) { - iAlfDirectClient.EnableLowMemoryState(EFalse); + TBool useSwRend = aFlags & KGOomUseSwRendering; + iAlfDirectClient.EnableLowMemoryState(EFalse, useSwRend); } // ----------------------------------------------------------------------------- diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/src/gfxtransenginetfx.cpp --- a/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/src/gfxtransenginetfx.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/src/gfxtransenginetfx.cpp Mon May 03 13:22:43 2010 +0300 @@ -145,6 +145,17 @@ void IssueReq(); inline TType Type(); + TPtr8** InBuf() { return &iInPtr; } + TPtr8** OutBuf() { return &iOutPtr; } + + void ResetBufs() + { + delete iInPtr; + iInPtr = 0; + delete iOutPtr; + iOutPtr = 0; + } + private: void RunL(); void DoCancel(); @@ -153,7 +164,8 @@ MTfxServerObserver* iOwner; CGfxTransAdapterTfx* iParent; TType iType; - + TPtr8* iInPtr; + TPtr8* iOutPtr; }; // --------------------------------------------------------------------------- @@ -175,6 +187,7 @@ { __ALFFXLOGSTRING("CAlfTransitionRequest - cancelling and deleting policy request" ); Cancel(); + ResetBufs(); } // --------------------------------------------------------------------------- @@ -182,6 +195,8 @@ // void CAlfTransitionRequest::RunL() { + ResetBufs(); + if ( iStatus.Int() == KErrCancel ) { // If the request was cancelled, we are done @@ -456,12 +471,11 @@ case EPreBeginCapture: break; case EPostBeginCapture: - // If we get KGfxControlAppearAction, it is followed by StartTransition, - // but disappear action is not. Therefore we must handle it byself - // We use begin capture as trigger, as we assume that the control is still present - // at that time. After EPostBeginCapture it will probably be already gone. - // If we don't have plugin yet, there will be no transitions. - if ( action == KGfxControlDisappearAction && iHasPlugin && aKey && aKey->DrawableWindow()) + // Send control effect request to ALf. This is done immediately after call of + // GfxTransEffect::Begin(). This makes it possible (NOT QUARANTEENED) + // that effect request arrives to Alf before possible visiblity changes are made to + // the control. + if ( iHasPlugin && aKey && aKey->DrawableWindow()) { // We must generate our own transition as we won't be sending // iClient->TransitionFinished back. @@ -743,15 +757,7 @@ if( err == KErrNone ) { - if ( transdata->iAction != KGfxControlDisappearAction ) - { - // Disappear action was started by EPostBeginCapture event - TRAP( err, DoStartTransitionL( aHandle, transdata ) ); - } - else - { - __ALFFXLOGSTRING( "CGfxTransAdapterTfx::StartTransition called for disappear action" ); - } + __ALFFXLOGSTRING( "CGfxTransAdapterTfx::StartTransition called for disappear action. Do nothing." ); } // always finish the caller @@ -885,6 +891,7 @@ if ( iCachedUidMapping.iWindowGroupId > 0 ) { result = iCachedUidMapping.iWindowGroupId; + iCachedUidMapping.iSecureId = 0; found = true; } } @@ -1264,7 +1271,7 @@ void CGfxTransAdapterTfx::GenerateTransitionL( const CCoeControl* aKey, const CTransitionData* aTransData) { - __ALFFXLOGSTRING("CGfxTransAdapterTfx::GenerateTransitionL >>"); + // We generate a transition call from begin capture for control exit transitions TPtr8 inPtr = iTransferBuffer->Des(); inPtr.Zero(); @@ -1275,6 +1282,13 @@ TInt windowGroup = aKey->DrawableWindow()->WindowGroupId(); TInt windowHandle = aKey->DrawableWindow()->ClientHandle(); + __ALFFXLOGSTRING4("CGfxTransAdapterTfx::GenerateTransitionL - Operation: MAlfGfxEffectPlugin::EBeginComponentTransition Action: %d, Uid: 0x%x, WindowGroup: %d, WindowHandle: %d >>", + aTransData->iAction, + aTransData->iUid.iUid, + windowGroup, + windowHandle + ); + inBuf.WriteInt32L( op ); inBuf.WriteUint32L( aTransData->iAction ); inBuf.WriteInt32L( aTransData->iUid.iUid ); @@ -1373,10 +1387,15 @@ // send a request to plugin to start sending us policy updates // This is an asynchronous request + iPolicyReq->ResetBufs(); - TPtr8 inPtr = iAsyncTransferBuffer->Des(); + *(iPolicyReq->InBuf())= new (ELeave) TPtr8(iAsyncTransferBuffer->Des()); + TPtr8& inPtr = **iPolicyReq->InBuf(); inPtr.Zero(); - TPtr8 outPtr = iAsyncReturnBuffer->Des(); + + *(iPolicyReq->OutBuf())= new (ELeave) TPtr8(iAsyncReturnBuffer->Des()); + TPtr8& outPtr = **iPolicyReq->OutBuf(); + outPtr.Zero(); RDesWriteStream inBuf( inPtr ); TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlPolicyRequest; @@ -1393,9 +1412,6 @@ __ALFFXLOGSTRING( "CGfxTransAdapterTfx::RequestPolicyUpdates" ); iTfxServer.SendAsynchronousData( iPluginImplementation, inPtr, outPtr, iPolicyReq->iStatus ); iPolicyReq->IssueReq(); - // clear out used data - inPtr.Zero(); - outPtr.Zero(); __ALFFXLOGSTRING("CGfxTransAdapterTfx::RequestPolicyUpdates <<"); return KErrNone; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h --- a/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h Mon May 03 13:22:43 2010 +0300 @@ -110,6 +110,7 @@ void DoSendBeginFullscreenL(); TInt SendBeginControlTransition(); TInt SendFinishControlTransition(); + TInt DoSendFinishControlTransition(TInt aHandle); TBool EffectFinishedFullScreen() const; @@ -203,6 +204,8 @@ RFs iFs; TBool iFullScreenFxSent; TBool iFullScreenEndSent; + + RArray iActiveControlFx; }; diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfgfxeffects.cpp --- a/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfgfxeffects.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfgfxeffects.cpp Mon May 03 13:22:43 2010 +0300 @@ -250,6 +250,13 @@ #endif uid1 = TUid::Uid( inStream.ReadInt32L() ); + // hack to keep disapear viewswitch transitions popping on top of everything + // TODO: Remove when HS complies + if ((uid1.iUid == 0x102750F1 || uid1.iUid == 0x102750F2 ) && action == 4) + { + action = 5; + } + TInt windowGroup = inStream.ReadInt32L(); TInt windowHandle = inStream.ReadInt32L(); TBool nLayered = inStream.ReadInt32L(); diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfserverdrawer.cpp --- a/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfserverdrawer.cpp Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfserverdrawer.cpp Mon May 03 13:22:43 2010 +0300 @@ -41,6 +41,7 @@ // this will stop the effect. const TInt KAlfShortEffectTimeout = 4000000; const TInt KAlfLongEffectTimeout = 5000000; +const TInt KAlfActiveControlFxGranularity = 4; //const TInt KAlfLongEffectTimeout = 500000; // Timer to send finish full screen effect @@ -237,7 +238,6 @@ iProperty.Attach( KPSAlfDomain, KAlfTransitionStatus ); iProperty.Set( KPSAlfDomain, KAlfTransitionStatus, 0 ); iFs.Connect(); - } // --------------------------------------------------------------------------- @@ -246,7 +246,8 @@ CAlfServerDrawer::CAlfServerDrawer( CAlfWindowManager* aWindowManager, CPolicyHandler& aPolicyHandler ): iWindowManager( aWindowManager ), - iPolicyHandler( aPolicyHandler ) + iPolicyHandler( aPolicyHandler ), + iActiveControlFx( KAlfActiveControlFxGranularity ) { iScrModeChangedState = EScreenModeChangedIdle; } @@ -264,7 +265,7 @@ delete iFullScreenController; delete iFinishFullScreen; delete iFullScreenTimeout; - + iActiveControlFx.Close(); } // --------------------------------------------------------------------------- @@ -663,7 +664,7 @@ RMemWriteStream stream( bridgeBuffer, bufferSize ); // The writes should not leave if we have calculated our buffer length correctly. stream.WriteInt32L( MAlfGfxEffectPlugin::EBeginFullscreen ); - stream.WriteInt32L( iCurrentFullScreenHandle ); + stream.WriteInt32L( iToSid.iId ); //iCurrentFullScreenHandle ); stream.WriteInt32L( iType ); if ( iType == AknTransEffect::EParameterType && isExit ) { @@ -1053,7 +1054,7 @@ TRAP_IGNORE( { stream.WriteInt32L( MAlfGfxEffectPlugin::EBeginComponentTransition ); - stream.WriteInt32L( iCurrentControlHandle ); + stream.WriteInt32L( iControlHandle ); //iCurrentControlHandle ); stream.WriteInt32L( iControlHandle ); // window handle stream.WriteInt32L( iControlWindowGroup ); // window group id stream.WriteInt32L( 0 ); // "screen number"; not used; save place for future @@ -1065,10 +1066,15 @@ stream.CommitL(); }); bridgerData.Set( EAlfControlEffectFx, iControlAction, bufferSize, (TAny*) index ); - __ALFFXLOGSTRING1("CAlfServerDrawer::SendBeginControlTransition - sending bridgedata, Current handle: %d", iCurrentControlHandle); + __ALFFXLOGSTRING1("CAlfServerDrawer::SendBeginControlTransition - sending bridgedata, Current handle: %d", iControlHandle) iWindowManager->PostIt( bridgerData ); stream.Close(); - iControlTransitionEndObserver->StartObserving( TCallBack( ControlTransitionFinished, this ), iCurrentControlHandle ); + iControlTransitionEndObserver->StartObserving( TCallBack( ControlTransitionFinished, this ), iControlHandle ); + + if ( iActiveControlFx.Find( iControlHandle ) == KErrNotFound ) + { + iActiveControlFx.Append( iControlHandle ); + } } iFullScreenFinished = EFalse; @@ -1086,7 +1092,24 @@ // We should now delete the effects from any controls that remain active. __ALFFXLOGSTRING("CAlfServerDrawer::SendFinishControlTransition >>"); iControlTransitionEndObserver->Cancel(); - + + while ( iActiveControlFx.Count() ) + { + TInt handle = iActiveControlFx[ iActiveControlFx.Count() - 1 ]; + iActiveControlFx.Remove( iActiveControlFx.Count() - 1 ); + DoSendFinishControlTransition( handle ); + } + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CAlfServerDrawer::DoSendFinishControlTransition(TInt aHandle) + { + __ALFFXLOGSTRING1("CAlfServerDrawer::DoSendFinishControlTransition %d >>", aHandle) + // Send the data to CAlfAppUI via bridge TAlfBridgerData bridgerData; @@ -1106,7 +1129,7 @@ TRAP_IGNORE( { stream.WriteInt32L( MAlfGfxEffectPlugin::EAbortComponentTransition ); - stream.WriteInt32L( iCurrentControlHandle ); + stream.WriteInt32L( aHandle ); stream.WriteInt32L( 0 ); stream.WriteInt32L( 0 ); stream.WriteInt32L( 0 ); @@ -1114,12 +1137,12 @@ stream.CommitL(); }); // TODO, check, if iCurrentHandle is approriate - bridgerData.Set( EAlfStopControlEffectFx, iCurrentControlHandle, bufferSize, (TAny*) index ); - __ALFFXLOGSTRING1("CAlfServerDrawer::sending bridgedata, Stop control handle: %d", iCurrentControlHandle); + bridgerData.Set( EAlfStopControlEffectFx, aHandle, bufferSize, (TAny*) index ); + __ALFFXLOGSTRING1("CAlfServerDrawer::sending bridgedata, Stop control handle: %d", aHandle); iWindowManager->PostIt( bridgerData ); stream.Close(); } - __ALFFXLOGSTRING("CAlfServerDrawer::SendFinishControlTransition <<"); + __ALFFXLOGSTRING("CAlfServerDrawer::DoSendFinishControlTransition <<") return KErrNone; } diff -r 83d2d132aa58 -r f5bac0badc7e uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h --- a/uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h Fri Apr 16 15:56:24 2010 +0300 +++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h Mon May 03 13:22:43 2010 +0300 @@ -17,8 +17,6 @@ #define __SCREENCAPTURERENDERSTAGE_H__ #include -#include -#include #include #include #include