# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1268984601 -7200 # Node ID 8f67d927ea57a2936c49fe2f6e000e2f4cf080f2 # Parent 15bf7259bb7cf5ea7d68cd888203eff7752695f7 Revision: 201007 Kit: 201011 diff -r 15bf7259bb7c -r 8f67d927ea57 rom/alfred.iby --- a/rom/alfred.iby Tue Feb 02 07:56:43 2010 +0200 +++ b/rom/alfred.iby Fri Mar 19 09:43:21 2010 +0200 @@ -51,6 +51,7 @@ file=ABI_DIR\BUILD_DIR\alfhintplugin.dll SHARED_LIB_DIR\alfhintplugin.dll ECOM_PLUGIN(alfoogmplugin.dll, alfoogmplugin.RSC) +ECOM_PLUGIN(alfcrpplugin.dll, alfcrpplugin.RSC) data=DATAZ_\ECOM_RESOURCE_DIR\alfnonsupportedwscommands.rsc ECOM_RESOURCE_DIR\alfnonsupportedwscommands.rsc @@ -115,6 +116,10 @@ data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_popup_disappear.fxml RESOURCE_FILES_DIR/effects/musicplayer_popup_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_in.fxml RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_in.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_out.fxml RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_out.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/notificationwidget_appear.fxml RESOURCE_FILES_DIR/effects/notificationwidget_appear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/notificationwidget_dd_appear.fxml RESOURCE_FILES_DIR/effects/notificationwidget_dd_appear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/notificationwidget_dd_disappear.fxml RESOURCE_FILES_DIR/effects/notificationwidget_dd_disappear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/notificationwidget_disappear.fxml RESOURCE_FILES_DIR/effects/notificationwidget_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_appear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_appear.fxml 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 @@ -126,6 +131,7 @@ data=DATAZ_/RESOURCE_FILES_DIR/effects/preview_popup_disappear.fxml RESOURCE_FILES_DIR/effects/preview_popup_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/screensaver_activate.fxml RESOURCE_FILES_DIR/effects/screensaver_activate.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/screensaver_deactivate.fxml RESOURCE_FILES_DIR/effects/screensaver_deactivate.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/skinchange.fxml RESOURCE_FILES_DIR/effects/skinchange.fxml 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 @@ -133,6 +139,8 @@ 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 +data=DATAZ_/RESOURCE_FILES_DIR/effects/toolbar_ext_appear.fxml RESOURCE_FILES_DIR/effects/toolbar_ext_appear.fxml +data=DATAZ_/RESOURCE_FILES_DIR/effects/toolbar_ext_disappear.fxml RESOURCE_FILES_DIR/effects/toolbar_ext_disappear.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/touchinput_close.fxml RESOURCE_FILES_DIR/effects/touchinput_close.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/touchinput_open.fxml RESOURCE_FILES_DIR/effects/touchinput_open.fxml data=DATAZ_/RESOURCE_FILES_DIR/effects/waitnote_appear.fxml RESOURCE_FILES_DIR/effects/waitnote_appear.fxml diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h --- a/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h Fri Mar 19 09:43:21 2010 +0200 @@ -196,6 +196,7 @@ void SetAlfWindowGroupId(TInt aWgId); void NotifyLowMemory(TInt aAmountOfFreeMemRequested); TInt ForceSwRendering(TBool aEnabled); + void SetAlfAppWindowGroup( TInt aID ); private: diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h Fri Mar 19 09:43:21 2010 +0200 @@ -399,10 +399,13 @@ public: IMPORT_C void StoreRenderBufferL(); - void DrawStoredVisualRenderBuffer() const; - void DrawStoredFullScreenRenderBuffer(CHuiGc& aGc) const; + void DrawStoredVisualRenderBuffer(TInt aCanvasDrawMode) const; + void DrawStoredFullScreenRenderBuffer(TInt aCanvasDrawMode, CHuiGc& aGc) const; IMPORT_C void FreeRenderBuffer(); - + +protected: + virtual void VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams); + private: THuiCanvasPaintedArea CanvasPaintedArea(TInt aIndex) const; @@ -411,6 +414,15 @@ void DrawCanvasChildren(CHuiGc& aGc, TInt aIncludeCanvasFlags, TInt aExcludeCanvasFlags) const; TBool ChildTreeChanged(TInt aExcludeCanvasFlags) const; + static TBool RecursiveChildTreeChanged(CHuiVisual* aVisual, TInt aExcludeCanvasFlags); + static TBool RecursiveIsExternalContentDrawingEnabled(CHuiVisual* aVisual); + static TBool RecursiveHasCommandBuffers(CHuiVisual* aVisual); + + void CollectPaintedRegion(TRegion& aRecursivePaintRegion, TInt aExcludeCanvasFlags) const; + void CollectRecursivePaintedRegion(TRegion& aRecursivePaintRegion, TInt aExcludeCanvasFlags) const; + + TBool CanSkipDrawing() const; + private: struct THuiCanvasVisualData; diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControlGroup.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControlGroup.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControlGroup.h Fri Mar 19 09:43:21 2010 +0200 @@ -247,7 +247,8 @@ * elements. */ THuiTimedValue iOpacity; - + TBool iAlfApp; + }; #endif // __HUICONTROLGROUP_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplay.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplay.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplay.h Fri Mar 19 09:43:21 2010 +0200 @@ -677,7 +677,7 @@ * * @return Pointer to native window, or NULL. */ - RDrawableWindow* NativeWindow(); + IMPORT_C RDrawableWindow* NativeWindow(); /** * Returns the rendering surface of the display. @@ -805,9 +805,20 @@ */ IMPORT_C CFbsBitmap* ForegroundBitmap() const; + private: /** + * Uploads foreground bitmap to texture. + */ + void UpdateForegroundTexture(const TRect& aRect); + + /** + * Actual upload foreground bitmap to texture. + */ + void DoUpdateForegroundTextureL(const TRect& aRect); + + /** * Draws foreground texture. */ void DrawForegroundTexture(); diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEnv.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEnv.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEnv.h Fri Mar 19 09:43:21 2010 +0200 @@ -51,6 +51,7 @@ class CHuiThemeManager; class CHuiCanvasTextureCache; class CHuiFxEngine; +class MHuiSynchronizationObserver; class CHighResTimer; const TInt KHuiEnvReleasedActionId = 0x200100F8; @@ -759,6 +760,20 @@ CHuiCanvasTextureCache& CanvasTextureCache() const; + /** + * Performs drawing synchronization. + * @internal + * @param aId identifier. + * @param aObserver observer to be informed of completion. + */ + IMPORT_C void Synchronize(TInt aId, MHuiSynchronizationObserver* aObserver); + + /** + * Removes the controlgroup + * @param aId identifier. + + */ + void RemoveTheControlGroup(TInt aId); public: /* Implementaton of MHuiTextureLoadingCompletedObserver: */ @@ -988,6 +1003,10 @@ IMPORT_C void NotifyMemoryLevel(THuiMemoryLevel aMemoryLevel); IMPORT_C THuiMemoryLevel MemoryLevel(); + void DoSynchronize(); +private: + MHuiSynchronizationObserver* iSynchObserver; + TInt iSynchId; }; #endif // __HUIENV_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGc.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGc.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGc.h Fri Mar 19 09:43:21 2010 +0200 @@ -421,6 +421,11 @@ IMPORT_C virtual void SetDimmingFog(const TRgb& aColor, TReal32 aAmount) __SOFTFP = 0; /** + * Clear rect using the current pen color + */ + IMPORT_C virtual void Clear(const TRect& aRect) = 0; + + /** * Clear using the current pen color. */ IMPORT_C virtual void Clear() = 0; @@ -938,12 +943,12 @@ IMPORT_C CHuiGc(); /* Methods. */ - + /** * Determines the projection viewport. */ IMPORT_C TRect ProjectionViewport() const; - + /** * Determines the display area not affected by orientation. */ diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiS60Skin.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiS60Skin.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiS60Skin.h Fri Mar 19 09:43:21 2010 +0200 @@ -57,12 +57,12 @@ /* Methods from MAknsSkinChangeObserver */ - void SkinContentChanged(); + IMPORT_C void SkinContentChanged(); - void SkinConfigurationChanged( + IMPORT_C void SkinConfigurationChanged( const TAknsSkinStatusConfigurationChangeReason aReason ); - void SkinPackageChanged( + IMPORT_C void SkinPackageChanged( const TAknsSkinStatusPackageChangeReason aReason ); public: @@ -127,6 +127,9 @@ } void UpdateBackgroundsL(const RArray& aItems); IMPORT_C CHuiTexture* BackgroundTexture(const TAknsItemID& aID); + + TRect SkinRect(const TAknsItemID& aID); + protected: // from CHuiSkin IMPORT_C void SkinExtension(const TUid& aExtensionUid, TAny** aExtensionParameters); void FreeBackgrounds(); @@ -143,6 +146,7 @@ */ void UpdateBackgroundL(); + private: /** Control context for the skin. */ @@ -150,6 +154,8 @@ /** Background texture from S60. */ CHuiTexture* iBackgroundTexture; + CFbsBitmap* iBackgroundBitmap; + TRect iBackgroundRect; /** To get CallBack from SkinServer when skin is changed */ RAknsSrvSession iSkinSrvSession; @@ -158,8 +164,29 @@ /** Background should be reloaded the next time it is needed. */ TBool iReloadBackground; TBool iSkinChanged; - CFbsBitmap* iBackgroundBitmap; + + class CSkinItem : public CBase + { + public : + + ~CSkinItem() + { + delete iBitmap; + }; + TAknsItemID iId; + TRect iSkinRect; + CFbsBitmap* iBitmap; + }; + RPointerArray iCachedSkinItems; + TAny* iSpare; - }; + +private: // helpers + + TInt SearchCachedSkinItemIndex(const TAknsItemID& aId); + TRect SearchCachedSkinItemRect(const TAknsItemID& aId); + CFbsBitmap* SearchCachedSkinItemBitmap(const TAknsItemID& aId); + }; + #endif // __HUIS60SKIN_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedValue.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedValue.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedValue.h Fri Mar 19 09:43:21 2010 +0200 @@ -451,6 +451,7 @@ private: TInt iTimeRemainingWhenSuspended; TInt iSpare2; + friend class CHuiVisual; }; diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h --- a/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h Fri Mar 19 09:43:21 2010 +0200 @@ -195,7 +195,8 @@ EHuiVisualFlagShouldBeUnderOpaqueHint = 0x20000000, EHuiVisualFlagShouldBeShown = 0x40000000, - + // visual that is used only by wserv + EHuiVisualFlagWserv = 0x80000000, EHuiVisualFlagLast = 0xFFFFFFFF }; @@ -1443,6 +1444,24 @@ { iLoadingEffect = aLoading; }; + + /** + * Queries canvas flags of the visual, returns result + * @internal + */ + TInt QueryCanvasFlags(); + + /** + * Checks if external content drawing is enabled for this visual, returns result + * @internal + */ + TBool QueryExternalContentDrawingEnabled(); + + /** + * Checks if visual has something to draw, returns result + * @internal + */ + TBool QueryHasDrawableContent(); protected: diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_visual_api/group/bld.inf --- a/uiaccelerator_plat/alf_visual_api/group/bld.inf Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_visual_api/group/bld.inf Fri Mar 19 09:43:21 2010 +0200 @@ -100,4 +100,6 @@ ../inc/goommonitor/goommonitorplugin.hrh MW_LAYER_PLATFORM_EXPORT_PATH(goommonitorplugin.hrh) ../inc/alf/alfcompositionclient.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcompositionclient.h) -../inc/alf/alfcompositionutility.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcompositionutility.h) \ No newline at end of file +../inc/alf/alfcompositionutility.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcompositionutility.h) + +../inc/alf/alfdrawer.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdrawer.h) diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_visual_api/inc/alf/alfdrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdrawer.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,59 @@ +/* +* 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: +* +*/ +#ifndef __ALFDRAWER_H__ +#define __ALFDRAWER_H__ + +#include + +/** + * This provides additional alf drawing synchronization. + * + * This class requires application environment (CCoeEnv) to exist. + */ +NONSHARABLE_CLASS( CAlfDrawer ) : public CBase + { +public: + /** + * Creates new CAlfDrawer instance. + * @return newly created instance. + */ + IMPORT_C static CAlfDrawer* NewL(); + + /** + * Destructor. + */ + IMPORT_C ~CAlfDrawer(); + +public: + /** + * Finishes drawing. + * This will perform similar operation as RWsSession::Finish + * and then wait for all pending drawing to be finished. + * @return error code, KErrNone upon success. + */ + IMPORT_C TInt Finish(); + +private: + CAlfDrawer(); + void ConstructL(); + +private: + struct TAlfDrawerData; + TAlfDrawerData* iData; + }; + +#endif // __ALFDRAWER_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorsession.h --- a/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorsession.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorsession.h Fri Mar 19 09:43:21 2010 +0200 @@ -169,6 +169,11 @@ * @param aAppUid application UID being started. */ IMPORT_C void AppAboutToStart(TRequestStatus& aStatus, const TUid& aAppUid); + + /** + * Notify the GOOM monitor that this application has finished allocating memory. + */ + IMPORT_C void MemoryAllocationsComplete(); private://data TInt iFlags; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp --- a/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -44,7 +44,9 @@ { return err; } - + + User::SetCritical(User::ESystemCritical); // reset the device if we die + // create CCleanup CTrapCleanup * cleanup = CTrapCleanup::New(); if (cleanup) @@ -92,8 +94,8 @@ KAlfServerThreadName, AlfThreadFucntion, 16384, // magic - 20000, // uses own heap for now - 10000000, + 4*1024*1024, // uses own heap for now + 10*1024*1024, 0, EOwnerThread)); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/group/alfnonsupportedwscommands.rss --- a/uiacceltk/hitchcock/AlfRenderStage/group/alfnonsupportedwscommands.rss Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfnonsupportedwscommands.rss Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstage.rss --- a/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstage.rss Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstage.rss Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstageplugin.mmp --- a/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstageplugin.mmp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstageplugin.mmp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/group/bld.inf --- a/uiacceltk/hitchcock/AlfRenderStage/group/bld.inf Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/group/bld.inf Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/inc/alfasynchgoomsession.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfasynchgoomsession.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfasynchgoomsession.h Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstage.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstage.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstage.h Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" @@ -20,6 +20,9 @@ #ifndef __ALFRENDERSTAGE_H__ #define __ALFRENDERSTAGE_H__ +#define AMT_CONTROL() static_cast(Dll::Tls()) +#include "alfmoduletest.h" + #include #include #include "alfrsgc.h" @@ -55,7 +58,8 @@ public MWsTextCursor, public MAlfCompositionAgnosticWindowTreeObserver, public MAlfHintObserver, - public MWsDrawAnnotationObserver + public MWsDrawAnnotationObserver, + public MAlfSynchronizationInterface { public: @@ -146,6 +150,10 @@ void WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode); void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded); +public: // from MAlfSynchronizationInterface + + TInt Synchronize(TInt& aId); + public: // from MWsDrawAnnotationObserver void WindowRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion); void WindowRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode); @@ -295,7 +303,9 @@ }; // Sprite flash setting for iSpriteRedraw TSpriteFlash iSpriteRedrawFlash; - + + // Synchronization identifier. + TInt iSyncId; }; #endif //__ALFRENDERSTAGE_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstagefactory.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstagefactory.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstagefactory.h Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/inc/alfrsgc.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfrsgc.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrsgc.h Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h --- a/uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" @@ -374,6 +374,12 @@ * @return Previous command */ inline TInt PreviousCommand(){ return iPreviousCommand; } + + /** + * Synchronize. + * @param aId id to pass forward. + */ + void Synchronize(TInt aId); public: // From CActive diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfasynchgoomsession.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfasynchgoomsession.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfasynchgoomsession.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" @@ -71,7 +71,15 @@ delete iWsGraphicsContext; delete iGoomSession; - // Used just as a temporary holding place, do not delete! + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + if (Dll::Tls()!=NULL) + { + delete AMT_CONTROL(); + Dll::FreeTls(); + } + #endif + + // Used just as a temporary holding place, do not delete! iWindowDrawingNode = NULL; } @@ -109,6 +117,15 @@ compcntrl->AlfBridgeCallback(MAlfBridge::ESetWindowTreeObserver,(MAlfCompositionAgnosticWindowTreeObserver*)this); } + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // Setup TLS and open global module testing chunk and mutex + if (Dll::Tls()==NULL) // create only for the first render stage! + { + User::LeaveIfError(Dll::SetTls(new(ELeave) CAlfModuleTestDataControl())); + User::LeaveIfError(AMT_CONTROL()->OpenGlobalObjects()); + } + #endif + __ALFLOGSTRING("CAlfRenderStage: ready to rock"); } @@ -140,6 +157,8 @@ case MWsDrawAnnotationObserver::EWsObjectInterfaceId: return static_cast(this); + case KAlfSynchronizationInterfaceUid: + return static_cast(this); default: return CWsRenderStage::ResolveObjectInterface(aTypeId); } @@ -164,6 +183,22 @@ } // --------------------------------------------------------------------------- +// Synchronize +// --------------------------------------------------------------------------- +// +TInt CAlfRenderStage::Synchronize(TInt& aId) + { + if ( iAlfSendBuffer ) + { + ++iSyncId; + aId = iSyncId; + iAlfSendBuffer->Synchronize(iSyncId); + return KErrNone; + } + return KErrGeneral; + } + +// --------------------------------------------------------------------------- // End // --------------------------------------------------------------------------- // @@ -330,17 +365,46 @@ drawRegion.AddRect( aExtent ); TRegionFix<1> clipRegion; clipRegion.AddRect( aClipRect ); - + + TRgb penColor = TRgb(0x555555); + TRgb brushColor = TRgb(0x555555); + TRgb dotColor = TRgb(0xBBBBBB); + WindowRedrawStart( aWindowTreeNode, drawRegion ); iWsGraphicsContext->Reset(); iWsGraphicsContext->SetDrawMode( MWsGraphicsContext::EDrawModePEN ); iWsGraphicsContext->SetBrushStyle( MWsGraphicsContext::ESolidBrush ); iWsGraphicsContext->SetPenStyle( MWsGraphicsContext::ESolidPen ); - iWsGraphicsContext->SetBrushColor( KRgbBlack ); // color from interface is white, so temporirily putting black - //const TRect clipRect = cursor->ClipRect(); - //const TRect cursorRect = cursor->Rect(); - iWsGraphicsContext->SetClippingRegion( clipRegion ); + iWsGraphicsContext->SetBrushColor( brushColor ); + iWsGraphicsContext->SetPenColor( penColor ); + iWsGraphicsContext->SetClippingRegion( clipRegion ); iWsGraphicsContext->DrawRect( aCursorRect ); + + // Draw pattern to cursor so that it is visible in any color backgrounds. + iWsGraphicsContext->SetPenColor( dotColor ); + TPoint start = aCursorRect.iTl; + TPoint end = TPoint(aCursorRect.iTl.iX, aCursorRect.iBr.iY); + + for (TInt i=0; iPlot(point); + } + else + { + if (!(j % 2)) + iWsGraphicsContext->Plot(point); + } + point.iY++; + } + start.iX++; + } + WindowRedrawEnd( aWindowTreeNode ); } @@ -420,7 +484,8 @@ if( iScreenNumber == 0 ) { if ( secureId != 0x10207218 && // Capserver / AKA goom - secureId != 0x10204c27 ) // Policy server + secureId != 0x10204c27 && // Policy server + secureId != 0x2000f85a ) // IAD application updater { // Todo: Must actually check whether the configuration uses goom // would create drastic performance hit in a system that does not need @@ -525,6 +590,10 @@ } #endif iAlfSendBuffer->CommitL(); + + AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeCount ); + AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeGroup, iRsWindowGroupNodeCount ); + AMT_INC_COUNTER(iRsWindowGroupNodeCount ); } // --------------------------------------------------------------------------- @@ -565,6 +634,9 @@ __ALFLOGSTRING("CAlfRenderStage::NodeReleased - WARNING: Node not found!!"); } + AMT_DEC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeCount ); + AMT_DEC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeGroup, iRsWindowGroupNodeCount ); + AMT_DEC_COUNTER(iRsWindowGroupNodeCount ); } // --------------------------------------------------------------------------- @@ -582,6 +654,8 @@ iAlfSendBuffer->CommitL(); __ALFLOGSTRING("CAlfRenderStage::NodeActivated <<"); + + AMT_INC_COUNTER_IF(nodeType==MWsWindowTreeNode::EWinTreeNodeClient, iRsWindowNodeActivatedCount ); } // --------------------------------------------------------------------------- @@ -618,6 +692,9 @@ ); } iAlfSendBuffer->CommitL(); + + AMT_INC_COUNTER( iRsNodeExtentChangedCount ); + AMT_SET_VALUE( iRsLatestNodeExtentRect, aRect ); } // --------------------------------------------------------------------------- @@ -650,6 +727,8 @@ aNewValue, &aWindowTreeNode ); iAlfSendBuffer->CommitL(); + + AMT_INC_COUNTER( iRsTotalNodeFlagChangedCount ); } // --------------------------------------------------------------------------- @@ -712,7 +791,9 @@ } } iAlfSendBuffer->CommitL(); - } + + AMT_INC_COUNTER( iRsTotalNodeAttributeChangedCount ); + } } // --------------------------------------------------------------------------- diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstagefactory.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstagefactory.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstagefactory.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstageplugin.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstageplugin.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstageplugin.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfrsgc.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrsgc.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrsgc.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp --- a/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2006-2008 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" @@ -862,6 +862,19 @@ } // --------------------------------------------------------------------------- +// Synchronize +// --------------------------------------------------------------------------- +// +void CAlfRsSendBuffer::Synchronize(TInt aId) + { + if ( iAlfBridgerClient ) + { + TIpcArgs args(aId); + iAlfBridgerClient->SendSynch(EAlfSynchronize, args); // error ignored + } + } + +// --------------------------------------------------------------------------- // ConnectL // --------------------------------------------------------------------------- // diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF --- a/uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF Fri Mar 19 09:43:21 2010 +0200 @@ -1105,4 +1105,7 @@ ?EnableLowMemoryState@RAlfDirectClient@@QAEXH@Z @ 1104 NONAME ; void RAlfDirectClient::EnableLowMemoryState(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) + ??1CAlfDrawer@@UAE@XZ @ 1108 NONAME ; CAlfDrawer::~CAlfDrawer(void) + ?NewL@CAlfDrawer@@SAPAV1@XZ @ 1109 NONAME ; class CAlfDrawer * CAlfDrawer::NewL(void) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/eabi/alfclientu.DEF --- a/uiacceltk/hitchcock/Client/eabi/alfclientu.DEF Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/eabi/alfclientu.DEF Fri Mar 19 09:43:21 2010 +0200 @@ -1338,4 +1338,9 @@ _ZN16RAlfDirectClient20EnableLowMemoryStateEi @ 1337 NONAME _ZN10CAlfVisual15SetGroupEffectLERK7TDesC16i @ 1338 NONAME _ZN16RAlfDirectClient16ForceSwRenderingEi @ 1339 NONAME + _ZN10CAlfDrawer4NewLEv @ 1340 NONAME + _ZN10CAlfDrawer6FinishEv @ 1341 NONAME + _ZN10CAlfDrawerD0Ev @ 1342 NONAME + _ZN10CAlfDrawerD1Ev @ 1343 NONAME + _ZN10CAlfDrawerD2Ev @ 1344 NONAME diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/inc/alfcrppluginclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/Client/inc/alfcrppluginclient.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,53 @@ +/* +* 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". +*/ + +#ifndef ALFCRPPLUGINCLIENT_H +#define ALFCRPPLUGINCLIENT_H + +#include +#include + +/** + * Client for ALF window server extension + */ +NONSHARABLE_CLASS( CAlfCrpPluginClient ) : public CWsGraphic + { +public: + /** + * Constructor. + */ + CAlfCrpPluginClient(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + virtual ~CAlfCrpPluginClient(); + +public: + + /** + * Synchronizes drawing. + */ + void Synchronize(); + +public: // from CWsGraphic + + virtual void HandleMessage(const TDesC8& aData); + virtual void OnReplace(); + + }; + +#endif // ALFCRPPLUGINCLIENT_H + +// End of file diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alfclient.mmp --- a/uiacceltk/hitchcock/Client/src/alfclient.mmp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alfclient.mmp Fri Mar 19 09:43:21 2010 +0200 @@ -105,6 +105,10 @@ SOURCE alfcanvasvisual.cpp SOURCE alfclientwindow.cpp SOURCE alfdirectclient.cpp + +SOURCE alfdrawer.cpp +SOURCE alfcrppluginclient.cpp + USERINCLUDE ../inc USERINCLUDE ../../CommonInc diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alfcrppluginclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/Client/src/alfcrppluginclient.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,74 @@ +/* +* 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: ALF window server client extension implementation. +* +*/ + +#include "alfcrppluginclient.h" + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::CAlfCrpPluginClient +// -------------------------------------------------------------------------- +// +CAlfCrpPluginClient::CAlfCrpPluginClient() + { + } + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::~CAlfCrpPluginClient +// -------------------------------------------------------------------------- +// +CAlfCrpPluginClient::~CAlfCrpPluginClient() + { + } + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::ConstructL +// -------------------------------------------------------------------------- +// +void CAlfCrpPluginClient::ConstructL() + { + const TUid id = { 0x2002C358 }; + BaseConstructL( id, KNullDesC8 ); + } + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::Synchronize +// -------------------------------------------------------------------------- +// +void CAlfCrpPluginClient::Synchronize() + { + TPckgC buf(0); + SendMessage(buf); + Flush(); + } + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::HandleMessage +// -------------------------------------------------------------------------- +// +void CAlfCrpPluginClient::HandleMessage(const TDesC8& /*aData*/) + { + } + +// -------------------------------------------------------------------------- +// CAlfCrpPluginClient::OnReplace +// -------------------------------------------------------------------------- +// +void CAlfCrpPluginClient::OnReplace() + { + } + +// End of file + diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alfdrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/Client/src/alfdrawer.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,143 @@ +/* +* 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: CAlfDrawer implementation. +* +*/ + + + + +#include +#include "alfcrppluginclient.h" + +#include +#include + +// Class to hold internal alf drawer data. +NONSHARABLE_CLASS( CAlfDrawer::TAlfDrawerData ) + { +public: + TAlfDrawerData(); + +public: + CAlfCrpPluginClient* iClient; + }; + +// Creates CAlfCrpPluginClient instance, returns error code. +static TInt CreateAlfCrpClient(CAlfCrpPluginClient*& aClient); +// Creates CAlfCrpPluginClient instance. +static CAlfCrpPluginClient* CreateAlfCrpClientL(); + + +// --------------------------------------------------------------------------- +// NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CAlfDrawer* CAlfDrawer::NewL() + { + CAlfDrawer* self = new (ELeave) CAlfDrawer; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +EXPORT_C CAlfDrawer::~CAlfDrawer() + { + if ( iData ) + { + delete iData->iClient; + delete iData; + } + } + +// --------------------------------------------------------------------------- +// Finish +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CAlfDrawer::Finish() + { + // First perform RWsSession finish operation to ensure + // that all drawing commands have been issued to renderstage. + TInt err = CCoeEnv::Static()->WsSession().Finish(); + + // Then create CRP instance (if needed). + if ( err == KErrNone && !iData->iClient ) + { + err = CreateAlfCrpClient( iData->iClient ); + } + + // Finally, wait until alf side has finished rendering. + if ( err == KErrNone && iData->iClient ) + { + iData->iClient->Synchronize(); + } + + return err; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CAlfDrawer::CAlfDrawer() + { + } + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void CAlfDrawer::ConstructL() + { + iData = new (ELeave) TAlfDrawerData; + CreateAlfCrpClient( iData->iClient ); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CAlfDrawer::TAlfDrawerData::TAlfDrawerData() + : iClient( NULL ) + { + } + +// --------------------------------------------------------------------------- +// CreateAlfCrpClient +// --------------------------------------------------------------------------- +// +static TInt CreateAlfCrpClient(CAlfCrpPluginClient*& aClient) + { + TRAPD(err, aClient = CreateAlfCrpClientL()); + return err; + } + +// --------------------------------------------------------------------------- +// CreateAlfCrpClientL +// --------------------------------------------------------------------------- +// +static CAlfCrpPluginClient* CreateAlfCrpClientL() + { + CAlfCrpPluginClient* client = new (ELeave) CAlfCrpPluginClient; + CleanupStack::PushL( client ); + client->ConstructL(); + CleanupStack::Pop( client ); + return client; + } + diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alfenv.cpp --- a/uiacceltk/hitchcock/Client/src/alfenv.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alfenv.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -953,6 +953,11 @@ // EXPORT_C void CAlfEnv::SetRefreshMode( TAlfRefreshMode aMode ) { + if(aMode == EAlfRefreshModeAutomatic) + { + // syncronoushly rasterize all the changed text visuals + iData->iTextStyleManager->RefreshAllVisuals(); + } Client().EnvSetRefreshMode( aMode ); iData->iRefreshMode = TAlfRefreshMode(aMode); } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alfmappingfunctions.cpp --- a/uiacceltk/hitchcock/Client/src/alfmappingfunctions.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alfmappingfunctions.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -663,7 +663,7 @@ if (!inverted) { // Find closest pre-calculated value... - for (i=0; iiParams.iValues[i]) || inverted && (aValue > iData->iParams.iValues[i])) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alftextstylemanager.cpp --- a/uiacceltk/hitchcock/Client/src/alftextstylemanager.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alftextstylemanager.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -116,6 +116,11 @@ void DoRefreshMesh() { + if( IsActive() ) + { + Cancel(); + } + for (TInt p = iVisuals.Count()-1; p >= 0; p--) { iVisuals[p]->PrepareForUpdateMesh(); @@ -337,7 +342,7 @@ #ifdef ALF_RASTER_TEXT for(TInt i = 0 ; i < iData->iTextStyles.Count() ; i++ ) { - iData->iTextStyles[i]->RefreshMesh(); + iData->iTextStyles[i]->DoRefreshMesh(); } #else return; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alftexturegroup.cpp --- a/uiacceltk/hitchcock/Client/src/alftexturegroup.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alftexturegroup.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -109,23 +109,24 @@ // --------------------------------------------------------------------------- // EXPORT_C CAlfTextureGroup::~CAlfTextureGroup() - { - while (Count()) + { + if ( iData ) { - RemoveTexture(Texture(Count()-1)); - } + while (Count()) + { + RemoveTexture(Texture(Count()-1)); + } + + iData->iLoadObserverQueue.Close(); + iData->iTextures.Close(); + + delete iData->iTextureLoadObserver; + iData->iTextureLoadObserver = NULL; + } - if ( iData ) - { - iData->iLoadObserverQueue.Close(); - iData->iTextures.Close(); - - delete iData->iTextureLoadObserver; - iData->iTextureLoadObserver = NULL; - } + delete iData; + } - delete iData; - } // --------------------------------------------------------------------------- // NewL // --------------------------------------------------------------------------- diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/Client/src/alftextvisual.cpp --- a/uiacceltk/hitchcock/Client/src/alftextvisual.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/Client/src/alftextvisual.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -416,10 +416,12 @@ void CAlfTextVisual::PrepareForUpdateMesh() { +#ifdef ALF_RASTER_TEXT if(!iTextVisualData->iMeshUptoDate) { iTextVisualData->iMesh->PrepareForRasterize(); } +#endif // ALF_RASTER_TEXT } void CAlfTextVisual::UpdateMesh(TBool aSynch) @@ -458,6 +460,7 @@ { #ifdef ALF_RASTER_TEXT iTextVisualData->iMesh->ResetLines(ETrue); + iTextVisualData->iMeshUptoDate = EFalse; #endif } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/alfbridgecommands.h --- a/uiacceltk/hitchcock/CommonInc/alfbridgecommands.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/CommonInc/alfbridgecommands.h Fri Mar 19 09:43:21 2010 +0200 @@ -73,15 +73,14 @@ EAlfEffectFxEndSyncronizedGroup, EAlfDSSetCapturingBitmap, EAlfDSSetCoveringBitmap, + + //140 EAlfDSSetFadeEffect, EAlfReleaseTemporaryChunk, - - // 140 EAlfBridgeSetScreenRotation, + EAlfDSSynchronize, KUnInitialized - - }; #endif /* ALFBRIDGECOMMANDS_H_ */ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/alflogger.h --- a/uiacceltk/hitchcock/CommonInc/alflogger.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/CommonInc/alflogger.h Fri Mar 19 09:43:21 2010 +0200 @@ -56,18 +56,21 @@ #define __ALFLOGSTRING1(C, X) #define __ALFLOGSTRING2(C, X, Y) #define __ALFLOGSTRING3(C, X, Y, Z) + #define __ALFLOGSTRING4(C, X, Y, Z, W) #endif #if (ALF_LOGGING_METHOD==1) #define __ALFLOGSTRING(C) RDebug::Print(_L(C)); #define __ALFLOGSTRING1(C, X) RDebug::Print(_L(C),X); #define __ALFLOGSTRING2(C, X, Y) RDebug::Print(_L(C),X, Y); #define __ALFLOGSTRING3(C, X, Y, Z) RDebug::Print(_L(C),X, Y, Z); + #define __ALFLOGSTRING4(C,X,Y,Z,W) RDebug::Print(_L(C),X, Y, Z, W); #endif #if (ALF_LOGGING_METHOD==2) #define __ALFLOGSTRING(C) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());} #define __ALFLOGSTRING1(C, X) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X);} #define __ALFLOGSTRING2(C, X, Y) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y);} #define __ALFLOGSTRING3(C, X, Y, Z) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z);} + #define __ALFLOGSTRING4(C,X,Y,Z,W) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z,W);} #endif // Logging for effects components @@ -86,18 +89,22 @@ #define __ALFFXLOGSTRING1(C, X) #define __ALFFXLOGSTRING2(C, X, Y) #define __ALFFXLOGSTRING3(C, X, Y, Z) + #define __ALFFXLOGSTRING4(C, X, Y, W) + #endif #if (ALF_FXLOGGING_METHOD==1) #define __ALFFXLOGSTRING(C) RDebug::Print(_L(C)); #define __ALFFXLOGSTRING1(C, X) RDebug::Print(_L(C),X); #define __ALFFXLOGSTRING2(C, X, Y) RDebug::Print(_L(C),X, Y); #define __ALFFXLOGSTRING3(C, X, Y, Z) RDebug::Print(_L(C),X, Y, Z); + #define __ALFFXLOGSTRING4(C,X,Y,Z,W) RDebug::Print(_L(C),X, Y, Z, W); #endif #if (ALF_FXLOGGING_METHOD==2) #define __ALFFXLOGSTRING(C) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());} #define __ALFFXLOGSTRING1(C, X) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X);} #define __ALFFXLOGSTRING2(C, X, Y) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y);} #define __ALFFXLOGSTRING3(C, X, Y, Z) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z);} + #define __ALFFXLOGSTRING4(C,X,Y,Z,W) {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue(tempLogDes()),X,Y,Z,W);} #endif #endif // ALFLOGGER_H diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/alfmoduletest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/alfmoduletest.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,240 @@ +#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_FUNC(func) +#define AMT_FUNC_EXC(func) +#define AMT_FUNC_EXC_IF(cond, 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_PRINT_STATE() + +#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 + + +// *** 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_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {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) +#define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) + +// 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) + + +// *** Global object names +_LIT(KAlfModuleTestChunkName, "ALF_MODULE_TEST_CHUNK"); +_LIT(KAlfModuleTestMutexName, "ALF_MODULE_TEST_MUTEX"); + +/* + * Class CAlfModuleTestData + */ + +NONSHARABLE_CLASS(CAlfModuleTestData) : public CBase + { +public: + void PrintState() + { + RDebug::Print(_L("*** ALF INTERNAL STATE ***")); + RDebug::Print(_L("iTotalLayerCount[0]=%d"), iTotalLayerCount[0]); + RDebug::Print(_L("iTotalLayerCount[1]=%d"), iTotalLayerCount[1]); + RDebug::Print(_L("iCloneLayerCount=%d"), iCloneLayerCount); + RDebug::Print(_L("iRsTotalNodeCount=%d"), iRsTotalNodeCount); + RDebug::Print(_L("iRsWindowGroupNodeCount=%d"), iRsWindowGroupNodeCount); + RDebug::Print(_L("iRsWindowNodeCount=%d"), iRsWindowNodeCount); + RDebug::Print(_L("iRsAnimNodeCount=%d"), iRsAnimNodeCount); + RDebug::Print(_L("iRsWindowNodeActivatedCount=%d"), iRsWindowNodeActivatedCount); + RDebug::Print(_L("iRsNodeExtentChangedCount=%d"), iRsNodeExtentChangedCount); + RDebug::Print(_L("iRsLatestNodeExtentRect= x:%d, y:%d, width=%d, height=%d"), + iRsLatestNodeExtentRect.iTl.iX, iRsLatestNodeExtentRect.iTl.iY, + iRsLatestNodeExtentRect.Width(), iRsLatestNodeExtentRect.Height()); + RDebug::Print(_L("iRsTotalNodeFlagChangedCount=%d"), iRsTotalNodeFlagChangedCount); + RDebug::Print(_L("iRsTotalNodeAttributeChangedCount=%d"), iRsTotalNodeAttributeChangedCount); + RDebug::Print(_L("iTotalNodeCount=%d"), iTotalNodeCount); + RDebug::Print(_L("iWindowGroupNodeCount=%d"), iWindowGroupNodeCount); + RDebug::Print(_L("iWindowNodeCount=%d"), iWindowNodeCount); + RDebug::Print(_L("iAnimNodeCount=%d"), iAnimNodeCount); + RDebug::Print(_L("iWindowNodeActivatedCount=%d"), iWindowNodeActivatedCount); + RDebug::Print(_L("iNodeExtentChangedCount=%d"), iNodeExtentChangedCount); + RDebug::Print(_L("iLatestNodeExtentRect= x:%d, y:%d, width=%d, height=%d"), + iLatestNodeExtentRect.iTl.iX, iLatestNodeExtentRect.iTl.iY, + iLatestNodeExtentRect.Width(), iLatestNodeExtentRect.Height()); + RDebug::Print(_L("iTotalNodeFlagChangedCount=%d"), iTotalNodeFlagChangedCount); + RDebug::Print(_L("iTotalNodeAttributeChangedCount=%d"), iTotalNodeAttributeChangedCount); + RDebug::Print(_L("iTotalVisualCount=%d"), iTotalVisualCount); + RDebug::Print(_L("iVisibleVisualCount=%d"), iVisibleVisualCount); + RDebug::Print(_L("iActiveVisualCount=%d"), iActiveVisualCount); + RDebug::Print(_L("iPassiveVisualCount=%d"), iPassiveVisualCount); + RDebug::Print(_L("iTextureCount=%d"), iTextureCount); + RDebug::Print(_L("iRenderBufferCount=%d"), iRenderBufferCount); + RDebug::Print(_L("iTotalControlGroupCount=%d"), iTotalControlGroupCount); + RDebug::Print(_L("iVisualSizeChangedCount=%d"), iVisualSizeChangedCount); + RDebug::Print(_L("iVisualPositionChangedCount=%d"), iVisualPositionChangedCount); + RDebug::Print(_L("iLatestVisualExtentRect= x:%d, y:%d, width=%d, height=%d"), + iLatestVisualExtentRect.iTl.iX, iLatestVisualExtentRect.iTl.iY, + iLatestVisualExtentRect.Width(), iLatestVisualExtentRect.Height()); + RDebug::Print(_L("iTotalVisualFlagChangedCount=%d"), iTotalVisualFlagChangedCount); + RDebug::Print(_L("iTotalVisualAttributeChangedCount=%d"), iTotalVisualAttributeChangedCount); + RDebug::Print(_L("*** ALF INTERNAL STATE ***")); + } + + +public: + TBool iIsEnabled; // *** not yet implemented. For run-time enabling/disabling of the test system. + + // Alf Render Stage + TInt iScreenCount; // *** not yet implemented + TInt iTotalLayerCount[10]; // For each screen + TInt iCloneLayerCount; // ** not yet implemented + TInt iRsTotalNodeCount; + TInt iRsWindowGroupNodeCount; + TInt iRsWindowNodeCount; + TInt iRsAnimNodeCount; + TInt iRsWindowNodeActivatedCount; + TInt iRsNodeExtentChangedCount; + TRect iRsLatestNodeExtentRect; + TInt iRsTotalNodeFlagChangedCount; + TInt iRsTotalNodeAttributeChangedCount; + // These are temporary variables for Alf Render Stage thread internal use only! + TInt iARS_Temp1; + TInt iARS_Temp2; + TInt iARS_Temp3; + TInt iARS_Temp4; + + // Alf Streamer + TInt iTotalNodeCount; + TInt iWindowGroupNodeCount; + TInt iWindowNodeCount; + TInt iAnimNodeCount; + TInt iWindowNodeActivatedCount; + TInt iNodeExtentChangedCount; + TRect iLatestNodeExtentRect; + TInt iTotalNodeFlagChangedCount; + TInt iTotalNodeAttributeChangedCount; + // These are temporary variables for Alf Streamer thread internal use only! + TInt iAST_Temp1; + TInt iAST_Temp2; + TInt iAST_Temp3; + TInt iAST_Temp4; + + // Alf Server + TInt iTotalVisualCount; + TInt iVisibleVisualCount; + TInt iActiveVisualCount; + TInt iPassiveVisualCount; + TInt iTextureCount; // *** not yet implemented + TInt iRenderBufferCount; // *** not yet implemented + TInt iTotalControlGroupCount; + TInt iVisualSizeChangedCount; + TInt iVisualPositionChangedCount; + TRect iLatestVisualExtentRect; + TInt iTotalVisualFlagChangedCount; + TInt iTotalVisualAttributeChangedCount; + TInt iOrdinalChange; + // These are temporary variables for Alf Server thread internal use only! + TInt iASE_Temp1; + TInt iASE_Temp2; + TInt iASE_Temp3; + TInt iASE_Temp4; + }; + + +/* + * Class CAlfModuleTestDataControl + */ +NONSHARABLE_CLASS(CAlfModuleTestDataControl) : public CBase + { +public: + /* + * Destructor + */ + ~CAlfModuleTestDataControl() + { + iModuleTestMutex.Close(); + iModuleTestChunk.Close(); + } + + /* + * Open global chunk and mutex created elsewhere + */ + TInt OpenGlobalObjects() + { + RDebug::Print(_L("CAlfModuleTestDataControl::OpenGlobalObjects().")); + // Open global module testing chunk + TBool isReadOnly = EFalse; + TInt err = iModuleTestChunk.OpenGlobal(KAlfModuleTestChunkName, isReadOnly); + if (!err) + { + // Create global module testing mutex + err = iModuleTestMutex.OpenGlobal(KAlfModuleTestMutexName); + if (!err) + { + iModuleTestData = reinterpret_cast(iModuleTestChunk.Base()); + } + } + RDebug::Print(_L("CAlfModuleTestDataControl::OpenGlobalObjects. ret=%d"), err); + return err; + } + + /* + * Lock access to global memory + */ + void Lock() {iModuleTestMutex.Wait();} + + /* + * Unlock access to global memory + */ + void Unlock() {iModuleTestMutex.Signal();} + +public: + RChunk iModuleTestChunk; + RMutex iModuleTestMutex; + CAlfModuleTestData* iModuleTestData; // Not owned + }; + +#endif + +#endif // ALFMODULETEST_H + +// End of File diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h --- a/uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h Fri Mar 19 09:43:21 2010 +0200 @@ -18,6 +18,10 @@ #ifndef _ALFRSUAPI_H_ #define _ALFRSUAPI_H_ +#include + +class MWsWindowTreeNode; + const TInt KAlfCompositionAgnosticWindowTreeObserverInterfaceId(0x2002BCFB); class MAlfCompositionAgnosticWindowTreeObserver @@ -78,7 +82,7 @@ virtual void MovedToWindowGroup(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode& aNewWindowGroupNode) = 0; virtual void WindowGroupChained(const MWsWindowTreeNode& aParent, const MWsWindowTreeNode& aChild) = 0; virtual void WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode) = 0; - virtual void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded) = 0; + virtual void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded) = 0; }; class RAlfBridgerClient; @@ -99,4 +103,34 @@ virtual RAlfBridgerClient* Client() = 0; }; +/** + * Synchronization interface + */ +class MAlfSynchronizationInterface + { +public: + /** + * Start synchronization. + * @param aId This will contain identifier for this synchronization. + * @return error code, KErrNone if synchronization is started. + */ + virtual TInt Synchronize(TInt& aId) = 0; + }; + +/** + * Use this UID as parameter when resolving MAlfSynchronizationInterface + * interface. + */ +const TUint32 KAlfSynchronizationInterfaceUid = 0x2002C357; + +/** + * Category for P&S variable for synchronization finished indication. + */ +const TUid KAlfPSUidSynchronizer = { 0x10003B20 }; + +/** + * Key for P&S variable for synchronization finished indication. + */ +const TUint32 KAlfPSKeySynchronizer = 0x2002C357; + #endif // _ALFRSUAPI_H_ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/huisynchronizationobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/CommonInc/huisynchronizationobserver.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2008 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 HUISYNCHRONIZATIONOBSERVER_H +#define HUISYNCHRONIZATIONOBSERVER_H + +#include + +/** + * Synchronization observer interface + */ +class MHuiSynchronizationObserver + { +public: + /** + * Informs of completion of synchronization. + * @param aId Id of completed synchronization. + */ + virtual void Synchronized(TInt aId) = 0; + }; + +#endif // HUISYNCHRONIZATIONOBSERVER_H diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/CommonInc/huiwscanvascommands.h --- a/uiacceltk/hitchcock/CommonInc/huiwscanvascommands.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/CommonInc/huiwscanvascommands.h Fri Mar 19 09:43:21 2010 +0200 @@ -170,4 +170,7 @@ EAlfTransparentContentFlush = 0x02 }; +// drawing commands for the window should be ignored +#define KWindowIsDSAHost 2 + #endif /* HUIWSCANVASCOMMANDS_H_ */ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h Fri Mar 19 09:43:21 2010 +0200 @@ -22,6 +22,9 @@ #include +#define AMT_CONTROL() static_cast(Dll::Tls()) +#include "alfmoduletest.h" + #include "alfscreen.h" #include "alfstreamerbridge.h" #include "alfdecoderserverclient.h" @@ -29,6 +32,7 @@ #include #include "HuiFxEffect.h" +#include "huisynchronizationobserver.h" #include #include @@ -36,7 +40,10 @@ class CAlfCommandDebug; class CAlfLayoutSwitchEffectCoordinator; class RMemReadStream; - +class CHuiCanvasVisual; +class CFullScreenEffectState; +class CControlEffectState; + const TInt KAlfBridgeRegionGranularity = 10; NONSHARABLE_CLASS(CAlfBridge): @@ -45,7 +52,7 @@ public MHuiDisplayRefreshObserver, public MHuiBitmapProvider, public MAlfGfxEffectObserver, - public MHuiRosterObserver + public MHuiSynchronizationObserver { // Helper class for keeping ongoing effects in order. Kept in iEffectCleanupStack private: @@ -187,7 +194,6 @@ void HandleGfxStopEvent( TBool aClientRequest ); void EnableSwRenderingL(TBool aEnable = ETrue); - void UploadSwRenderingTargetL( CAlfScreen* aScreen ); TBool PrepareSwRenderingTarget( CAlfScreen* aScreen ); /** @@ -219,16 +225,29 @@ * Cancels all effects due to low memory. */ void LowMemoryCancelAllEffects(); + + /** + * Sets HuiControlGroup as Alf application window group + */ + void SetWindowGroupAsAlfApp(TInt aId); - // From MHuiRosterObserver - void NotifyRosterDrawStart(CHuiDisplay& aDisplay); - void NotifyRosterDrawEnd(CHuiDisplay& aDisplay); + // From MHuiSynchronizationObserver + void Synchronized(TInt aId); + /* + * HandleGfxEndFullScreenTimeout + * + * 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); + private: - class CFullScreenEffectState; - - class CControlEffectState; CAlfBridge( CAlfStreamerBridge** aHost ); @@ -281,6 +300,23 @@ */ TBool HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout); + + /* + * ResolveAfterEffectAppearingApplicationL + * + * In case of an exit effect the appearing application is not notifed to alf + * by the GfxTransEffect API. In such case it is being resolved from Roster by + * taking the application directly under the application that is being moved + * to the background (when called by HandleReorderWindow) or being destroyed + * (called by DeleteControlGroupL). + * + * In some situation Alf may end up with wrong appearing application uid. In such + * case the worst that can happen, is that we must wait the frameworks + * EndFullScreen event to arrive. + */ + void ResolveAfterEffectAppearingApplicationL(CHuiControlGroup* aGroup); + + /** * FreezeLayoutUntilEffectDestroyedL * @@ -384,10 +420,26 @@ */ CHuiLayout* FindLayoutByEffectHandle(TInt aHandle); - /* + /** * HasActiveEffect + * + * Note. The visual might not have effect, but it is child for visual that has effect. + * In both cases, this method returns ETrue. Otherwise EFalse. + * + * @param aVisual Visual to be checked for effect participation. */ TBool HasActiveEffect(CHuiVisual* aVisual); + + /** + * HasActiveEffect + * + * Note. The visual might not have effect, but it is child for visual that has effect. + * In both cases, this method returns ETrue. Otherwise EFalse. + * + * @param aVisual Visual to be checked for effect participation. + * @param aIndex Index of the effect item in iEffectCleanupStack, if found. Otherwise KErrNotFound + */ + TBool HasActiveEffect(CHuiVisual* aVisual, TInt& aIndex); /* * FindEffectHandle @@ -627,6 +679,7 @@ CHuiControlGroup& aGroup); void VisualizeControlGroupOrderL( + CAlfScreen& aScreen, CHuiRoster& aRoster, CHuiControlGroup& aGroup); @@ -638,17 +691,18 @@ TBool LoadFadeEffectsL( CHuiCanvasVisual& aVisual ); // Fading related utility methods - static TBool CanFadeChildren( CHuiCanvasVisual& aParent ); - static TInt RecursiveChildCount( CHuiCanvasVisual& aParent, TInt aCanvasFlags ); - static TBool IsFadedByParent( CHuiCanvasVisual& aVisual ); - static TBool IsNearestParentEffectFade( CHuiCanvasVisual& aVisual ); - static TBool HasActivePaintedAreas( CHuiCanvasVisual& aVisual, TBool aIncludeChildren ); - static TBool HasActiveFadedChildren( CHuiCanvasVisual& aVisual ); + TBool CanFadeChildren( CHuiCanvasVisual& aParent ); + TInt RecursiveChildCount( CHuiCanvasVisual& aParent, TInt aCanvasFlags ); + TBool IsFadedByParent( CHuiCanvasVisual& aVisual ); + TBool IsNearestParentEffectFade( CHuiCanvasVisual& aVisual ); + TBool HasActivePaintedAreas( CHuiCanvasVisual& aVisual, TBool aIncludeChildren ); + TBool HasActiveFadedChildren( CHuiCanvasVisual& aVisual ); private: RPointerArray iAlfScreens; void SetCursorTimerL(TUint aTime = 0, CHuiVisual* aCursor = 0); + TBool IsAlfOriginatedWindow(CHuiCanvasVisual& aVisual); NONSHARABLE_CLASS ( TDeadControlGroup ) { @@ -715,84 +769,11 @@ // with visuals in iFullscreenEffectControlGroup RArray iEffectCleanupStack; - // Effects that have finished by their own, or framework requested to end them - RArray iFinishedEffects; - // Same as iEffectCleanupStack, but only the ones that can be now cleaned away. // See method RemoveTemporaryPresenterVisuals. RArray iFinishedCleanupStackEffects; - // Effects states are used for effects request that arrive before the effected - // window has been created. This is very common with fullscreen effects and - // occational with control effects. - // - // NOTE: control effects support currently only one "delayed" effect. This is propably - // not sufficient for all sitations. - NONSHARABLE_CLASS(CEffectState) : public CBase - { - public: - - CEffectState(); - ~CEffectState(); - - protected: - /** - * ResolveFileNameL - * - * Reads filename from stream and composes it to iEffectName variable. - */ - void ResolveFileNameL(RMemReadStream& aStream); - - public: - - TInt iAction; - TInt iHandle; - - HBufC* iEffectName; - // Handle using which client should be informed of completion. - TInt iCompletionHandle; - // State information - TInt iOperation; - - }; - - NONSHARABLE_CLASS( CControlEffectState ) : public CEffectState - { - public: - - TUint32 iClientHandle; - TUint32 iClientGroupHandle; - - void ConstructL(TInt aAction, RMemReadStream& aStream); - }; - - NONSHARABLE_CLASS( CFullScreenEffectState ) : public CEffectState - { - public: - // CFullScreenEffectState(); - // ~CFullScreenEffectState(); - - void ConstructL(TInt aAction, RMemReadStream& aStream); - - // Information from BeginFullScreen - TInt iType; - TInt iWg1; - TInt iWg2; - TInt iToAppId; - TInt iFromAppId; - TRect iRect; - - // ETrue if waiting for window group to appear - TBool iWaitingWindowGroup; - // ETrue if end fullscreen has been performed - TBool iEndFullScreen; - // ETrue if setup effect container has been done - TBool iSetupDone; - - // used for resolving the iCleanupStackItem that holds the frozen app layout underneath the starting application - TInt iAppStartScreenshotItemHandle; - }; - + /** * Full screen effect state. * Own. @@ -846,6 +827,7 @@ }; RHashMap iWindowHashArray; + CHuiControl* iOrphanStorage; // owned. holds the visuals which are orphaned from their control group class TRegisteredEffectsStruct { public: @@ -896,6 +878,15 @@ TBool iForcedSwRendering; TBool iLowMemoryMode; THuiMemoryLevel iCurrentMemoryLevel; + + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + TInt iTempTotalActiveVisualCount; + TInt iTempTotalPassiveVisualCount; + #endif + #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER + TInt activevisualcount; + TInt passivevisualcount; + #endif }; #endif // __ALF_BRIDGE_H__ \ No newline at end of file diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2008 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 for Nokia +* +*/ + +#include +#include +#include "alfbridge.h" + +// Timer to send finish full screen effect +// --------------------------------------------------------- +// CAlfFinishTimer +// --------------------------------------------------------- +// +NONSHARABLE_CLASS( CAlfRosterFreezeEndTimer ):public CTimer + { + public: // Constructors and destructor + static CAlfRosterFreezeEndTimer* NewL( CAlfBridge& aBridge ); + virtual ~CAlfRosterFreezeEndTimer(); + + public: // New functions + void Start( TTimeIntervalMicroSeconds32 aPeriod ); + + protected: // Functions from base classes + void DoCancel(); + + private: + CAlfRosterFreezeEndTimer( CAlfBridge& aBridge ); + void ConstructL(); + void RunL(); + + private: // Data + CAlfBridge& iBridge; + + }; + + + +// Timer to send finish full screen effect +// --------------------------------------------------------- +// CAlfFinishTimer +// --------------------------------------------------------- +// +NONSHARABLE_CLASS( CAlfEffectEndTimer ):public CTimer + { + public: // Constructors and destructor + static CAlfEffectEndTimer* NewL( CAlfBridge& aBridge ); + virtual ~CAlfEffectEndTimer(); + + public: // New functions + void Start( TTimeIntervalMicroSeconds32 aPeriod, TInt aHandle ); + + protected: // Functions from base classes + void DoCancel(); + + private: + CAlfEffectEndTimer( CAlfBridge& aBridge ); + void ConstructL(); + void RunL(); + + private: // Data + CAlfBridge& iBridge; + TInt iHandle; + + }; + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectcoordinator +// --------------------------------------------------------- +// +NONSHARABLE_CLASS( CAlfLayoutSwitchEffectCoordinator ) : public CBase, public MAlfGfxEffectObserver + { + public: // Constructors and destructor + CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge ); + virtual ~CAlfLayoutSwitchEffectCoordinator(); + + public: // MAlfGfxEffectObserver + void AlfGfxEffectEndCallBack( TInt aHandle ); + + public: + void BeginLayoutSwitch(); + void Cancel(); + + private: + AknTransEffect::TContext NextLayoutSwitchContext(); + void SetLayoutSwitchEffect(AknTransEffect::TContext aContext); + TBool LayoutSwitchEffectsExist(); + + private: // Data + + CAlfBridge& iBridge; + AknTransEffect::TContext iLayoutSwitchEffectContext; + TThreadPriority iOriginalPriority; + CAlfRosterFreezeEndTimer* iRosterFreezeEndTimer; + }; + +// --------------------------------------------------------- +// Effects states are used for effects request that arrive before the effected +// window has been created. This is very common with fullscreen effects and +// occational with control effects. +// +// NOTE: control effects support currently only one "delayed" effect. This is propably +// not sufficient for all sitations. +// --------------------------------------------------------- +// +NONSHARABLE_CLASS(CEffectState) : public CBase + { + public: + + CEffectState(); + virtual ~CEffectState(); + + protected: + /** + * ResolveFileNameL + * + * Reads filename from stream and composes it to iEffectName variable. + */ + void ResolveFileNameL(RMemReadStream& aStream); + + public: + + TInt iAction; + TInt iHandle; + + HBufC* iEffectName; + // Handle using which client should be informed of completion. + TInt iCompletionHandle; + // State information + TInt iOperation; + + }; + + NONSHARABLE_CLASS(CControlEffectState ) : public CEffectState + { + public: + + TUint32 iClientHandle; + TUint32 iClientGroupHandle; + + void ConstructL(TInt aAction, RMemReadStream& aStream); + }; + + NONSHARABLE_CLASS(CFullScreenEffectState ) : public CEffectState + { + public: + ~CFullScreenEffectState(); + + void ConstructL(TInt aAction, RMemReadStream& aStream); + + TBool ResetTimerL(CAlfBridge* aBridge); + + void NotifyDrawingTimeout(); + + // Information from BeginFullScreen + TInt iType; + TInt iWg1; + TInt iWg2; + TInt iToAppId; + TInt iFromAppId; + TRect iRect; + + // ETrue if waiting for window group to appear + TBool iWaitingWindowGroup; + // ETrue if end fullscreen has been performed + TBool iEndFullScreen; + // ETrue if setup effect container has been done + TBool iSetupDone; + + // used for resolving the iCleanupStackItem that holds the frozen app layout underneath the starting application + TInt iAppStartScreenshotItemHandle; + + RRegion iPaintedRegion; + enum TEffectType + { + ENotDefinedEffect = 0, + EStartEffect, + EExitEffect + }; + + TEffectType iEffectType; + TSize iDisplaySize; + CAlfBridge* iBridge; // for callback. not own. + + CPeriodic* iDrawingCompleteTimer; + }; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h Fri Mar 19 09:43:21 2010 +0200 @@ -23,6 +23,10 @@ #include #include #include + +#define AMT_CONTROL() static_cast(Dll::Tls()) +#include "alfmoduletest.h" + #include #include "alfstreamerbridge.h" #include // USER_INVARIANT diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h Fri Mar 19 09:43:21 2010 +0200 @@ -104,7 +104,7 @@ void SetFirstSprite(); - CAlfNode* OrphonMe(); + CAlfNode* OrphanMe(); CAlfNode* FindPreviousChild(); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfscreen.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfscreen.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfscreen.h Fri Mar 19 09:43:21 2010 +0200 @@ -42,6 +42,9 @@ /** Group for showing effects */ EAlfFullScreenEffectContainer, + + /** Group for FPS indicator */ + EAlfFpsIndicatorContainer }; NONSHARABLE_CLASS( TAlfControlGroupEntry ) @@ -107,6 +110,11 @@ */ TBool IsVisualTreeVisibilityChanged(); + /** + * Returns amount of fixed control groups. + */ + TInt FixedControlGroupCount() const; + public: RArray iControlGroups; @@ -115,6 +123,7 @@ CHuiDisplay* iDisplay; CHuiControlGroup* iFloatingSpriteControlGroup; CHuiControlGroup* iFullscreenEffectControlGroup; + CHuiControlGroup* iFpsControlGroup; TBool iVisualTreeVisibilityChanged; TInt iScreenNum; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h --- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h Fri Mar 19 09:43:21 2010 +0200 @@ -37,7 +37,8 @@ EDsNotifyNativeWindowData, EAlfBridgerBlindSend, EAlfSetScreenRotation, - EAlfGetNativeWindowHandles + EAlfGetNativeWindowHandles, + EAlfSynchronize }; enum TAlfCompOps{ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp Fri Mar 19 09:43:21 2010 +0200 @@ -82,8 +82,11 @@ SOURCE alfnodes.cpp SOURCE alfbridge.cpp SOURCE alfscreen.cpp +SOURCE alfeffectutils.cpp #endif +SOURCE themerepositorylistener.cpp + USERINCLUDE ../Inc USERINCLUDE ../../coretoolkit/inc SYSTEMINCLUDE ../../CommonInc @@ -130,4 +133,3 @@ #ifdef HUI_DEBUG_TRACK_DRAWING LIBRARY alfcommanddebug.lib #endif -SOURCE themerepositorylistener.cpp diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfappsrvsessionBase.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsessionBase.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsessionBase.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -940,16 +940,18 @@ // void CAlfAppSrvSessionBase::GetSystemEvents(const RMessage2* aMessage) { - if (aMessage && iData->iSystemEvent.IsNull()) + __ASSERT_DEBUG(aMessage, USER_INVARIANT()); + if (aMessage) { - iData->iSystemEvent = *aMessage; + if (iData->iSystemEvent.IsNull()) + { + iData->iSystemEvent = *aMessage; + } + else + { + aMessage->Complete(KErrInUse); + } } - else - { - __ASSERT_DEBUG(aMessage, USER_INVARIANT()); - aMessage->Complete(KErrInUse); - } - } // --------------------------------------------------------------------------- diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -665,6 +665,11 @@ // EXPORT_C CAlfAppUi::~CAlfAppUi() { + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + delete AMT_CONTROL(); + Dll::FreeTls(); + #endif + delete iData; } @@ -763,6 +768,13 @@ EXPORT_C void CAlfAppUi::ConstructL() { __ALFLOGSTRING( "CAlfAppUi::ConstructL start" ) + + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // Initiliaze global data in TLS and open global module testing chunk and mutex + User::LeaveIfError(Dll::SetTls(new(ELeave) CAlfModuleTestDataControl())); + User::LeaveIfError(AMT_CONTROL()->OpenGlobalObjects()); + #endif + TInt flags = EStandardApp|ENoScreenFurniture|ENonStandardResourceFile|EAknEnableSkin; CCoeEnv* coe = CCoeEnv::Static(); iData = new (ELeave) CAlfAppUiData(); @@ -903,6 +915,10 @@ // Load Tfx server client API plugin, if exists iData->iServer->CreateTfxServerPlugin(); +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + iData->iBridgeObj->ForceSwRendering(ETrue); +#endif + __ALFLOGSTRING( "CAlfAppUi::ConstructL end" ) } @@ -1442,4 +1458,8 @@ return iData->iBridgeObj->ForceSwRendering( aEnabled ); } +void CAlfAppUi::SetAlfAppWindowGroup( TInt aID ) + { + iData->iBridgeObj->SetWindowGroupAsAlfApp( aID ); + } // end of file diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -69,6 +68,8 @@ #include "HuiRenderPlugin.h" #include "huicanvasgc.h" #include "huicanvasrenderbuffer.h" +#include "alfeffectutils.h" +#include "alfrenderstageutils.h" // for KAlfPSUidSynchronizer & KAlfPSKeySynchronizer #ifdef HUI_DEBUG_TRACK_DRAWING #include @@ -88,468 +89,14 @@ //const TReal32 KAlfVisualDefaultOpacity = 0.5f; _LIT8(KAlfWindowGroupContainerControlTag, "WGROUP"); -const TInt KAlfNumberOfFixedControlGroups = 2; - -// This debug option prints window group order with __ALFLOGSTRING -//#define ALF_DEBUG_PRINT_WINDOWGROUP_ORDER - + +// #define USE_APPLICATION_ENDFULLSCREEN_TIMEOUT // This debug option shows window groups in a grid //#define ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER const TInt KFadeAction = 6000; -const TInt KRosterFreezeEndTimeoutInMs = 400; - -// Timer to send finish full screen effect -// --------------------------------------------------------- -// CAlfFinishTimer -// --------------------------------------------------------- -// -NONSHARABLE_CLASS( CAlfRosterFreezeEndTimer ):public CTimer - { - public: // Constructors and destructor - static CAlfRosterFreezeEndTimer* NewL( CAlfBridge& aBridge ); - virtual ~CAlfRosterFreezeEndTimer(); - - public: // New functions - void Start( TTimeIntervalMicroSeconds32 aPeriod ); - - protected: // Functions from base classes - void DoCancel(); - - private: - CAlfRosterFreezeEndTimer( CAlfBridge& aBridge ); - void ConstructL(); - void RunL(); - - private: // Data - CAlfBridge& iBridge; - - }; - - -// --------------------------------------------------------- -// CAlfRosterFreezeEndTimer -// --------------------------------------------------------- -// -CAlfRosterFreezeEndTimer::CAlfRosterFreezeEndTimer( CAlfBridge& aBridge ) - :CTimer ( EPriorityStandard ), - iBridge( aBridge ) - { - } - -void CAlfRosterFreezeEndTimer::ConstructL() - { - CTimer::ConstructL(); - CActiveScheduler::Add( this ); - } - -CAlfRosterFreezeEndTimer* CAlfRosterFreezeEndTimer::NewL( CAlfBridge& aBridge ) - { - CAlfRosterFreezeEndTimer* self = new ( ELeave ) CAlfRosterFreezeEndTimer( aBridge ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -CAlfRosterFreezeEndTimer::~CAlfRosterFreezeEndTimer() - { - Cancel(); - } - -void CAlfRosterFreezeEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod ) - { - if (!IsActive()) - { - After( aPeriod ); - } - } - -void CAlfRosterFreezeEndTimer::RunL() - { - iBridge.iHuiEnv->Display(0).SetDirty(); - TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); - iBridge.SetVisualTreeVisibilityChanged(ETrue); - } - -void CAlfRosterFreezeEndTimer::DoCancel() - { - CTimer::DoCancel(); - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectcoordinator -// --------------------------------------------------------- -// -NONSHARABLE_CLASS( CAlfLayoutSwitchEffectCoordinator ) : public CBase, public MAlfGfxEffectObserver - { - public: // Constructors and destructor - CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge ); - virtual ~CAlfLayoutSwitchEffectCoordinator(); - - public: // MAlfGfxEffectObserver - void AlfGfxEffectEndCallBack( TInt aHandle ); - - public: - void BeginLayoutSwitch(); - void Cancel(); - - private: - AknTransEffect::TContext NextLayoutSwitchContext(); - void SetLayoutSwitchEffect(AknTransEffect::TContext aContext); - TBool LayoutSwitchEffectsExist(); - - private: // Data - - CAlfBridge& iBridge; - AknTransEffect::TContext iLayoutSwitchEffectContext; - TThreadPriority iOriginalPriority; - CAlfRosterFreezeEndTimer* iRosterFreezeEndTimer; - }; - -CAlfLayoutSwitchEffectCoordinator::CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge ) : - iBridge( aBridge ), - iLayoutSwitchEffectContext(AknTransEffect::ENone) - { - RThread me = RThread(); - iOriginalPriority = me.Priority(); - me.Close(); - } - -CAlfLayoutSwitchEffectCoordinator::~CAlfLayoutSwitchEffectCoordinator() - { - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack -// -// This method is callback which gets called when layout -// switch effect has ended. -// --------------------------------------------------------- -// -void CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack( TInt aHandle ) - { - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack")); - if (iLayoutSwitchEffectContext == aHandle) - { - AknTransEffect::TContext nextContext = NextLayoutSwitchContext(); - - // Unfreeze visible content. This reveals real roster content (in new orientation). - if (nextContext == AknTransEffect::ELayoutSwitchExit) - { - #ifdef HUI_DEBUG_TRACK_DRAWING - RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack unfreezing roster content")); - #endif - iBridge.iHuiEnv->Display(0).SetDirty(); - TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); - iBridge.SetVisualTreeVisibilityChanged(ETrue); - } - - // Set next effect - SetLayoutSwitchEffect(nextContext); - - if (nextContext == AknTransEffect::ENone) - { - // Restore normal priority - RThread me = RThread(); - me.SetPriority(iOriginalPriority); - me.Close(); - - // Just in case refresh everything - iBridge.iHuiEnv->Display(0).SetDirty(); - } - } - else - { - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack - got different handle (normal, dont worry...) - %i"), aHandle); - } - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectCoordinator::Cancel -// --------------------------------------------------------- -// -void CAlfLayoutSwitchEffectCoordinator::Cancel() - { - // Disable effect - SetLayoutSwitchEffect( AknTransEffect::ENone ); - - // Unfreeze visible content - if ( iRosterFreezeEndTimer ) - { - iRosterFreezeEndTimer->Cancel(); - } - - iBridge.iHuiEnv->Display(0).SetDirty(); - TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); - iBridge.SetVisualTreeVisibilityChanged(ETrue); - - // Restore normal priority - RThread me = RThread(); - me.SetPriority(iOriginalPriority); - me.Close(); - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch -// -// This method starts the layout switch effect procedure. -// --------------------------------------------------------- -// -void CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch() - { - // Hm. what to do if earlier is already in progress ? - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch")); - if ( iBridge.iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLowest ) - { - // No effects in low memory mode - return; - } - - if (!iLayoutSwitchEffectContext) - { - TBool tfxOn = CAknTransitionUtils::TransitionsEnabled(AknTransEffect::ELayoutswitchTransitionsOff ); - TBool tfxExists = LayoutSwitchEffectsExist(); - if (tfxOn && tfxExists) - { - // Boost priority so that we are able to draw more frames for the effect - RThread me = RThread(); - me.SetPriority(EPriorityAbsoluteHigh); - me.Close(); - - // Freeze visual content - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch freezing roster content")); - iBridge.iHuiEnv->Display(0).SetDirty(); - TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue)); - - // Remove all other effects - iBridge.HandleGfxStopEvent( EFalse ); - iBridge.RemoveAllTemporaryPresenterVisuals(); - - // Set first layout switch effect - SetLayoutSwitchEffect(AknTransEffect::ELayoutSwitchStart); - } - else - { - if (!iRosterFreezeEndTimer) - { - TRAP_IGNORE(iRosterFreezeEndTimer = CAlfRosterFreezeEndTimer::NewL(iBridge)); - } - - if (iRosterFreezeEndTimer) - { - iBridge.iHuiEnv->Display(0).SetDirty(); - TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue)); - - // Remove all other effects - iBridge.HandleGfxStopEvent( EFalse ); - iBridge.RemoveAllTemporaryPresenterVisuals(); - - // Set remove freeze timer - iRosterFreezeEndTimer->Start(KRosterFreezeEndTimeoutInMs*1000); - } - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - tfx are set OFF -> I am not starting effect.")); - } - } - else - { - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - old effect exists - %i"), iLayoutSwitchEffectContext); - } - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext -// -// This method automatically selects the next context in the -// layout switch procedure. -// -// Contextes change in the following order during layout switch: -// -// 1. AknTransEffect::ENone -// 2. AknTransEffect::ELayoutSwitchStart -// 3. AknTransEffect::ELayoutSwitchExit -// 4. AknTransEffect::ENone -// -// After new context is selected, appropriate effect is set -// (and/or removed) from the roster. -// -// --------------------------------------------------------- -// -AknTransEffect::TContext CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext() - { - // Resolve next context based on current context - AknTransEffect::TContext newContext = AknTransEffect::ENone; - switch (iLayoutSwitchEffectContext) - { - case AknTransEffect::ENone: - { - newContext = AknTransEffect::ELayoutSwitchStart; - break; - } - case AknTransEffect::ELayoutSwitchStart: - { - newContext = AknTransEffect::ELayoutSwitchExit; - break; - } - case AknTransEffect::ELayoutSwitchExit: // fallthrough - default: - { - newContext = AknTransEffect::ENone; - break; - } - } - - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL old ctx = %i, new ctx = %i"), iLayoutSwitchEffectContext, newContext); - return newContext; - } - -// --------------------------------------------------------- -// CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffectL -// -// This method sets correct effect based on the given -// layout switch context. -// -// --------------------------------------------------------- -// -void CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffect(AknTransEffect::TContext aContext) - { - MHuiEffectable* effectable = iBridge.iHuiEnv->Display(0).Roster().Effectable(); - CHuiFxEffect* effect = NULL; - CHuiFxEngine* engine = iBridge.iHuiEnv->EffectsEngine(); - - if (!effectable || !engine) - { - return; - } - - // Update current context - iLayoutSwitchEffectContext = aContext; - - if (aContext == AknTransEffect::ENone) - { - // Just remove effect - //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL - removing effect")); - effectable->EffectSetEffect(NULL); // This calls AlfGfxEffectEndCallBack - } - else - { - // Load correct effect - for ( TInt i = 0; iLoadEffectL(*iBridge.iAlfRegisteredEffects[i].iEffectFile, effect, effectable, NULL, this, iLayoutSwitchEffectContext, 0 ) ); - break; - } - } - } - } - -TBool CAlfLayoutSwitchEffectCoordinator::LayoutSwitchEffectsExist() - { - TBool appearExists = EFalse; - TBool disAppearExists = EFalse; - - for ( TInt i = 0; iConstructL(); - CleanupStack::Pop( self ); - return self; - } - -CAlfEffectEndTimer::~CAlfEffectEndTimer() - { - Cancel(); - } - -void CAlfEffectEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod, TInt aHandle ) - { - iHandle = aHandle; - After( aPeriod ); - } - -void CAlfEffectEndTimer::RunL() - { - // - // timer completes and control is returned to caller - // - iBridge.TransitionFinishedHandlerL( iHandle ); - // We don't become active unless we are explicitly restarted - } - -void CAlfEffectEndTimer::DoCancel() - { - CTimer::DoCancel(); - } - - // ======== MEMBER FUNCTIONS ======== // ======== MEMBER FUNCTIONS ======== @@ -591,6 +138,7 @@ // CAlfBridge::~CAlfBridge() { + delete iOrphanStorage; delete iFadeEffectFile; iWindowHashArray.Close(); for( TInt i = 0; i< iAlfRegisteredEffects.Count(); i++ ) @@ -598,7 +146,6 @@ delete iAlfRegisteredEffects[i].iEffectFile; } iAlfRegisteredEffects.Close(); - iFinishedEffects.Close(); delete iEffectEndTimer; iDeadControlGroups.Close(); iEffectWindowGroups.Close(); @@ -655,6 +202,11 @@ iLayoutSwitchEffectCoordinator = new (ELeave) CAlfLayoutSwitchEffectCoordinator(*this); iAlfSecureId = RThread().SecureId(); + + // Create control for the orphaned windows, which control group id deleted before them + iOrphanStorage = new (ELeave) CHuiControl(*iHuiEnv); + iOrphanStorage->ConstructL(); + RegisterFadeEffectL(); } @@ -739,9 +291,14 @@ ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFloatingSpriteControlGroup), KHuiRosterShowAtTop, screenNumber); ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFullscreenEffectControlGroup), KHuiRosterShowAtTop, screenNumber); - screen->iFloatingSpriteControlGroup->SetAcceptInput(EFalse); screen->iFullscreenEffectControlGroup->SetAcceptInput(EFalse); + + if ( screen->iFpsControlGroup ) + { + ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFpsControlGroup), KHuiRosterShowAtTop, screenNumber); + screen->iFpsControlGroup->SetAcceptInput(EFalse); + } } //------------------------------------------------------------------------------ @@ -762,6 +319,12 @@ screen->iFloatingSpriteControlGroup->SetAcceptInput(EFalse); screen->iFullscreenEffectControlGroup->SetAcceptInput(EFalse); + + if ( screen->iFpsControlGroup ) + { + ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFpsControlGroup), KHuiRosterShowAtTop, screenNumber); + screen->iFpsControlGroup->SetAcceptInput(EFalse); + } } @@ -781,6 +344,8 @@ iWindowHashArray.Insert( aWindowNodeId, visualStruct ); iPreviouslySearchedVisualId = aWindowNodeId; iPreviouslySearchedVisual = aVisual; + + AMT_INC_COUNTER( iTotalVisualCount ); } // --------------------------------------------------------------------------- @@ -792,6 +357,8 @@ __ALFFXLOGSTRING1("CAlfBridge::RemoveVisual 0x%x", aWindowNodeId); iWindowHashArray.Remove( aWindowNodeId ); iPreviouslySearchedVisualId = 0; + + AMT_DEC_COUNTER( iTotalVisualCount ); } // --------------------------------------------------------------------------- @@ -939,6 +506,48 @@ } // --------------------------------------------------------------------------- +// ResolveAfterEffectAppearingApplicationL +// --------------------------------------------------------------------------- +// +void CAlfBridge::ResolveAfterEffectAppearingApplicationL(CHuiControlGroup* aGroup) + { +#ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT + if (iFullScreenEffectData && iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect) + { + CHuiControlGroup *exitingGroupInEffect = FindControlGroupByAppId(iFullScreenEffectData->iToAppId); + if (exitingGroupInEffect == aGroup) + { + CHuiRoster& roster = iAlfScreens[0]->iDisplay->Roster(); + CHuiControlGroup* nextToBecomeVisible = NULL; + // resolve who is under this application in roster + for (TInt i = 0 ; i < roster.Count() ; i++) + { + if (&roster.ControlGroup(i) == exitingGroupInEffect && i > 1) + { + __ALFFXLOGSTRING("CAlfBridge::ResolveAfterEffectAppearingApplicationL - Found underneath control group"); + nextToBecomeVisible = &roster.ControlGroup(i-1); + break; + } + } + // resolve, to which application this maps to + if (nextToBecomeVisible) + { + for(TInt j = 0 ; j < iAlfScreens[0]->iControlGroups.Count() - 1 ; j++) + { + if (iAlfScreens[0]->iControlGroups[j].iControlGroup == nextToBecomeVisible) + { + iFullScreenEffectData->iFromAppId = iAlfScreens[0]->iControlGroups[j].iSecureId; + __ALFFXLOGSTRING1("CAlfBridge::ResolveAfterEffectAppearingApplicationL - Found underneath application uid: 0x%x. Start track drawing for exit effect.", iFullScreenEffectData->iFromAppId ); + break; + } + } + } + } + } +#endif + } + +// --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // void CAlfBridge::DeleteControlGroupL(TInt aWindowGroupNodeId, TInt aScreenNumber ) @@ -949,16 +558,25 @@ { if (iAlfScreens[aScreenNumber]->iDisplay) { - CHuiControl& control = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup->Control(0); + CHuiControlGroup* controlGroup = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup; + CHuiControl& control = controlGroup->Control(0); CHuiLayout* layout = (CHuiLayout*)&control.Visual(0); + ResolveAfterEffectAppearingApplicationL(controlGroup); // wserv has notifed that this control group and its layout should be destroyed. However, we might be // have effect on the layout itself or layout is being drawn as external content. This indicates that // we should not delete the control group at this point, but add it to iDeadControlGroup list, which // is cleared when effect has finished. RPointerArray familyTree; ListFamilyTreeL(familyTree, layout); // recursively dig the family tree + TBool anyVisualHasEffect(EFalse); + TInt familyIndex(0); + TInt familySize = familyTree.Count(); + while(familyIndex < familySize && !anyVisualHasEffect) + { + anyVisualHasEffect = HasActiveEffect(familyTree[familyIndex++]); + } - if (HasActiveEffect(layout)) + if (anyVisualHasEffect) { __ALFFXLOGSTRING1("Layout 0x%x has external content", layout); // EHuiVisualFlagShouldDestroy destroy flag should have come for the windows in this layout already @@ -993,7 +611,21 @@ // in this case, the child window effects WILL BE REMOVED. for(TInt familyIndex = 0; familyIndex < familyTree.Count();familyIndex++) { - RemoveTemporaryPresenterVisual(familyTree[familyIndex]); + CHuiLayout* removedVisual = familyTree[familyIndex]; + RemoveTemporaryPresenterVisual(removedVisual); + + if ( removedVisual != layout ) // let control group delete the layout + { + control.Remove(removedVisual); // remove ownership from the original control (group) + if ( removedVisual->Layout() == layout ) + { + iOrphanStorage->AppendL( removedVisual ); + } + else + { + removedVisual->SetOwner(*iOrphanStorage); + } + } } } familyTree.Close(); @@ -1003,6 +635,9 @@ iHuiEnv->DeleteControlGroup(aWindowGroupNodeId); __ALFFXLOGSTRING("CAlfBridge::DeleteControlGroupL - Deleting group done"); } + + AMT_DEC_COUNTER( iTotalControlGroupCount ); + break; } } @@ -1079,6 +714,8 @@ if (iAlfScreens[aScreenNumber]->iDisplay) ShowControlGroupL(iAlfScreens[aScreenNumber]->iDisplay->Roster(), *group, KHuiRosterShowAtTop, aScreenNumber); + + AMT_INC_COUNTER( iTotalControlGroupCount ); } @@ -1120,7 +757,7 @@ // has been solved by deleting the tag when window server wants to delete // the group. Window server no longer has it, but we keep it alive for a while // to show the effect. The group will be deleted when the effect ends. - aWhere = aRoster.Count() - KAlfNumberOfFixedControlGroups; + aWhere = aRoster.Count() - screen->FixedControlGroupCount(); } } @@ -1146,7 +783,7 @@ #endif #ifdef ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER - VisualizeControlGroupOrderL(aRoster, aGroup); + VisualizeControlGroupOrderL(*screen, aRoster, aGroup); #endif } @@ -1240,18 +877,30 @@ else if (aWhere == KHuiRosterShowAtTop) { // Topmost - aRoster.ShowL(aGroup, aRoster.Count() - KAlfNumberOfFixedControlGroups); + aRoster.ShowL(aGroup, aRoster.Count() - screen->FixedControlGroupCount()); } else { TInt index = 0; // Index for Window group control groups TBool added = EFalse; - for (TInt i=0; iFixedControlGroupCount(); i++) { if (index == aWhere) { - aRoster.ShowL(aGroup, i); + TBool lSyncAlfAppAndAlfEventGroup = EFalse; + if ( i>0 && aRoster.ControlGroup(i).iAlfApp && aRoster.ControlGroup(i-1).ResourceId() == iAlfWindowGroupNodeId && &aRoster.ControlGroup(i) != &aGroup) + { + lSyncAlfAppAndAlfEventGroup = ETrue; + } + aRoster.ShowL(aGroup, i); added = ETrue; + if (lSyncAlfAppAndAlfEventGroup && i< (aRoster.Count()-1) ) + { + CHuiControlGroup &lGroup = aRoster.ControlGroup(i+1); + TInt clientWindowGroupId = FindClientWindowGroupId( aScreenNumber, lGroup ); + iAppUi->AdjustWindowGroupPositionL(clientWindowGroupId,CAlfAppServer::EBehindOfParent); + } + break; } @@ -1266,7 +915,7 @@ if (!added) { // Topmost - for (TInt i=aRoster.Count()-KAlfNumberOfFixedControlGroups; i >= 0; i--) + for (TInt i=aRoster.Count() - screen->FixedControlGroupCount(); i >= 0; i--) { if (aRoster.ControlGroup(i).Control(0).Role() == EAlfWindowGroupContainer) { @@ -1455,10 +1104,25 @@ } // --------------------------------------------------------------------------- +// Check if effect has been flagged as opaque +// --------------------------------------------------------------------------- +// +static TBool IsOpaqueEffect(CHuiFxEffect* aEffect) + { + return aEffect && (aEffect->EffectFlags() & KHuiFxOpaqueHint); + } + +// --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TBool CAlfBridge::IsVisualOpaque(CHuiVisual& aVisual) { + // Effect with opaque hint overrides everything else. + if (IsOpaqueEffect( aVisual.Effect() )) + { + return ETrue; // Opaque + } + TBool transparent = EFalse; // TODO: We should check transformation too and perhaps parent transformations as well ? @@ -1592,16 +1256,44 @@ //iActiveVisualCount = 0; iBgSurfaceFound = EFalse; //iPaintedArea = 0; + + // Check if effect group has an effect with opaque hint. + CHuiControlGroup& fxcontrolgroup = *(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup); + CHuiControl& fxcontrol = fxcontrolgroup.Control(0); + CHuiCanvasVisual* fxlayout = (CHuiCanvasVisual*)&fxcontrol.Visual(0); + CHuiVisual* fxExternalContent = fxlayout->ExternalContent(); + + if (fxlayout && IsOpaqueEffect(fxlayout->Effect())) + { + fullscreenCovered = ETrue; + } + else if (fxExternalContent && IsOpaqueEffect(fxExternalContent->Effect())) + { + fullscreenCovered = ETrue; + } + + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + iTempTotalActiveVisualCount = 0; + iTempTotalPassiveVisualCount = 0; + #endif + // skip the topmost (effect) layer, start from floating sprite group - for (TInt j=screen->iDisplay->Roster().Count() - 2; j>=0; j--) + for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) { #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER - TInt activevisualcount = 0; - TInt passivevisualcount = 0; + activevisualcount = 0; + passivevisualcount = 0; #endif CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j); CHuiControl& control = controlgroup.Control(0); + + if (control.Role() == EAlfFpsIndicatorContainer) + { + // FPS container doesn't contain canvas visuals + continue; + } + CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0); #ifdef HUI_DEBUG_TRACK_DRAWING if ( layout->Tracking() ) @@ -1609,7 +1301,7 @@ RDebug::Print(_L("CAlfBridge::HandleVisualVisibility: tracked visual 0x%x"), canvasVisual); } #endif - + // Dont mess with alf control group visuals, alf session handling does it for us // just add the rect to covered region because alf draws solid background. if (control.Role() == EAlfSessionContainer) @@ -1641,6 +1333,12 @@ TBool subTreeCovered = EFalse; TBool hasActiveVisualsInVisualTree = HandleLayoutVisualVisibility( layout, controlgroup, control, fullscreenCovered, fullscreen, screen, subTreeCovered, IsVisualOpaque(*layout) ); TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree); + + // If root visuals effect is marked as opaque, then add whole screen area as covered. + if (!fullscreenCovered) + { + fullscreenCovered = IsOpaqueEffect(layout->Effect()); + } // If we layout is active setup the fade effects. Also if it is inactive, but has been // flagged as containing fade effect, then run the setup as well so that effects which @@ -1708,23 +1406,38 @@ if (fadeEffectInScreen) { TBool firstFadedWindowGroupFound = EFalse; - for (TInt j=0; jiDisplay->Roster().Count() - 2; j++) // skip the topmost (effect) layer + for (TInt j=0; jiDisplay->Roster().Count() - screen->FixedControlGroupCount(); j++) // skip the topmost (effect) layer { CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j); CHuiControl& control = controlgroup.Control(0); - CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0); + CHuiVisual* layout = &control.Visual(0); if (layout->Effect() && (layout->Effect()->EffectFlags() & KHuiFadeEffectFlag)) { if (firstFadedWindowGroupFound) { TInt flags = layout->Effect()->EffectFlags(); - flags |= KHuiFxAlwaysBlend; + flags |= KHuiFxAlwaysBlend; // Workaround for opaque layout canvasvisual. layout->Effect()->SetEffectFlags(flags); } + + if ((controlgroup.ResourceId() == iAlfWindowGroupNodeId)) + { + // Special handling for ALF fading...fading happens via empty alf originated event window group + TInt flags = layout->Effect()->EffectFlags(); + flags |= KHuiFxEnableBackgroundInAllLayers; // This forces effect to happen to background pixels that are read from surface. + flags |= KHuiFxFrozenBackground; // To get optimal UI performance, we ignore changes in ALF scene when it is faded. + layout->Effect()->SetEffectFlags(flags); + } + firstFadedWindowGroupFound = ETrue; } } } + + AMT_FUNC_EXC(AMT_DATA()->iActiveVisualCount = iTempTotalActiveVisualCount; + AMT_DATA()->iPassiveVisualCount = iTempTotalPassiveVisualCount; + AMT_DATA()->PrintState() + ); } TBool CAlfBridge::HandleLayoutVisualVisibility( @@ -1851,9 +1564,13 @@ aScreen->iDisplay->SetDirty(); } - #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER - passivevisualcount++; - #endif + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + iTempTotalPassiveVisualCount++; + #endif + + #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER + passivevisualcount++; + #endif } else { @@ -1902,9 +1619,13 @@ { canvasVisual->SetChanged(); } - #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + iTempTotalActiveVisualCount++; + #endif + + #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER activevisualcount++; - #endif + #endif } // Finally check the area that this visual covers and add it to covered region @@ -1946,10 +1667,17 @@ iTempRegion.Tidy(); } } + + // If effect is marked as opaque, then add whole visual area as covered. + if (IsOpaqueEffect(canvasVisual->Effect())) + { + iTempRegion.AddRect(visualDisplayRect); + iTempRegion.Tidy(); + } } - } - - visualTreeActive |= visualIsActive; + visualTreeActive |= visualIsActive; + } // for loop end : children checking loop + return visualTreeActive; } @@ -1963,17 +1691,18 @@ return; CAlfScreen* screen = iAlfScreens[0]; // TODO - for (TInt j=screen->iDisplay->Roster().Count() - 2; j>=0; j--) // skip the topmost (effect) layer + for (TInt j=screen->iDisplay->Roster().Count() - screen->FixedControlGroupCount(); j>=0; j--) // skip the topmost (effect) layer { CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j); CHuiControl& control = controlgroup.Control(0); - if ( control.Role() == EAlfSessionContainer ) + if ( control.Role() == EAlfSessionContainer || + control.Role() == EAlfFpsIndicatorContainer ) { continue; } - CHuiLayout* layout = (CHuiLayout*)&control.Visual(0); + CHuiVisual* layout = &control.Visual(0); for (TInt i=layout->Count()-1; i >= 0; i--) { CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*)(&layout->Visual(i)); @@ -2046,6 +1775,16 @@ switch (data.iOp) { + case EAlfDSSynchronize: + { + TInt id = data.iInt1; + if ( iHuiEnv ) + { + iHuiEnv->Synchronize( id, this ); + } + } + break; + case EAlfDSCreateNewDisplay: { AddNewScreenL(NULL); @@ -2330,6 +2069,10 @@ iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*(iAlfScreens[aScreenNumber]->iFloatingSpriteControlGroup)); iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup)); + if ( iAlfScreens[aScreenNumber]->iFpsControlGroup ) + { + iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*(iAlfScreens[aScreenNumber]->iFpsControlGroup)); + } delete iAlfScreens[aScreenNumber]; iAlfScreens.Remove( aScreenNumber ); } @@ -2464,7 +2207,17 @@ // void CAlfBridge::DestroyWindow(CHuiVisual* aVisual, TBool aUseForce) { - if ( !aUseForce && HasActiveEffect(aVisual) ) + TInt index; + TBool visualParticipatingInEffect = HasActiveEffect(aVisual, index); + + TBool effectIsExitEffect(ETrue); + if (index != KErrNotFound) + { + effectIsExitEffect = iEffectCleanupStack[index].iHideWhenFinished; + } + // effects inside application may need to destroy window to get the new content visible. + // Even when there is effect on the layout, destruction of a child window must be allowed. + if ( !aUseForce && visualParticipatingInEffect && effectIsExitEffect ) { // this visual will be destroyed on the effect call back. __ALFFXLOGSTRING1("CAlfBridge::DestroyWindow - not destroying 0x%x", aVisual); @@ -2488,7 +2241,21 @@ // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then // application is exited. EHuiVisualFlagDrawOnlyAsExternalContent is indication that // there might be effect on this visual. It is not guaranteen. - + + if (!aUseForce) + { + // we can remove from iEffectCleanupStack only when this method was called from HandleDestroyWindow. Otherwise + // messing iEffectCleanupStack is likely to cause forever loop in some RemoveTemporaryPresenterVisuals method + for (TInt i = 0; i < iEffectCleanupStack.Count(); i++) + { + TEffectCleanupStruct& effectItem = iEffectCleanupStack[i]; + if (aVisual == effectItem.iEffectedVisual) + { + iEffectCleanupStack.Remove(i); + break; + } + } + } delete aVisual; } // --------------------------------------------------------------------------- @@ -2531,9 +2298,12 @@ // Sprite is in its own group, and can be deleted normally. if ( !controlGroup && windowAttributes->iWindowNodeType != EAlfWinTreeNodeSprite ) { - __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: group containing this visual has been destroyed.!"); - // the group containing this visual has been destroyed. Thus the visual itself has been destroyed by - // the group. Ignore this. + __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: group containing this visual has been destroyed."); + // the group containing this visual has been destroyed. + if ( viz ) + { + DestroyWindow(viz); + } } else { @@ -2594,6 +2364,9 @@ { __ALFLOGSTRING("CAlfBridge::HandleSetWindowPosL, EAlfDSSetWindowPos: Visual not found!"); } + + AMT_INC_COUNTER_IF( viz, iVisualPositionChangedCount ); + AMT_SET_VALUE_IF( viz, iLatestVisualExtentRect, TRect( windowAttributes->iPosition, windowAttributes->iSize ) ); } // --------------------------------------------------------------------------- @@ -2622,6 +2395,9 @@ __ALFLOGSTRING("CAlfBridge::HandleSetWindowSizeL, EAlfDSSetWindowSize: Visual not found!"); } iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); + + AMT_INC_COUNTER_IF(viz, iVisualSizeChangedCount ); + AMT_SET_VALUE_IF(viz, iLatestVisualExtentRect, TRect( windowAttributes->iPosition, windowAttributes->iSize ) ); } // --------------------------------------------------------------------------- @@ -2711,11 +2487,11 @@ CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber); - if (!controlGroup) - { - User::Leave(KErrNotFound); - } - + if (!controlGroup) + { + User::Leave(KErrNotFound); + } + ResolveAfterEffectAppearingApplicationL(controlGroup); // does nothing, if effect is not active on this control group // Window server nodes are in inverted Z-order, we switch it here. iAlfScreens[screenNumber]->iDisplay->Roster().Hide(*controlGroup); TInt wsWindowGroupCount = 0; @@ -2886,15 +2662,94 @@ { __ALFLOGSTRING3("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Screen: %d, Id: %d, GroupId: %d ", screenNumber, windowNodeId, windowGroupNodeId ); } +#ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT + if (iFullScreenEffectData + && iFullScreenEffectData->iEffectType != CFullScreenEffectState::ENotDefinedEffect + && !iFullScreenEffectData->iEndFullScreen) + { + TInt toAppUid; + if (iFullScreenEffectData->iEffectType == CFullScreenEffectState::EExitEffect) + { + toAppUid = iFullScreenEffectData->iFromAppId; + } + else + { + toAppUid = iFullScreenEffectData->iToAppId; + } + + CHuiControlGroup *to_group = FindControlGroupByAppId(toAppUid); + + // 1. if we get drawing commands after BeginFullScreen, we need to generate EndFullScreen call. + // 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) + { + iFullScreenEffectData->ResetTimerL(this); + iFullScreenEffectData->iDisplaySize = 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); + } + } + // END TP HACK +#endif } // --------------------------------------------------------------------------- +// HandleGfxEndFullScreenTimeout +// --------------------------------------------------------------------------- +// +void CAlfBridge::HandleGfxEndFullScreenTimeout(CFullScreenEffectState* aFullScreenEffectData) + { + if (aFullScreenEffectData->iEndFullScreen) + { + return; + } + CHuiControlGroup *to_group = FindControlGroupByAppId(aFullScreenEffectData->iToAppId); + CHuiControlGroup *from_group = FindControlGroupByAppId( aFullScreenEffectData->iFromAppId ); + CHuiLayout *to_layout = NULL; + CHuiLayout *from_layout = NULL; + if (!to_group) // group has been destroyed and moved to effectControlGroup for waiting the application exit effect EndFullScreen trigger + { + to_layout = FindLayoutByEffectHandle(aFullScreenEffectData->iHandle); + } + else + { + CHuiControl& control = to_group->Control(0); + to_layout = (CHuiLayout*)&control.Visual(0); + } + + if (from_group) + { + CHuiControl& control = from_group->Control(0); + from_layout = (CHuiLayout*)&control.Visual(0); + } + aFullScreenEffectData->iOperation = MAlfGfxEffectPlugin::EEndFullscreen; + if (to_layout) + { + // from layout may be undefined + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEndFullScreenTimeout : Enough app drawing. Trigger EndFullScreen for layout 0x%x", to_layout); + HandleGfxEventL( *aFullScreenEffectData, to_layout, from_layout ); + } + + aFullScreenEffectData->iEndFullScreen = ETrue; + } + +// --------------------------------------------------------------------------- // SetWindowActiveL // --------------------------------------------------------------------------- // void CAlfBridge::SetWindowActiveL(CHuiVisual* aVisual, TBool aActive) { - if (!HasActiveEffect(aVisual)) + TInt effectIndex; + if (!HasActiveEffect(aVisual, effectIndex)) { // Does not have effect if (aActive) @@ -2915,7 +2770,15 @@ if (aActive) { // this prevents windows appearing before their "effected" time - aVisual->SetFlag(EHuiVisualFlagShouldBeShown); + if (!iEffectCleanupStack[effectIndex].iHideWhenFinished) + { + // this is appear effect. Lets show it + aVisual->iOpacity.Set(KAlfVisualDefaultOpacity); + } + else + { + aVisual->SetFlag(EHuiVisualFlagShouldBeShown); + } aVisual->ClearFlag(EHuiVisualFlagShouldBeHidden); } else @@ -3540,6 +3403,8 @@ TBool CAlfBridge::HasActiveFadedChildren( CHuiCanvasVisual& aVisual ) { TBool has = EFalse; + has |= IsAlfOriginatedWindow(aVisual); + TInt count = aVisual.Count(); for (TInt i=0; iFlags() & EHuiVisualFlagInactive); TBool faded = child->CanvasFlags() & EHuiCanvasFlagExternalFade; - if (active && faded && child->PaintedAreaCount()) + if (active && faded && (child->PaintedAreaCount() || IsAlfOriginatedWindow(*child))) { has = ETrue; break; @@ -3587,7 +3452,7 @@ TBool otherEffectActive = aVisual.Effect() && !(aVisual.Effect()->EffectFlags() & KHuiFadeEffectFlag); // Check if we really need to fade. Note the order of if-conditions, fastest checks first to optimize performance. - if (visualIsActive && !alreadyFaded && !otherEffectActive && !IsFadedByParent(aVisual) && HasActivePaintedAreas(aVisual, fadesChildren)) + if (visualIsActive && !alreadyFaded && !otherEffectActive && !IsFadedByParent(aVisual) && (HasActivePaintedAreas(aVisual, fadesChildren) || IsAlfOriginatedWindow(aVisual))) { CHuiFxEffect* effect = NULL; CHuiFxEngine* engine = iHuiEnv->EffectsEngine(); @@ -3661,11 +3526,14 @@ { TInt windowNodeId = aData.iInt1; TBool faded = aData.iInt2; - - CHuiVisual* viz = (CHuiVisual*)FindVisual(windowNodeId); - if (!viz) + MWsWindowTreeNode::TType type = (MWsWindowTreeNode::TType)(TInt)aData.iPtr; + CHuiVisual* viz = NULL; + if (type != MWsWindowTreeNode::EWinTreeNodeGroup) { - // Visual not found, it could be window group. It must be searched with other method. + viz = (CHuiVisual*)FindVisual(windowNodeId); + } + else + { CHuiControlGroup* cg = FindControlGroup(windowNodeId, 0); // TODO: Screen if (cg) { @@ -3757,6 +3625,8 @@ { __ALFLOGSTRING1("CAlfBridge::HandleSetCursorDataL - WARNING! Cursor node 0x%x not found!", windowNodeId); } + + AMT_INC_COUNTER_IF(viz, iTotalVisualAttributeChangedCount); } // --------------------------------------------------------------------------- @@ -3840,9 +3710,11 @@ { aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue); TBool needStoredBuffers = NeedsStoredBuffers(engine, *aEvent.iEffectName); + __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - EBeginFullScreen: %d, Take screenhot: %d", aEvent.iHandle, needStoredBuffers); if (needStoredBuffers) { TRAP(err,StoreRenderBufferStartL(aToLayout)); + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EBeginFullScreen: Screenshot result: KErrNone == %d", err); if (err == KErrNone) { aToLayout->SetFreezeState(ETrue); @@ -3860,6 +3732,7 @@ { aToLayout->iOpacity.Set(0.0f); // these are meant for applications that yet dont have anything to show FreezeLayoutUntilEffectDestroyedL(aFromLayout, aEvent.iHandle); + aEvent.iEffectType = CFullScreenEffectState::EStartEffect; break; } case AknTransEffect::EApplicationStartSwitch: @@ -3867,11 +3740,13 @@ { aToLayout->iOpacity.Set(0.0f); // this is meant for applications that are in the background. FreezeLayoutUntilEffectDestroyedL(aFromLayout, aEvent.iHandle); + aEvent.iEffectType = CFullScreenEffectState::EStartEffect; break; } case AknTransEffect::EApplicationExit: { + aEvent.iEffectType = CFullScreenEffectState::EExitEffect; // The effect should start when the new view is ready, // but we have no signal telling us that, so we just have to do our best @@ -3887,16 +3762,18 @@ __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Found effect on layout 0x%x. Removing effect 0x%x", aToLayout, aToLayout->Effect()); aToLayout->SetEffect(NULL); } - if (!(aToLayout->Flags() & EHuiVisualFlagInactive)) + if ( aEvent.iAction == AknTransEffect::EApplicationExit && !(aToLayout->Flags() & EHuiVisualFlagInactive)) { // this will tag the visual, that they cannot be hidden by HandleVisualVisibility // Initialize layout for the exit effect iLayoutInitializedForExitEffect = SetupEffectLayoutContainerL(aEvent.iHandle, aToLayout, ETrue); + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EBeginFullscreen - iLayoutInitializedForExitEffect: %d", iLayoutInitializedForExitEffect); aEvent.iSetupDone = iLayoutInitializedForExitEffect; } else { iLayoutInitializedForExitEffect = EFalse; + aEvent.iSetupDone = EFalse; } return failed; } @@ -3913,18 +3790,17 @@ if ( aEvent.iAction != AknTransEffect::EApplicationExit && aToLayout->Flags() & EHuiVisualFlagInactive) { aToLayout->iOpacity.Set(1.0f); - failed = ETrue; - return failed; } if (aToLayout) { aToLayout->iOpacity.Set(1.0f); - __ALFFXLOGSTRING1("HandleGfxEventL - loading effect, handle %d", aEvent.iHandle ); + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - loading effect, handle %d", aEvent.iHandle ); if (aEvent.iAction == AknTransEffect::EApplicationExit) { - // Exit effect was initialized earlier with EBeginFullscreen event - layoutEffectable = iLayoutInitializedForExitEffect; + // Exit effect was initialized earlier with EBeginFullscreen event + layoutEffectable = aEvent.iSetupDone; + __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEventL - EEndFullScreen: %d", layoutEffectable); } else { @@ -3936,14 +3812,21 @@ } if (layoutEffectable) - { + { + TInt effectFlags = KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; + if (NeedsStoredBuffers(iHuiEnv->EffectsEngine(), *aEvent.iEffectName)) + { + // Performance improvement, but this would be better to be a special hint param in the fxml + effectFlags |= KHuiFxOpaqueHint; + } + if (aEvent.iRect != TRect()) { - TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), &aEvent.iRect, this, aEvent.iHandle ) ); + TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), &aEvent.iRect, this, aEvent.iHandle, effectFlags )); } else { - TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle ) ); + TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle, effectFlags ) ); } effect = NULL; // only use the effect if the effect file was correctly parsed @@ -3980,6 +3863,7 @@ if (aLayout) { TRAPD(err, StoreRenderBufferStartL(aLayout)); + __ALFFXLOGSTRING2("CAlfBridge::FreezeLayoutUntilEffectDestroyed - StoreRenderBufferStartL call returned: %d for layout 0x%x", err, aLayout); if (err == KErrNone) { // Freeze only, if buffer was reserved succesfully @@ -4055,78 +3939,6 @@ } } -CAlfBridge::CEffectState::CEffectState() - { - // CBase clears all variables - } - -CAlfBridge::CEffectState::~CEffectState() - { - delete iEffectName; - } - -void CAlfBridge::CEffectState::ResolveFileNameL(RMemReadStream& aStream) - { - HBufC* effectDirectory = HBufC::NewLC(aStream, 256); - HBufC* effectFile = HBufC::NewLC(aStream, 256); - - // Add one extra because we want to be able to append a number to the filename - HBufC* effectFullName = HBufC::NewL(effectDirectory->Des().Length() - + effectFile->Des().Length() + 1); - CleanupStack::PushL(effectFullName); - - effectFullName->Des().Copy(*(effectDirectory)); - effectFullName->Des().Append(*(effectFile)); - delete iEffectName; - iEffectName = effectFullName; // ownership transferred - CleanupStack::Pop(effectFullName); - CleanupStack::PopAndDestroy(2, effectDirectory); - } - -void CAlfBridge::CFullScreenEffectState::ConstructL( - TInt aAction, - RMemReadStream& aStream) - { - iAction = aAction; - - iHandle = aStream.ReadInt32L(); - - iType = aStream.ReadInt32L(); - iWg1 = aStream.ReadInt32L(); - iWg2 = aStream.ReadInt32L(); - iToAppId = aStream.ReadInt32L(); - iFromAppId = aStream.ReadInt32L(); - - if (iType == AknTransEffect::EParameterType) - { - /*screen1 =*/aStream.ReadInt32L(); - /*screen2 =*/aStream.ReadInt32L(); - } - /*TInt flags =*/ - aStream.ReadInt32L(); - iRect.iTl.iX = aStream.ReadInt32L(); - iRect.iTl.iY = aStream.ReadInt32L(); - iRect.iBr.iX = aStream.ReadInt32L(); - iRect.iBr.iY = aStream.ReadInt32L(); - - ResolveFileNameL(aStream); - - iCompletionHandle = iHandle; - } - -void CAlfBridge::CControlEffectState::ConstructL(TInt aAction, - RMemReadStream& aStream) - { - iAction = aAction; - TInt operation = aStream.ReadInt32L(); - iHandle = aStream.ReadInt32L(); - iClientHandle = aStream.ReadInt32L(); - iClientGroupHandle = aStream.ReadInt32L(); - TInt screenNumber = aStream.ReadInt32L(); // this has always value 0 - // Are Symbian full filename+directory combinations still max 256 characters long? - ResolveFileNameL(aStream); - } - // --------------------------------------------------------------------------- // HandleGfxEffectsL // --------------------------------------------------------------------------- @@ -4221,6 +4033,13 @@ __ALFFXLOGSTRING("HandleGfxEffectsL - process end"); iFullScreenEffectData->iEndFullScreen = ETrue; + +#ifdef USE_APPLICATION_ENDFULLSCREEN_TIMEOUT + if (iFullScreenEffectData->iDrawingCompleteTimer) + { + iFullScreenEffectData->iDrawingCompleteTimer->Cancel(); + } +#endif } CFullScreenEffectState* fxData = iFullScreenEffectData; @@ -4424,6 +4243,11 @@ CHuiCanvasVisual* temporaryPresenterVisual = NULL; TInt enableEffect = ETrue; + if (aSourceVisual->iOpacity.Now() >= 0.01) + { + aSourceVisual->SetFlag(EHuiVisualFlagShouldBeShown); + } + aSourceVisual->ClearFlags(EHuiVisualFlagShouldBeInactive | EHuiVisualFlagShouldBeUnderOpaqueHint); if (aIsExitEffect) { @@ -4463,7 +4287,7 @@ aSourceVisual, temporaryPresenterVisual, ETrue, - EFalse); + aIsExitEffect); iEffectCleanupStack.AppendL(item); } else @@ -4472,7 +4296,7 @@ // aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent); TEffectCleanupStruct item = TEffectCleanupStruct(aEffectHandle, aSourceVisual, NULL, EFalse, - EFalse); + aIsExitEffect); iEffectCleanupStack.AppendL(item); } } @@ -4510,6 +4334,8 @@ TBool CAlfBridge::SetupEffectLayoutContainerL(TInt aHandle,CHuiLayout* aSourceLayout, TBool aIsExitEffect) { + __ALFFXLOGSTRING3("CAlfBridge::SetupEffectLayoutContainerL - aHandle: %d, aSourceLayout: 0x%x, aIsExitEffect: % d >>", aHandle, aSourceLayout, aIsExitEffect ); + if (aSourceLayout->Flags() & EHuiVisualFlagDrawOnlyAsExternalContent) { // the requested visual is already having an effect. @@ -4533,7 +4359,7 @@ } else { - AddEffectItemL(aHandle, aSourceLayout, NULL, &effectControlGroup, ETrue, itemsDestroyed, EFalse); + AddEffectItemL(aHandle, aSourceLayout, NULL, &effectControlGroup, EFalse, itemsDestroyed, EFalse); __ALFFXLOGSTRING2("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout), NO presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout); } iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue; @@ -4573,7 +4399,6 @@ void CAlfBridge::HandleGfxControlEffectsL( TAlfBridgerData data ) { - TInt err = KErrNone; TInt action = data.iInt1; TInt length = data.iInt2; __ALFFXLOGSTRING1("HandleGfxControlEffectsL - Reading bridge data %d", (TInt)data.iPtr); @@ -4612,16 +4437,8 @@ return; } iAlfScreens[0]->iDisplay->SetDirty(); - iHuiEnv->ContinueRefresh(); - if (visual && err != KErrNone) - { - // if the effect loading failed too soon, we must call our callback ourselves - // RDebug::Print(_L("HandleGfxControlEffectsL - effect not set - going directly to callback")); - AlfGfxEffectEndCallBack(fxData->iHandle); - } - delete iControlEffectData; iControlEffectData = NULL; @@ -4675,7 +4492,7 @@ } if (layoutEffectable) { - TRAP( err, engine->LoadGroupEffectL(*aEvent.iEffectName, effect, aCanvasVisual->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle ) ); + TRAP( err, engine->LoadGroupEffectL(*aEvent.iEffectName, effect, aCanvasVisual->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle, KHuiFxDelayRunUntilFirstFrameHasBeenDrawn ) ); } else { @@ -4731,11 +4548,7 @@ sourceViz->iOpacity.Set(0.0f); sourceViz->ClearFlag(EHuiVisualFlagShouldBeHidden); // it is now hidden } - else - { - // visual may be transparent after manipulation of the effect - sourceViz->iOpacity.Set(KAlfVisualDefaultOpacity); - } + if (showVisual) { sourceViz->iOpacity.Set(KAlfVisualDefaultOpacity); @@ -4875,10 +4688,18 @@ TBool CAlfBridge::HasActiveEffect(CHuiVisual* aVisual) { + TInt dummy; + return HasActiveEffect(aVisual, dummy); + } + +TBool CAlfBridge::HasActiveEffect(CHuiVisual* aVisual, TInt& aIndex) + { + aIndex = KErrNotFound; for (TInt i = 0; i < iEffectCleanupStack.Count(); i++) { if (aVisual == iEffectCleanupStack[i].iEffectedVisual) { + aIndex = i; return ETrue; } } @@ -4935,7 +4756,10 @@ { itemsRemoved++; } - iEffectCleanupStack.Remove(i); + if (iEffectCleanupStack.Count() > i) + { + iEffectCleanupStack.Remove(i); + } iFinishedCleanupStackEffects.Remove(0); i--; } @@ -4970,7 +4794,7 @@ { // We need a delay to prevent the refresh from being messed up // We try a short delay before clearing everything up. - __ALFFXLOGSTRING1("AlfGfxEffectEndCallBack, append handle %d", aHandle ); + __ALFFXLOGSTRING1("AlfGfxEffectEndCallBack, handle %d", aHandle ); // RDebug::Print(_L("AlfGfxEffectEndCallBack, append handle %d"), aHandle ); // If the handle cannot be appended, the function returns an error. // However, if the memory is low, there is nothing we can do about it. @@ -4978,10 +4802,7 @@ // If there are already other handles in the queue, the handler will not // be called for this handle, but all handles that have been left hanging // around will be cleared when HandleGfxStopEffectsL is called - - - iFinishedEffects.Append(aHandle); - + // iFinishedCleanupStackEffects.Append(aHandle); if (!iEffectEndTimer->IsActive()) { @@ -5072,6 +4893,8 @@ { #ifdef HUI_DEBUG_TRACK_DRAWING __ALFLOGSTRING2(">> %d WINDOW GROUP (ALF), %d", i, clientWindowGroupId); +#else + __ALFLOGSTRING1(">> %d WINDOW GROUP (ALF)", i); #endif } else @@ -5087,6 +4910,8 @@ { #ifdef HUI_DEBUG_TRACK_DRAWING __ALFLOGSTRING2(">> %d ALF GROUP, %d", i, clientWindowGroupId); +#else + __ALFLOGSTRING1(">> %d ALF GROUP", i); #endif } else if (indexedGroup.Control(0).Role() == EAlfWindowFloatingSpriteContainer) @@ -5105,10 +4930,20 @@ __ALFLOGSTRING1(">> %d EFFECT GROUP", i); #endif } + else if (indexedGroup.Control(0).Role() == EAlfFpsIndicatorContainer) + { +#ifdef HUI_DEBUG_TRACK_DRAWING + __ALFLOGSTRING3(">> %d FPS GROUP %S, %d", i, &processName, clientWindowGroupId ); +#else + __ALFLOGSTRING1(">> %d FPS GROUP", i); +#endif + } else { #ifdef HUI_DEBUG_TRACK_DRAWING __ALFLOGSTRING3(">> %d UNKNOWN GROUP ?!!? %S, %d", i, &processName, clientWindowGroupId ); +#else + __ALFLOGSTRING1(">> %d UNKNOWN GROUP ?!!?", i); #endif } @@ -5146,15 +4981,16 @@ #endif #ifdef ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER -void CAlfBridge::VisualizeControlGroupOrderL(CHuiRoster& aRoster, CHuiControlGroup& /*aGroup*/) +void CAlfBridge::VisualizeControlGroupOrderL(CAlfScreen& aScreen, CHuiRoster& aRoster, CHuiControlGroup& /*aGroup*/) { TInt nbrofcolums = 3; TInt nbrofrows = 3; TInt gridIndex = 0; TBool skipEmpty = EFalse; - if (aRoster.Count() > 3) + TInt skipCount = aScreen.FixedControlGroupCount() + 1; + if (aRoster.Count() > skipCount) { - for (TInt i=aRoster.Count() - 3; i>0; i--) + for (TInt i=aRoster.Count() - skipCount; i>0; i--) { CHuiControl& control = aRoster.ControlGroup(i).Control(0); if (skipEmpty) @@ -5187,7 +5023,7 @@ iAlfScreens[0]->iDisplay->SetClearBackgroundL(CHuiDisplay::EClearWithSkinBackground); } #else -void CAlfBridge::VisualizeControlGroupOrderL(CHuiRoster& /*aRoster*/, CHuiControlGroup& /*aGroup*/) +void CAlfBridge::VisualizeControlGroupOrderL(CAlfScreen& /*aScreen*/, CHuiRoster& /*aRoster*/, CHuiControlGroup& /*aGroup*/) { } #endif @@ -5344,13 +5180,11 @@ iAlfScreens[i]->iDisplay->SetForegroundBitmapL( iAlfScreens[i]->iSwRenderingTarget ); CleanupStack::Pop(texture); iAlfScreens[i]->iDisplay->SetForegroundTexture(texture); - iAlfScreens[i]->iDisplay->iRosterObservers.AppendL(*this); } else { iAlfScreens[i]->iDisplay->SetForegroundBitmapL(NULL); iAlfScreens[i]->iDisplay->SetForegroundTexture(NULL); - iAlfScreens[i]->iDisplay->iRosterObservers.Remove(*this); } // SetCapturingBufferL is called from HandleVisualVisibility. @@ -5361,21 +5195,6 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -void CAlfBridge::UploadSwRenderingTargetL(CAlfScreen* aScreen) - { - if (iSwRenderingEnabled) - { - CHuiTexture* texture = aScreen->iDisplay->ForegroundTexture(); - if (texture && aScreen->iSwRenderingTarget) - { - texture->UploadL(*aScreen->iSwRenderingTarget, NULL); - } - } - } - -// --------------------------------------------------------------------------- -// --------------------------------------------------------------------------- -// TBool CAlfBridge::PrepareSwRenderingTarget( CAlfScreen* aScreen ) { TBool modified = EFalse; @@ -5389,7 +5208,7 @@ aScreen->iSwRenderingTarget = new CFbsBitmap; if (aScreen->iSwRenderingTarget) { - aScreen->iSwRenderingTarget->Create(aScreen->Size(), EColor16MA); + aScreen->iSwRenderingTarget->Create(aScreen->Size(), EColor16MAP); modified = ETrue; } } @@ -5496,18 +5315,39 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -void CAlfBridge::NotifyRosterDrawStart(CHuiDisplay& /*aDisplay*/) +void CAlfBridge::Synchronized(TInt aId) + { + // Use P&S for now. + RProperty::Set( KAlfPSUidSynchronizer, KAlfPSKeySynchronizer, aId ); + } + +void CAlfBridge::SetWindowGroupAsAlfApp(TInt aId) { - // Do nothing + TBool lBreak = EFalse; + + 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 = ETrue; + lBreak = ETrue; + break; + } + } + if ( lBreak ) + break; + } + } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // -void CAlfBridge::NotifyRosterDrawEnd(CHuiDisplay& aDisplay) +TBool CAlfBridge::IsAlfOriginatedWindow(CHuiCanvasVisual& aVisual) { - TInt screenNumber = ResolveScreenNumber(aDisplay); - TRAP_IGNORE(UploadSwRenderingTargetL(iAlfScreens[screenNumber])); + return (aVisual.Owner().ControlGroup()->ResourceId() == iAlfWindowGroupNodeId); } // end of file diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfeffectutils.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,505 @@ +/* +* Copyright (c) 2008 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: AlfEffectUtils contains small classes that enable layout switch and transition effects. +* +*/ +#include +#include +#include "alfeffectutils.h" +#include + + +const TInt KRosterFreezeEndTimeoutInMs = 400; +const TInt KFirstTimeoutForApplicationEndFullScreenInMs = 50; + +// --------------------------------------------------------- +// CAlfRosterFreezeEndTimer +// --------------------------------------------------------- +// +CAlfRosterFreezeEndTimer::CAlfRosterFreezeEndTimer( CAlfBridge& aBridge ) + :CTimer ( EPriorityStandard ), + iBridge( aBridge ) + { + } + +void CAlfRosterFreezeEndTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +CAlfRosterFreezeEndTimer* CAlfRosterFreezeEndTimer::NewL( CAlfBridge& aBridge ) + { + CAlfRosterFreezeEndTimer* self = new ( ELeave ) CAlfRosterFreezeEndTimer( aBridge ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CAlfRosterFreezeEndTimer::~CAlfRosterFreezeEndTimer() + { + Cancel(); + } + +void CAlfRosterFreezeEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod ) + { + if (!IsActive()) + { + After( aPeriod ); + } + } + +void CAlfRosterFreezeEndTimer::RunL() + { + iBridge.iHuiEnv->Display(0).SetDirty(); + TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); + iBridge.SetVisualTreeVisibilityChanged(ETrue); + } + +void CAlfRosterFreezeEndTimer::DoCancel() + { + CTimer::DoCancel(); + } + + + +CAlfLayoutSwitchEffectCoordinator::CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge ) : + iBridge( aBridge ), + iLayoutSwitchEffectContext(AknTransEffect::ENone) + { + RThread me = RThread(); + iOriginalPriority = me.Priority(); + me.Close(); + } + +CAlfLayoutSwitchEffectCoordinator::~CAlfLayoutSwitchEffectCoordinator() + { + } + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack +// +// This method is callback which gets called when layout +// switch effect has ended. +// --------------------------------------------------------- +// +void CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack( TInt aHandle ) + { + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack")); + if (iLayoutSwitchEffectContext == aHandle) + { + AknTransEffect::TContext nextContext = NextLayoutSwitchContext(); + + // Unfreeze visible content. This reveals real roster content (in new orientation). + if (nextContext == AknTransEffect::ELayoutSwitchExit) + { + #ifdef HUI_DEBUG_TRACK_DRAWING + RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack unfreezing roster content")); + #endif + iBridge.iHuiEnv->Display(0).SetDirty(); + TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); + iBridge.SetVisualTreeVisibilityChanged(ETrue); + } + + // Set next effect + SetLayoutSwitchEffect(nextContext); + + if (nextContext == AknTransEffect::ENone) + { + // Restore normal priority + RThread me = RThread(); + me.SetPriority(iOriginalPriority); + me.Close(); + + // Just in case refresh everything + iBridge.iHuiEnv->Display(0).SetDirty(); + } + } + else + { + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack - got different handle (normal, dont worry...) - %i"), aHandle); + } + } + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectCoordinator::Cancel +// --------------------------------------------------------- +// +void CAlfLayoutSwitchEffectCoordinator::Cancel() + { + // Disable effect + SetLayoutSwitchEffect( AknTransEffect::ENone ); + + // Unfreeze visible content + if ( iRosterFreezeEndTimer ) + { + iRosterFreezeEndTimer->Cancel(); + } + + iBridge.iHuiEnv->Display(0).SetDirty(); + TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse)); + iBridge.SetVisualTreeVisibilityChanged(ETrue); + + // Restore normal priority + RThread me = RThread(); + me.SetPriority(iOriginalPriority); + me.Close(); + } + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch +// +// This method starts the layout switch effect procedure. +// --------------------------------------------------------- +// +void CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch() + { + // Hm. what to do if earlier is already in progress ? + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch")); + if ( iBridge.iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLowest ) + { + // No effects in low memory mode + return; + } + + if (!iLayoutSwitchEffectContext) + { + TBool tfxOn = CAknTransitionUtils::TransitionsEnabled(AknTransEffect::ELayoutswitchTransitionsOff ); + TBool tfxExists = LayoutSwitchEffectsExist(); + if (tfxOn && tfxExists) + { + // Boost priority so that we are able to draw more frames for the effect + RThread me = RThread(); + me.SetPriority(EPriorityAbsoluteHigh); + me.Close(); + + // Freeze visual content + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch freezing roster content")); + iBridge.iHuiEnv->Display(0).SetDirty(); + TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue)); + + // Remove all other effects + iBridge.HandleGfxStopEvent( EFalse ); + iBridge.RemoveAllTemporaryPresenterVisuals(); + + // Set first layout switch effect + SetLayoutSwitchEffect(AknTransEffect::ELayoutSwitchStart); + } + else + { + if (!iRosterFreezeEndTimer) + { + TRAP_IGNORE(iRosterFreezeEndTimer = CAlfRosterFreezeEndTimer::NewL(iBridge)); + } + + if (iRosterFreezeEndTimer) + { + iBridge.iHuiEnv->Display(0).SetDirty(); + TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue)); + + // Remove all other effects + iBridge.HandleGfxStopEvent( EFalse ); + iBridge.RemoveAllTemporaryPresenterVisuals(); + + // Set remove freeze timer + iRosterFreezeEndTimer->Start(KRosterFreezeEndTimeoutInMs*1000); + } + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - tfx are set OFF -> I am not starting effect.")); + } + } + else + { + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - old effect exists - %i"), iLayoutSwitchEffectContext); + } + } + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext +// +// This method automatically selects the next context in the +// layout switch procedure. +// +// Contextes change in the following order during layout switch: +// +// 1. AknTransEffect::ENone +// 2. AknTransEffect::ELayoutSwitchStart +// 3. AknTransEffect::ELayoutSwitchExit +// 4. AknTransEffect::ENone +// +// After new context is selected, appropriate effect is set +// (and/or removed) from the roster. +// +// --------------------------------------------------------- +// +AknTransEffect::TContext CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext() + { + // Resolve next context based on current context + AknTransEffect::TContext newContext = AknTransEffect::ENone; + switch (iLayoutSwitchEffectContext) + { + case AknTransEffect::ENone: + { + newContext = AknTransEffect::ELayoutSwitchStart; + break; + } + case AknTransEffect::ELayoutSwitchStart: + { + newContext = AknTransEffect::ELayoutSwitchExit; + break; + } + case AknTransEffect::ELayoutSwitchExit: // fallthrough + default: + { + newContext = AknTransEffect::ENone; + break; + } + } + + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL old ctx = %i, new ctx = %i"), iLayoutSwitchEffectContext, newContext); + return newContext; + } + +// --------------------------------------------------------- +// CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffectL +// +// This method sets correct effect based on the given +// layout switch context. +// +// --------------------------------------------------------- +// +void CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffect(AknTransEffect::TContext aContext) + { + MHuiEffectable* effectable = iBridge.iHuiEnv->Display(0).Roster().Effectable(); + CHuiFxEffect* effect = NULL; + CHuiFxEngine* engine = iBridge.iHuiEnv->EffectsEngine(); + + if (!effectable || !engine) + { + return; + } + + // Update current context + iLayoutSwitchEffectContext = aContext; + + if (aContext == AknTransEffect::ENone) + { + // Just remove effect + //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL - removing effect")); + effectable->EffectSetEffect(NULL); // This calls AlfGfxEffectEndCallBack + } + else + { + // Load correct effect + for ( TInt i = 0; iLoadEffectL(*iBridge.iAlfRegisteredEffects[i].iEffectFile, effect, effectable, NULL, this, iLayoutSwitchEffectContext, 0 ) ); + break; + } + } + } + } + +TBool CAlfLayoutSwitchEffectCoordinator::LayoutSwitchEffectsExist() + { + TBool appearExists = EFalse; + TBool disAppearExists = EFalse; + + for ( TInt i = 0; iConstructL(); + CleanupStack::Pop( self ); + return self; + } + +CAlfEffectEndTimer::~CAlfEffectEndTimer() + { + Cancel(); + } + +void CAlfEffectEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod, TInt aHandle ) + { + iHandle = aHandle; + After( aPeriod ); + } + +void CAlfEffectEndTimer::RunL() + { + // + // timer completes and control is returned to caller + // + iBridge.TransitionFinishedHandlerL( iHandle ); + // We don't become active unless we are explicitly restarted + } + +void CAlfEffectEndTimer::DoCancel() + { + CTimer::DoCancel(); + } + + +CEffectState::CEffectState() + { + // CBase clears all variables + } + +CEffectState::~CEffectState() + { + delete iEffectName; + } + +void CEffectState::ResolveFileNameL(RMemReadStream& aStream) + { + HBufC* effectDirectory = HBufC::NewLC(aStream, 256); + HBufC* effectFile = HBufC::NewLC(aStream, 256); + + // Add one extra because we want to be able to append a number to the filename + HBufC* effectFullName = HBufC::NewL(effectDirectory->Des().Length() + + effectFile->Des().Length() + 1); + CleanupStack::PushL(effectFullName); + + effectFullName->Des().Copy(*(effectDirectory)); + effectFullName->Des().Append(*(effectFile)); + delete iEffectName; + iEffectName = effectFullName; // ownership transferred + CleanupStack::Pop(effectFullName); + CleanupStack::PopAndDestroy(2, effectDirectory); + } + + +CFullScreenEffectState::~CFullScreenEffectState() + { + iPaintedRegion.Close(); + if (iDrawingCompleteTimer) + { + iDrawingCompleteTimer->Cancel(); + delete iDrawingCompleteTimer; + iDrawingCompleteTimer = NULL; + } + } + + +void CFullScreenEffectState::ConstructL( + TInt aAction, + RMemReadStream& aStream) + { + iAction = aAction; + + iHandle = aStream.ReadInt32L(); + + iType = aStream.ReadInt32L(); + iWg1 = aStream.ReadInt32L(); + iWg2 = aStream.ReadInt32L(); + iToAppId = aStream.ReadInt32L(); + iFromAppId = aStream.ReadInt32L(); + + if (iType == AknTransEffect::EParameterType) + { + /*screen1 =*/aStream.ReadInt32L(); + /*screen2 =*/aStream.ReadInt32L(); + } + /*TInt flags =*/ + aStream.ReadInt32L(); + iRect.iTl.iX = aStream.ReadInt32L(); + iRect.iTl.iY = aStream.ReadInt32L(); + iRect.iBr.iX = aStream.ReadInt32L(); + iRect.iBr.iY = aStream.ReadInt32L(); + + ResolveFileNameL(aStream); + + iCompletionHandle = iHandle; + } + +TInt doNotifyDrawingTimeout( TAny* aPtr ) + { + ((CFullScreenEffectState*)aPtr)->NotifyDrawingTimeout(); + return 0; // must return something + } + +TBool CFullScreenEffectState::ResetTimerL(CAlfBridge* aBridge) + { + iBridge = aBridge; + if (!iDrawingCompleteTimer) + { + iDrawingCompleteTimer = CPeriodic::NewL( EPriorityNormal ); + iDrawingCompleteTimer->Start( + KFirstTimeoutForApplicationEndFullScreenInMs * 1000 , + KFirstTimeoutForApplicationEndFullScreenInMs * 1000 , TCallBack( doNotifyDrawingTimeout, this )); + return ETrue; + } + return EFalse; + } + +void CFullScreenEffectState::NotifyDrawingTimeout() + { + TRect b = iPaintedRegion.BoundingRect(); + if ( (b.Width() * b.Height()) > 0.75 * (iDisplaySize.iWidth * iDisplaySize.iHeight)) + { + iBridge->HandleGfxEndFullScreenTimeout(this); + delete iDrawingCompleteTimer; + iDrawingCompleteTimer = NULL; + } + } + +void CControlEffectState::ConstructL(TInt aAction, + RMemReadStream& aStream) + { + iAction = aAction; + TInt operation = aStream.ReadInt32L(); + iHandle = aStream.ReadInt32L(); + iClientHandle = aStream.ReadInt32L(); + iClientGroupHandle = aStream.ReadInt32L(); + TInt screenNumber = aStream.ReadInt32L(); // this has always value 0 + // Are Symbian full filename+directory combinations still max 256 characters long? + ResolveFileNameL(aStream); + } + diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -70,9 +70,16 @@ { iServer.Bridge()->SetBatchObserver(this); } -#ifdef ALF_DEBUG_TRACK_DRAWING + #ifdef ALF_DEBUG_TRACK_DRAWING iCommandDebugger = CAlfCommandDebug::NewL(); -#endif + #endif + + #ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + // Initiliaze global data in TLS and Open global module testing chunk and mutex + User::LeaveIfError(Dll::SetTls(new(ELeave) CAlfModuleTestDataControl())); + User::LeaveIfError(AMT_CONTROL()->OpenGlobalObjects()); + #endif + } // --------------------------------------------------------------------------- @@ -132,6 +139,11 @@ #ifdef ALF_DEBUG_TRACK_DRAWING delete iCommandDebugger; #endif + +#ifdef USE_MODULE_TEST_HOOKS_FOR_ALF + delete AMT_CONTROL(); + Dll::FreeTls(); +#endif } // --------------------------------------------------------------------------- @@ -233,6 +245,13 @@ aMessage.Complete( EAlfBridgerSendChunk ); return; } + case EAlfSynchronize: + { + iServer.Bridge()->AddData( EAlfDSSynchronize, aMessage.Int0() ); + aMessage.Complete( KErrNone ); + } + break; + default: { doComplete= ETrue; @@ -768,6 +787,10 @@ //CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText) , iSearchNode); } #endif + + AMT_INC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeCount ); + AMT_INC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeGroup), iWindowGroupNodeCount ); + AMT_INC_COUNTER_IF(node, iTotalNodeCount ); } // --------------------------------------------------------------------------- @@ -797,6 +820,10 @@ { USER_INVARIANT(); } + + AMT_DEC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeCount ); + AMT_DEC_COUNTER_IF(node && (nodeType==MWsWindowTreeNode::EWinTreeNodeGroup), iWindowGroupNodeCount ); + AMT_DEC_COUNTER_IF(node, iTotalNodeCount ); } // --------------------------------------------------------------------------- @@ -816,6 +843,8 @@ { USER_INVARIANT(); } + + AMT_INC_COUNTER_IF( node && (nodeType==MWsWindowTreeNode::EWinTreeNodeClient), iWindowNodeActivatedCount ); } // --------------------------------------------------------------------------- @@ -846,6 +875,8 @@ } #endif + AMT_INC_COUNTER_IF(node, iNodeExtentChangedCount ); + AMT_SET_VALUE_IF(node, iLatestNodeExtentRect, rect ); } // --------------------------------------------------------------------------- @@ -860,7 +891,11 @@ CAlfNode* node = FindNode( nodeId ); if ( node ) { + AMT_SET_VALUE(iAST_Temp1, node->OrdinalPosition()); + node->SiblingOrderChanged( newPos ); + + AMT_SET_VALUE(iOrdinalChange, node->OrdinalPosition() - AMT_DATA()->iAST_Temp1); } else { @@ -901,6 +936,8 @@ { USER_INVARIANT(); } + + AMT_INC_COUNTER_IF(node, iTotalNodeFlagChangedCount ); } // --------------------------------------------------------------------------- @@ -978,11 +1015,16 @@ TUint32 nodeId = (TUint32)iStream->ReadUint32L(); TRect extent = TRect(0,0,0,0); ReadRectL(extent, iStream); + TBool isDSA = (TUint32)iStream->ReadUint32L(); CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId ); if ( node && node->Window() ) { // SetSurfaceExtent is not supported for image visual node->Window()->SetSurfaceExtent( extent ); + if (isDSA) + { + node->Window()->SetLayerUsesAplhaFlag(KWindowIsDSAHost); + } } else if( node ) // this would mean that node has being orphaneded but not yet deleted { @@ -1082,6 +1124,8 @@ { USER_INVARIANT(); // attribute change for unexpected node type. new code needed! } + + AMT_INC_COUNTER_IF(node, iTotalNodeAttributeChangedCount ); } // --------------------------------------------------------------------------- // DoNodeWindowGroupChainBrokenAfterL diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -61,20 +61,14 @@ } } // --------------------------------------------------------------------------- -// OrphonMe +// OrphanMe // --------------------------------------------------------------------------- // -CAlfNode* CAlfNode::OrphonMe() +CAlfNode* CAlfNode::OrphanMe() + { - __ALFLOGSTRING1("CAlfNode::OrphonMe %d", iId); - // this window will not be used anymore by wserv and cannot be drawn into. Thus destroying the - // visual representing this node is safe. - if ( iWindow && iModel ) - { - iModel->Server().WindowMgr()->DestroyWindow( *iWindow ); - iWindow = NULL; - } - + __ALFLOGSTRING1("CAlfNode::OrphanMe %d", iId); + // Parent node has been deleted. Orphan the node: remove the parent/sibling relationship. CAlfNode* sibling = iSibling; iSibling = NULL; iParent = NULL; @@ -255,7 +249,7 @@ { CAlfNode* parentNode = iModel->FindNode( iParent->iId ); __ASSERT_DEBUG(parentNode, USER_INVARIANT()); - if (parentNode->HasChildren()) + if (parentNode && parentNode->HasChildren()) { // parent node is not added to the list // the anims, cursor and sprites directly in this parent are added to the list @@ -838,7 +832,7 @@ } // starting from the first child, loop until this one is found. - while( previousSibling->iSibling != this) + while( previousSibling && previousSibling->iSibling != this) { previousSibling = previousSibling->iSibling; } @@ -879,7 +873,7 @@ } if (iFadeState != iPostedFadeState) { - iModel->Server().Bridge()->AddData( EAlfDSSetFadeEffect, iId , iFadeState); + iModel->Server().Bridge()->AddData( EAlfDSSetFadeEffect, iId , iFadeState, (TAny*)iType); iPostedFadeState = iFadeState; } } @@ -1174,6 +1168,11 @@ CAlfNode::~CAlfNode() { __ALFLOGSTRING1("CAlfNode::~CAlfNode %d", iId); + if ( iWindow && iModel ) // just in case: the window should be deleted already + { + iModel->Server().WindowMgr()->DestroyWindow( *iWindow ); + iWindow = NULL; + } } // --------------------------------------------------------------------------- @@ -1233,11 +1232,11 @@ __ALFLOGSTRING1("My parent says, that I'm not his child :..( or no parent %d ", iParent ); } - // Orphon all the children + // Orphan all the children CAlfNode* child = iChild; while( child ) { - child = child->OrphonMe(); + child = child->OrphanMe(); } iChild = NULL; if ( iModel ) @@ -1680,6 +1679,7 @@ if ( iWindow && iModel ) { iModel->Server().WindowMgr()->DestroyWindow( *iWindow ); + iWindow = NULL; // make sure there is no double deletion } } @@ -1944,7 +1944,8 @@ iModel->Server().Bridge()->AddData( EAlfDSDestroyWindow, iGroupId, iId, - (TAny*)offset ); + (TAny*)offset ); + iWindow = 0; // just in case } RemoveDependencies( iParent->iChild ); }; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfscreen.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfscreen.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfscreen.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -48,6 +48,7 @@ _LIT8(KAlfFullScreenEffectContainerControlTag, "EFFECT"); //_LIT8(KAlfWindowGroupTemporaryRemoveControlTag, "WGTEMP"); +const TInt KAlfNumberOfFixedControlGroups = 2; // ======== MEMBER FUNCTIONS ======== @@ -163,8 +164,17 @@ _LIT(KRDSupport, "c:\\resource\\errrd" ); if (CHuiStatic::FsSession().Handle() && BaflUtils::FileExists( CHuiStatic::FsSession(), KRDSupport )) { + iFpsControlGroup = &aHuiEnv.NewControlGroupL(0xDEADBEEF + 20 + iScreenNum); // TODO + + CHuiControl* fpsCntrl = new (ELeave) CHuiControl(aHuiEnv); + CleanupStack::PushL(fpsCntrl); + fpsCntrl->ConstructL(); + fpsCntrl->SetRole(EAlfFpsIndicatorContainer); + iFpsControlGroup->AppendL(fpsCntrl); + CleanupStack::Pop(fpsCntrl); + // FPS Counter with hitchcock drawing - iFPSText = CHuiTextVisual::AddNewL(*effectCntrl, effectLayout); + iFPSText = CHuiTextVisual::AddNewL(*fpsCntrl, NULL); iFPSText->SetColor(KRgbBlue); iFPSText->SetFlag(EHuiVisualFlagManualLayout); iFPSText->SetPos(THuiRealPoint(300,20)); // could be adjusted @@ -194,6 +204,8 @@ // this deletes also control and layout delete iFloatingSpriteControlGroup; + delete iFpsControlGroup; + delete iDisplay; iControlGroups.Close(); @@ -222,3 +234,12 @@ return iVisualTreeVisibilityChanged; } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt CAlfScreen::FixedControlGroupCount() const + { + return !iFpsControlGroup ? + KAlfNumberOfFixedControlGroups : + KAlfNumberOfFixedControlGroups + 1; + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -62,7 +62,8 @@ // according to the last display. Also the new area is left there even if ConstructL() // fails(!). static_cast(Session()).SetClientDrawingArea( aRect ); - aSession.SetClientWindowGroupId( aWindowGroupId ); + aSession.SetClientWindowGroupId( aWindowGroupId ); + Session().AlfAppUi()->SetAlfAppWindowGroup(aWindowGroupId); } } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp --- a/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -610,6 +610,7 @@ case EAlfBridgerRequestDataBlock: case EAlfBridgerAsyncronousData: case EDsNotifyNativeWindowData: + case EAlfSynchronize: { server->WindowTree()->HandleMessageL( aMessage ); return; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/backgroundanim/refplugin/group/refplugin.mmp --- a/uiacceltk/hitchcock/backgroundanim/refplugin/group/refplugin.mmp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/backgroundanim/refplugin/group/refplugin.mmp Fri Mar 19 09:43:21 2010 +0200 @@ -39,7 +39,6 @@ MW_LAYER_SYSTEMINCLUDE OS_LAYER_LIBC_SYSTEMINCLUDE APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/platform/GLES2 SOURCEPATH ../src SOURCE plugin.c diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/backgroundanim/refplugin/src/shader.c --- a/uiacceltk/hitchcock/backgroundanim/refplugin/src/shader.c Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/backgroundanim/refplugin/src/shader.c Fri Mar 19 09:43:21 2010 +0200 @@ -46,7 +46,11 @@ fseek (file, 0, SEEK_END); len = ftell (file); fseek(file, 0, SEEK_SET); - + if (len<0) + { + fclose(file); + return 0; + } shaderdata = (char*)malloc(len+1); if (!shaderdata) { diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp --- a/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -26,7 +26,7 @@ typedef void* (*plugingetinterfacefunc)(int); -const TInt KRefreshTarget = 15; +const TInt KRefreshTarget = 99; _LIT(KExeCaption,"BG anim host"); static const TUint KMaxGPUMemUsage = 1024*1024*4; @@ -370,7 +370,6 @@ eglMakeCurrent( iEGLDisplay, iEGLSurface, iEGLSurface, iEGLContext ); - free(configList); free(preferredConfig); @@ -611,7 +610,7 @@ void CBgAnimHost::DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost ) { - if (iPlugin && iPlugin->receivesensordata); + if (iPlugin && iPlugin->receivesensordata) { iPlugin->receivesensordata((void*)&aChannel, aCount, aDataLost); } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF Fri Mar 19 09:43:21 2010 +0200 @@ -1508,7 +1508,7 @@ ?SetEngine@CHuiFxEffect@@QAEXPAVCHuiFxEngine@@@Z @ 1507 NONAME ; void CHuiFxEffect::SetEngine(class CHuiFxEngine *) ?SetExtRect@CHuiFxVisualLayer@@UAEXPAVTRect@@@Z @ 1508 NONAME ; void CHuiFxVisualLayer::SetExtRect(class TRect *) ?SetExtRect@CHuiFxGroupLayer@@UAEXPAVTRect@@@Z @ 1509 NONAME ; void CHuiFxGroupLayer::SetExtRect(class TRect *) - ??0CHuiFxEffectCacheEffectNode@@QAE@ABVTDesC16@@AAPAVCHuiFxEffect@@PAVMHuiEffectable@@PAVTRect@@PAVCHuiFxEngine@@@Z @ 1510 NONAME ; CHuiFxEffectCacheEffectNode::CHuiFxEffectCacheEffectNode(class TDesC16 const &, class CHuiFxEffect * &, class CHuiVisual *, class TRect *, class CHuiFxEngine *) + ??0CHuiFxEffectCacheEffectNode@@QAE@ABVTDesC16@@AAPAVCHuiFxEffect@@PAVMHuiEffectable@@PAVTRect@@PAVCHuiFxEngine@@@Z @ 1510 NONAME ABSENT; CHuiFxEffectCacheEffectNode::CHuiFxEffectCacheEffectNode(class TDesC16 const &, class CHuiFxEffect * &, class CHuiVisual *, class TRect *, class CHuiFxEngine *) ?SetExtRect@CHuiFxEffect@@QAEXPAVTRect@@@Z @ 1511 NONAME ; void CHuiFxEffect::SetExtRect(class TRect *) ?CopyParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAMPBV1@@Z @ 1512 NONAME ; void CHuiFxFilter::CopyParameterL(class TDesC16 const &, float *, class CHuiFxFilter const *) ?CopyParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAVTRgb@@PBV1@@Z @ 1513 NONAME ; void CHuiFxFilter::CopyParameterL(class TDesC16 const &, class TRgb *, class CHuiFxFilter const *) @@ -1581,4 +1581,8 @@ ?SetForegroundBitmapL@CHuiDisplay@@QAEXPAVCFbsBitmap@@@Z @ 1580 NONAME ; void CHuiDisplay::SetForegroundBitmapL(class CFbsBitmap *) ?ForegroundBitmap@CHuiDisplay@@QBEPAVCFbsBitmap@@XZ @ 1581 NONAME ; class CFbsBitmap * CHuiDisplay::ForegroundBitmap(void) const ?HasCommandBuffers@CHuiCanvasVisual@@QBEHH@Z @ 1582 NONAME ; int CHuiCanvasVisual::HasCommandBuffers(int) const + ?SkinContentChanged@CHuiS60Skin@@UAEXXZ @ 1583 NONAME ; void CHuiS60Skin::SkinContentChanged(void) + ?SkinPackageChanged@CHuiS60Skin@@UAEXW4TAknsSkinStatusPackageChangeReason@@@Z @ 1584 NONAME ; void CHuiS60Skin::SkinPackageChanged(enum TAknsSkinStatusPackageChangeReason) + ?SkinConfigurationChanged@CHuiS60Skin@@UAEXW4TAknsSkinStatusConfigurationChangeReason@@@Z @ 1585 NONAME ; void CHuiS60Skin::SkinConfigurationChanged(enum TAknsSkinStatusConfigurationChangeReason) + ?Synchronize@CHuiEnv@@QAEXHPAVMHuiSynchronizationObserver@@@Z @ 1586 NONAME ; void CHuiEnv::Synchronize(int, class MHuiSynchronizationObserver *) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF --- a/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF Fri Mar 19 09:43:21 2010 +0200 @@ -1979,4 +1979,11 @@ _ZTI15MHuiFxParameter @ 1978 NONAME _ZTV15MHuiFxParameter @ 1979 NONAME _ZNK16CHuiCanvasVisual17HasCommandBuffersEi @ 1980 NONAME + _ZN11CHuiS60Skin18SkinContentChangedEv @ 1981 NONAME + _ZN11CHuiS60Skin18SkinPackageChangedE34TAknsSkinStatusPackageChangeReason @ 1982 NONAME + _ZN11CHuiS60Skin24SkinConfigurationChangedE40TAknsSkinStatusConfigurationChangeReason @ 1983 NONAME + _ZThn28_N11CHuiS60Skin18SkinContentChangedEv @ 1984 NONAME + _ZThn28_N11CHuiS60Skin18SkinPackageChangedE34TAknsSkinStatusPackageChangeReason @ 1985 NONAME + _ZThn28_N11CHuiS60Skin24SkinConfigurationChangedE40TAknsSkinStatusConfigurationChangeReason @ 1986 NONAME + _ZN7CHuiEnv11SynchronizeEiP27MHuiSynchronizationObserver @ 1987 NONAME diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h Fri Mar 19 09:43:21 2010 +0200 @@ -146,6 +146,7 @@ _LIT(KLitVisualBottom, "visual.bottom" ); // bottom y coordinate _LIT(KLitVisualLeft, "visual.left" ); // left x coordinate _LIT(KLitVisualRight, "visual.right" ); // right x coordinate +_LIT(KLitDisplayHeightMinusVisualTop, "visual.top.reversed"); _LIT(KLitDisplayWidth, "screen.width" ); _LIT(KLitDisplayHeight, "screen.height" ); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h Fri Mar 19 09:43:21 2010 +0200 @@ -29,15 +29,38 @@ class MHuiEffectable; // Hui Effect Flags // The flags must be 1 bit flags to allow several to be set simultaneously (if needed) -const TInt KHuiFlagsNone = 0x00000000; -const TInt KHuiFadeEffectFlag = 0x00000001; +const TInt KHuiFlagsNone = 0x0; + +/** Effect is system fade effect */ +const TInt KHuiFadeEffectFlag = 0x1; + +/** Effect does not use margins. It is clipped inside its area. */ const TInt KHuiFxEffectDisableMarginsFlag = 0x2; + +/** Effect is not applied to children visuals. */ const TInt KHuiFxEffectExcludeChildrenFlag = 0x4; + +/** Effect is grouped and syncronized with other effect(s)*/ const TInt KHuiFxWaitGroupSyncronization = 0x8; + +/** Effect duration is started after it has first time been drawn. */ const TInt KHuiFxDelayRunUntilFirstFrameHasBeenDrawn = 0x10; + +/** Background pixels are not read even if effect would be applied to background. */ const TInt KHuiFxDisableBackground = 0x20; + +/** Effect content is composited using blending even if normally it would require other mode */ const TInt KHuiFxAlwaysBlend = 0x40; +/** Effect content is marked to produce opaque content on the screen. This can be used to avoid drawing unnecessarely under the effect area. */ +const TInt KHuiFxOpaqueHint = 0x80; + +/** Background pixels are read for every layer. This is used for fading legacy ALF content only. */ +const TInt KHuiFxEnableBackgroundInAllLayers = 0x100; + +/** 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; + class MAlfGfxEffectObserver { public: diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h Fri Mar 19 09:43:21 2010 +0200 @@ -62,6 +62,7 @@ }; MHuiFxEffectCacheNode *Find(MHuiFxEffectCacheNode *aNode); + MHuiFxEffectCacheNode *FindDuplicate(MHuiFxEffectCacheNode *aNode); static bool Compare(MHuiFxEffectCacheNode *aNode1, MHuiFxEffectCacheNode *aNode2); void Remove(RPointerArray &aEffects, MHuiFxEffectCacheNode *aNode); void Remove(RHashMap &aMap, MHuiFxEffectCacheNode *aNode); @@ -85,7 +86,7 @@ class CHuiFxEffectCacheEffectNode : public CBase, public MHuiFxEffectCacheNode { public: - IMPORT_C CHuiFxEffectCacheEffectNode(const TDesC &aFileName, CHuiFxEffect *&aEffect, MHuiEffectable *aVisual, TRect *extRect, CHuiFxEngine *aEngine) + 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) { } IMPORT_C ~CHuiFxEffectCacheEffectNode(); void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle ); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h Fri Mar 19 09:43:21 2010 +0200 @@ -155,6 +155,10 @@ TInt iBuffersInUse; private: + + TBool FxmlUsesInput1(CHuiFxEffect& aEffect); + +private: // Render buffer management --- native implementations virtual CHuiFxRenderbuffer* AcquireNativeRenderbuffer(const TSize& aDesiredSize) = 0; virtual void ReleaseNativeRenderbuffer(CHuiFxRenderbuffer* aBuffer) = 0; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h Fri Mar 19 09:43:21 2010 +0200 @@ -52,6 +52,8 @@ CHuiFxLayer& Layer(TInt aIndex) const; void FxmlVisualInputs(RArray &aArray); virtual void EnableMarginApplyChildren(TBool aEnable); + virtual void SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels); + protected: IMPORT_C CHuiFxGroupLayer(); IMPORT_C void ConstructL(TBool aIsRoot); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h Fri Mar 19 09:43:21 2010 +0200 @@ -79,6 +79,10 @@ virtual TBool IsSemitransparent() const; virtual void FxmlVisualInputs(RArray &aArray) { } + + TBool AlwaysReadSurfacePixels() const; + virtual void SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels); + protected: IMPORT_C CHuiFxLayer(); IMPORT_C void ConstructL( THuiFxLayerType aType ); @@ -95,6 +99,7 @@ TBool iAnimated; TBool iTransformed; TBool iMarginEnabled; + TBool iAlwaysReadSurfacePixels; }; #endif /*HUIFXLAYER_*/ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.h Fri Mar 19 09:43:21 2010 +0200 @@ -51,7 +51,7 @@ EReferencePointExtRectBottom, EReferencePointExtRectLeft, EReferencePointExtRectRight, - + EReferencePointDisplayHeightMinusVisualTop }; class MHuiFxParameter diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/HuiRenderSurface.h --- a/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderSurface.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderSurface.h Fri Mar 19 09:43:21 2010 +0200 @@ -104,6 +104,12 @@ virtual void SwapBuffers() = 0; /** + * Synchronizes the context. All rendering calls for the currently bound context are guaranteed + * to be executed, when thsi method returns. + */ + virtual void Finish() = 0; + + /** * Binds a texture to the surface to be used during subsequent drawing * operations. * diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/huicanvaswspainter.h --- a/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswspainter.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswspainter.h Fri Mar 19 09:43:21 2010 +0200 @@ -196,6 +196,9 @@ void DestroyBuffer(TInt aIndex); void UpdateBufferUpdateRegions(TPoint aPos); + void RemoveBuffersWithMovedDisplayRect(); + void ModifyBuffersWithChangedDisplayRect(); + public: void EnableRenderBufferIfNeeded(TBool aEnable); private: @@ -379,6 +382,9 @@ #ifdef HUI_DEBUG_TRACK_DRAWING CAlfCommandDebug* iCommandDebugger; #endif + + // Boolean flag indicating if render buffer ought to be used. + TBool iEnableRenderBuffer; }; #endif // __HUICANVASWSPAINTER_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/inc/huiextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uiacceltk/hitchcock/coretoolkit/inc/huiextension.h Fri Mar 19 09:43:21 2010 +0200 @@ -0,0 +1,71 @@ +/* +* 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 extensions +* +*/ + + + +#ifndef __HUIEXTENSION_H__ +#define __HUIEXTENSION_H__ + + +#include + +class CFbsBitmap; + +// Uid for Partial Bitmap Upload extension +// THuiTexturePartialBitmapUploadParams used as parameter. +const TUid KHuiTexturePartialBitmapUploadUid = { 0x2002C359 }; + +// Parameter structure for Partial Bitmap Upload extension +struct THuiTexturePartialBitmapUploadParams + { + // Input parameters + + TRect iRect; + CFbsBitmap* iBitmap; + + // Output parameters + + TInt iErrorCode; + }; + +// Uid for Query visual extension +const TUid KHuiVisualQueryUid = { 0x2002C36B }; + +// Parameter structure for Query visual extension +struct THuiVisualQueryParams + { + enum TQueryType + { + // iResult contains canvas flags + EQueryCanvasFlags, + // iResult contains positive value if external content drawing enabled, 0 otherwise. + EQueryExternalContentDrawingEnabled, + // iResult contains positive value if this has something to draw, 0 otherwise. + EQueryHasDrawableContent + }; + + // Query type (in) + TQueryType iQueryType; + + // Result of query (out) + TInt iValue; + + // Error code (out). This should be filled with KErrNotSupported by caller and visual should modify to KErrNone. + TInt iResult; + }; + +#endif // __HUIEXTENSION_H__ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h Fri Mar 19 09:43:21 2010 +0200 @@ -150,6 +150,11 @@ void SetDimmingFog(const TRgb& aColor, TReal32 aAmount) __SOFTFP; /** + * Clear rect using the current pen color + */ + void Clear(const TRect& aRect); + + /** * Clear using the current pen color. */ void Clear(); @@ -553,7 +558,8 @@ /** Default fill and stroke paint */ VGPaint iPaint; - + TUint32 iPaintColor; + /** Gradient fill paint */ VGPaint iGradientPaint; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10PBufferSurface.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10PBufferSurface.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10PBufferSurface.h Fri Mar 19 09:43:21 2010 +0200 @@ -118,6 +118,12 @@ void SwapBuffers(); /** + * Synchronizes the context. All rendering calls for the currently bound context are guaranteed + * to be executed, when thsi method returns. + */ + void Finish(); + + /** * Binds a texture to the surface to be used during subsequent drawing * operations. */ diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderSurface.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderSurface.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderSurface.h Fri Mar 19 09:43:21 2010 +0200 @@ -65,6 +65,8 @@ virtual void SwapBuffers(); + virtual void Finish(); + virtual void BindTexture(TInt aTextureUnit, const MHuiSegmentedTexture& aTexture, TInt aSegment); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Texture.h --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Texture.h Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Texture.h Fri Mar 19 09:43:21 2010 +0200 @@ -31,6 +31,7 @@ #include "uiacceltk/HuiTextureHandle.h" #include "HuiVg10RenderPlugin.h" +struct THuiTexturePartialBitmapUploadParams; #ifdef __NVG #include class CNvgEngine; @@ -236,6 +237,11 @@ * Make sure the shadow texture is of the proper dimensions. */ void UpdateShadowSizeL(const TSize& aSize); + + /** + * Partial bitmap upload. + */ + void PartialBitmapUpload(THuiTexturePartialBitmapUploadParams* aParams); /** The render plugin that created this texture. */ CHuiVg10RenderPlugin& iRenderPlugin; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -300,6 +300,8 @@ iArcPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 2, 7, VG_PATH_CAPABILITY_APPEND_TO); iPaint = vgCreatePaint(); + iPaintColor = 0; + vgSetColor(iPaint, iPaintColor); iGradientPaint = vgCreatePaint(); iBlendMode = VG_BLEND_SRC_OVER; @@ -707,6 +709,42 @@ // Fog not supported } +void CHuiVg10Gc::Clear(const TRect& aRect) + { + HUI_VG_INVARIANT(); + + UpdateClientMatrix(); + + THuiRealRect transformed = aRect; + iMatrixStack->Current().Multiply(transformed.iTl); + iMatrixStack->Current().Multiply(transformed.iBr); + + // Normalize the rectangle + if (transformed.iTl.iX > transformed.iBr.iX) + { + TReal32 tmp = transformed.iTl.iX; + transformed.iTl.iX = transformed.iBr.iX; + transformed.iBr.iX = tmp; + } + if (transformed.iTl.iY > transformed.iBr.iY) + { + TReal32 tmp = transformed.iTl.iY; + transformed.iTl.iY = transformed.iBr.iY; + transformed.iBr.iY = tmp; + } + VGfloat scale = 1.0f / 255.0f; + VGfloat color[] = + { + PenColor().Red() * scale, + PenColor().Green() * scale, + PenColor().Blue() * scale, + PenAlpha() * scale + }; + + vgSetfv(VG_CLEAR_COLOR, 4, color); + vgClear(transformed.iTl.iX, transformed.iTl.iY, transformed.Width(), transformed.Height()); + HUI_VG_INVARIANT(); + } void CHuiVg10Gc::Clear() { @@ -941,7 +979,12 @@ #endif // Update the color of the current paint - vgSetColor(iPaint, color); + // if required + if (iPaintColor != color) + { + vgSetColor(iPaint, color); + iPaintColor = color; + } // Detect white fully opaque color if (color == 0xffffffff) @@ -1050,7 +1093,7 @@ vgTranslate(-srcX, -srcY); #ifdef __NVG - if ( isExtended && texture.IsNvgContent()) + if ( isExtended ) { // Determine the size to which we want to draw the NVG icon paths TSize contentSize( HUI_ROUND_FLOAT_TO_INT(aDestRect.Width()), @@ -1163,7 +1206,7 @@ const CHuiVg10Texture& texture = static_cast( aTexture ); TBool isExtended = texture.IsExtended(); - if (isExtended && texture.IsNvgContent()) + if (isExtended) { UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE); TSize contentSize(0, 0); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10PBufferSurface.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10PBufferSurface.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10PBufferSurface.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -409,6 +409,10 @@ // Pbuffers consist of a single buffer only (no front/back buffers to swap). } +void CHuiVg10PBufferSurface::Finish() + { + vgFinish(); + } void CHuiVg10PBufferSurface::BindTexture(TInt aTextureUnit, const MHuiSegmentedTexture& aTexture, diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderSurface.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderSurface.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderSurface.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -185,6 +185,9 @@ EGLint attriblist[] = { EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE, +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS + EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER, +#endif EGL_NONE }; attriblistPtr = &attriblist[0]; @@ -296,6 +299,10 @@ eglSwapBuffers(iEglDisplay, iEglSurface); } +void CHuiVg10RenderSurface::Finish() + { + vgFinish(); + } void CHuiVg10RenderSurface::BindTexture(TInt /*aTextureUnit*/, const MHuiSegmentedTexture& aTexture, diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp --- a/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -30,6 +30,8 @@ #include "uiacceltk/HuiUtil.h" #include "uiacceltk/HuiPanic.h" +#include "huiextension.h" + // temporary hack until the openvg headers are fixed.. #ifndef OPENVG_VERSION_1_0_1 #warning using temporary hack to define OPENVG_VERSION_1_0_1, see TSW: SKYA-7QQB8 @@ -878,7 +880,17 @@ void CHuiVg10Texture::TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters) { - CHuiTexture::TextureExtension(aExtensionUid, aExtensionParameters); + if ( aExtensionUid == KHuiTexturePartialBitmapUploadUid && + aExtensionParameters && *aExtensionParameters ) + { + THuiTexturePartialBitmapUploadParams* params = + static_cast(*aExtensionParameters); + PartialBitmapUpload(params); + } + else + { + CHuiTexture::TextureExtension(aExtensionUid, aExtensionParameters); + } } void CHuiVg10Texture::EnableShadow(TBool aEnable) @@ -1003,6 +1015,70 @@ HUI_VG_INVARIANT(); } +void CHuiVg10Texture::PartialBitmapUpload(THuiTexturePartialBitmapUploadParams* aParams) + { + if ( !aParams->iBitmap || !aParams->iBitmap->Handle() || + aParams->iBitmap->DisplayMode() != EColor16MAP ) + { + // Only specific format supported. + aParams->iErrorCode = KErrArgument; + return; + } + + if ( SegmentCount() != 1 || ((VGImage)SegmentName(0)) == VG_INVALID_HANDLE || + Size() != aParams->iBitmap->SizeInPixels() ) + { + // You must perform initial upload using normal methods. + aParams->iErrorCode = KErrNotReady; + return; + } + + //TRect segmentRect(SegmentSize(0)); + TRect segmentRect(Size()); + TRect rect(aParams->iRect); + rect.Intersection(segmentRect); + + if ( rect != aParams->iRect ) + { + // Rect must be fully within segment rect + aParams->iErrorCode = KErrArgument; + return; + } + + aParams->iErrorCode = KErrNone; + + if ( rect.IsEmpty() ) + { + // Nothing to upload. + return; + } + + PushEGLContext(); + aParams->iBitmap->BeginDataAccess(); + + const TInt scanLineLength = CFbsBitmap::ScanLineLength( + aParams->iBitmap->SizeInPixels().iWidth, EColor16MAP); + const TInt bytesPerPixel = 4; + + TUint8* dataAddress = (TUint8*)aParams->iBitmap->DataAddress(); + dataAddress += rect.iTl.iX * bytesPerPixel; + dataAddress += rect.iTl.iY * scanLineLength; + + vgImageSubData( + (VGImage)SegmentName(0), // image + dataAddress, // data + scanLineLength, // dataStride + VG_sARGB_8888_PRE, // dataFormat + rect.iTl.iX, // x + rect.iTl.iY, // y + rect.Width(), // width + rect.Height() // height + ); + + aParams->iBitmap->EndDataAccess( ETrue ); + PopEGLContext(); + } + #ifdef __NVG HBufC8* CHuiVg10Texture::ReadNVGDataL(const CFbsBitmap& aBitmap) { @@ -1082,7 +1158,7 @@ image = CreateRenderedImage(&nvgEngine, dataBuf, Size()); // New functionality for checking the mask - if (header.GetBitmapId() != maskHeader.GetBitmapId() && + if (header.GetBitmapId() != maskHeader.GetBitmapId() && maskDataBuf && CompareNvgData(dataBuf, maskDataBuf) != 0) { VGImage maskImg = VG_INVALID_HANDLE; @@ -1436,14 +1512,13 @@ TSize CHuiVg10Texture::ApplyMargin(VGImage aImage, TSize aSize, EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext) { HUI_VG_INVARIANT(); - // If the icon is also a current EGL surface, the getImageSubData - // won't succeed and return "image in use" -error.. - if ( eglMakeCurrent( aDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT ) == EGL_FALSE ) - { - HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL NO_Surface could not be made current, eglErr: %04x"), eglGetError()); - return aSize; - } - + #ifdef __WINSCW__ + if ( eglMakeCurrent( aDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT ) == EGL_FALSE ) + { + HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL NO_Surface could not be made current, eglErr: %04x"), eglGetError()); + return aSize; + } + #endif #ifndef __WINS__ // Should possibly query the supported mode instead? VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE; #else @@ -1470,7 +1545,7 @@ TReal R = 1.0; TInt HaN = Ha; - const TInt lastColumn = aSize.iHeight - 1; + const TInt lastColumn = aSize.iWidth - 1; for (TInt curRow = 0; curRow < lValidMargin; curRow++) { const TInt y = (aSize.iHeight - 1) - curRow; // h - 1 is the last line @@ -1492,14 +1567,14 @@ } delete buf; HUI_VG_INVARIANT(); - + #ifdef __WINSCW__ // Make the PBuffer surface current again - if ( eglMakeCurrent(aDisplay, aSurface, aSurface, aContext) == EGL_FALSE ) - { - HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL aSurface could not be made current, eglErr: %04x"), eglGetError()); - return aSize; - } - + if ( eglMakeCurrent(aDisplay, aSurface, aSurface, aContext) == EGL_FALSE ) + { + HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL aSurface could not be made current, eglErr: %04x"), eglGetError()); + return aSize; + } + #endif // If icon size has to be changed, clear out old area for new DrawNVG round! if(aSize.iHeight > HaN) { diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiAnchorLayout.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiAnchorLayout.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiAnchorLayout.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -713,7 +713,9 @@ Mem::FillZ(anchor, sizeof(*anchor)); } } - + + ASSERT(anchor); + TEdgeAnchor* edge(NULL); TAxis& axis = anchor->Axis(axisId); error = axis.AddEdge(edgeProximity, edge); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiAnimatedTexture.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiAnimatedTexture.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiAnimatedTexture.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -56,7 +56,7 @@ EXPORT_C MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture() { - return this; + return iTexture; } @@ -68,7 +68,7 @@ EXPORT_C const MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture() const { - return this; + return iTexture; } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -285,6 +285,8 @@ CHuiCanvasTextImage::~CHuiCanvasTextImage() { + delete iText; + iText = NULL; } TBool CHuiCanvasTextImage::UseColorModulation() const @@ -1099,8 +1101,6 @@ TBool volatileBitmapOrMask = ETrue; #endif - TBool originalMaskUsed = ETrue; - TInt bitmapHandle = aImage.iBitmapHandle; TInt maskHandle = aImage.iMaskHandle; @@ -1199,7 +1199,6 @@ mask = invertedMask; CleanupStack::PushL(mask); - originalMaskUsed = EFalse; } // Upload expects mask to begin always at TPoint(0,0), so if mask @@ -1218,7 +1217,6 @@ } mask = movedMask; CleanupStack::PushL(mask); - originalMaskUsed = EFalse; } #ifdef __NVG } @@ -2191,6 +2189,7 @@ iSearchedGraphicImageEntry->iBitmapTouchCount = KHuiInitialBitmapTouchCount; iSearchedGraphicImageEntry->iMaskTouchCount = KHuiInitialBitmapTouchCount; iSearchedGraphicImageEntry->iGcParams = aCachedImageParams.iGcParams; + iSearchedGraphicImageEntry->iCache = this; cachedEntry = iCachedImages.FindInOrder(iSearchedGraphicImageEntry, ImageOrderFunc); if (cachedEntry == KErrNotFound) @@ -2219,6 +2218,7 @@ iSearchedGraphicImageEntry->Reset(); iSearchedGraphicImageEntry->iGcParams = aGcParams; iSearchedGraphicImageEntry->iImageSize = aImageSize; + iSearchedGraphicImageEntry->iCache = this; for (TInt i=0; iiBitmapTouchCount = KHuiInitialBitmapTouchCount; iSearchedGraphicImageEntry->iMaskTouchCount = KHuiInitialBitmapTouchCount; iSearchedGraphicImageEntry->iGcParams = aCachedImageParams.iGcParams; + iSearchedGraphicImageEntry->iCache = this; cachedEntry = iCachedImages.FindInOrder(iSearchedGraphicImageEntry, ImageOrderFunc); if (cachedEntry == KErrNotFound) { // Create new entry object CHuiCanvasGraphicImage* newEntry = new (ELeave) CHuiCanvasGraphicImage; - CleanupStack::PushL(newEntry); + CleanupStack::PushL(newEntry); newEntry->CopyAttributes(*iSearchedGraphicImageEntry); @@ -2311,7 +2312,7 @@ User::LeaveIfError(iCachedImages.InsertInOrder(newEntry, ImageOrderFunc)); cachedEntry = iCachedImages.FindInOrder(newEntry, ImageOrderFunc); CleanupStack::Pop(newEntry); - needUpdate = ETrue; + needUpdate = ETrue; } else { diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -46,6 +46,9 @@ #include "HuiFxEffect.h" #include "HuiCmdBufferBrush.h" +#include "huiextension.h" + +#include "huiwscanvascommands.h" /** Flag to convienintly disable/enable canvas render buffer usage if needed */ /* Turned to EFalse as DFS77 was having booting problems in wk26 */ @@ -93,7 +96,9 @@ void CHuiCanvasVisual::ConstructL() { CHuiLayout::ConstructL(); - + + SetFlags(EHuiVisualFlagWserv); + iCanvasVisualData = new (ELeave) THuiCanvasVisualData; iCanvasVisualData->iCommandSetType = ECommandBufferWs; iCanvasVisualData->iCanvasFlags = 0; @@ -101,13 +106,13 @@ iCanvasVisualData->iParentCanvas = NULL; iCanvasVisualData->iBackground = NULL; iCanvasVisualData->iCanvasPainter = NULL; + iCanvasVisualData->iStoredRenderBuffer = 0; iCanvasVisualData->iBackground = CHuiCanvasBackground::NewL(); iCanvasVisualData->iBackground->SetVisual(this); iCanvasVisualData->iCanvasPainter = CHuiCanvasWsPainter::NewL(); iCanvasVisualData->iCanvasPainter->SetVisual(this); - iCanvasVisualData->iStoredRenderBuffer = 0; TBool useCanvasRenderBuffer = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces); iCanvasVisualData->iCanvasPainter->EnableRenderBuffer(useCanvasRenderBuffer); @@ -116,26 +121,34 @@ iCanvasVisualData->iLayerExtent = TRect(); // subwindow effects - EnableBrushesL(ETrue); + //EnableBrushesL(ETrue); } CHuiCanvasVisual::~CHuiCanvasVisual() { - FreeRenderBuffer(); - if(iCanvasVisualData->iExternalContentVisual) - { - // Allow the external content visual to be drawn normally - iCanvasVisualData->iExternalContentVisual->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent); - } - + + FreeRenderBuffer(); if (iCanvasVisualData) { + if(iCanvasVisualData->iExternalContentVisual) + { + // Allow the external content visual to be drawn normally + iCanvasVisualData->iExternalContentVisual->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent); + } ClearCommandSet(); - delete iCanvasVisualData->iBackground; - iCanvasVisualData->iBackground = NULL; - delete iCanvasVisualData->iCanvasPainter; - iCanvasVisualData->iCanvasPainter = NULL; + if ( iCanvasVisualData->iBackground ) + { + delete iCanvasVisualData->iBackground; + iCanvasVisualData->iBackground = NULL; + } + if ( iCanvasVisualData->iCanvasPainter ) + { + delete iCanvasVisualData->iCanvasPainter; + iCanvasVisualData->iCanvasPainter = NULL; + } + + iCanvasVisualData->iExternalContentVisual = NULL; // Tell parent that we are destructed @@ -299,6 +312,31 @@ } +TBool CHuiCanvasVisual::CanSkipDrawing() const + { + TBool semiTranparentEffectActive = (Effect() && Effect()->IsSemitransparent()); + TBool childWindowEffectActive = (Effect() && EffectIsAppliedToChildren()); + TBool invisible = (iOpacity.Now() <= EPSILON && !semiTranparentEffectActive); + TBool effectAppliedToSurfacePixels = (Effect() && (Effect()->EffectFlags() & KHuiFxEnableBackgroundInAllLayers)); + + if( invisible || + (!HasCommandBuffers(ETrue /*include children*/) && + !childWindowEffectActive && + !IsBackgroundDrawingEnabled() && + !IsExternalContentDrawingEnabled()&& + !IsExternalContentDrawingEnabled(ETrue /*include children*/) && + !effectAppliedToSurfacePixels + + )) + { + return ETrue; + } + else + { + return EFalse; + } + } + void CHuiCanvasVisual::Draw(CHuiGc& aGc) const { if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent) @@ -311,35 +349,25 @@ } } - TBool semiTranparentEffectActive = (Effect() && Effect()->IsSemitransparent()); - TBool childWindowEffectActive = (Effect() && EffectIsAppliedToChildren()); - TBool invisible = (iOpacity.Now() <= EPSILON && !semiTranparentEffectActive); - - if( invisible || - (!HasCommandBuffers(ETrue /*include children*/) && - !childWindowEffectActive && - !IsBackgroundDrawingEnabled() && - !IsExternalContentDrawingEnabled()&& - !IsExternalContentDrawingEnabled(ETrue /*include children*/) - - )) + // Optimization + if (CanSkipDrawing()) { - // This will not be visible due to being completely transparent, or the visual does not actually draw anything - - // However, the draw should continue, if the effect is possibly manipulating the opacity of the visual. See CHuiFxVisualLayer::Draw. return; } if ((IsDelayedEffectSource() || Freezed())) { + // Select right draw mode + THuiCanvasDrawMode drawMode = (Flags() & EHuiVisualFlagOpaqueHint) ? EHuiCanvasDrawModeNormal : EHuiCanvasDrawModeBlend; + if (StoredRenderBuffer()) { - DrawStoredFullScreenRenderBuffer(aGc); + DrawStoredFullScreenRenderBuffer(drawMode, aGc); return; } else if (iCanvasVisualData->iStoredRenderBuffer) { - DrawStoredVisualRenderBuffer(); + DrawStoredVisualRenderBuffer(drawMode); return; } } @@ -383,26 +411,25 @@ TBool transparent = EFalse; transparent |= (!(Flags() & EHuiVisualFlagOpaqueHint)); // Does not have opaque hint -> always transparent transparent |= iOpacity.Now() < 1.0f; // Opacity less than 1.0f -> always transparent - + TBool refreshCache = EFalse; if (EffectIsAppliedToChildren()) { refreshCache |= ChildTreeChanged(EHuiCanvasFlagExcludeFromParentEffect); + + iCanvasVisualData->iPaintedRegion.Clear(); + CollectRecursivePaintedRegion(iCanvasVisualData->iPaintedRegion, EHuiCanvasFlagExcludeFromParentEffect); } else { - refreshCache |= Changed(); - } - - // TODO: We could update this somewhere else, not here everytime - iCanvasVisualData->iPaintedRegion.Clear(); - TInt paintedAreaCount = PaintedAreaCount(); - for (TInt i=0; iiPaintedRegion.AddRect( CanvasPaintedArea(i).iPaintedRect.Round() ); + refreshCache |= Changed(); + + iCanvasVisualData->iPaintedRegion.Clear(); + CollectPaintedRegion(iCanvasVisualData->iPaintedRegion, 0); } didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion); + } if ( !didDrawEffect ) @@ -490,16 +517,19 @@ } } - if ((IsDelayedEffectSource() || Freezed())) + if (IsContentDrawingEnabled() && (IsDelayedEffectSource() || Freezed())) { + // Select right draw mode + THuiCanvasDrawMode drawMode = (Flags() & EHuiVisualFlagOpaqueHint) ? EHuiCanvasDrawModeNormal : EHuiCanvasDrawModeBlend; + if (StoredRenderBuffer()) { - DrawStoredFullScreenRenderBuffer(aGc); + DrawStoredFullScreenRenderBuffer(drawMode, aGc); return; } else if (iCanvasVisualData->iStoredRenderBuffer) { - DrawStoredVisualRenderBuffer(); + DrawStoredVisualRenderBuffer(drawMode); return; } } @@ -590,20 +620,26 @@ const TInt count = Count(); for(TInt i = 0; i < count; ++i) { - // This cast is not really safe, but dynamic cast is slow - CHuiCanvasVisual* visual = (CHuiCanvasVisual*) iHuiLayoutPrivateData->iChildren[i]; + CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i]; + //Ignore inactive child visuals if ((visual->Flags()& EHuiVisualFlagInactive)) { continue; } - if (aIncludeCanvasFlags && !(visual->CanvasFlags()& aIncludeCanvasFlags)) + TInt canvasFlags = 0; + if (aIncludeCanvasFlags || aExcludeCanvasFlags) + { + canvasFlags = visual->QueryCanvasFlags(); + } + + if (aIncludeCanvasFlags && !(canvasFlags & aIncludeCanvasFlags)) { continue; } - if (aExcludeCanvasFlags && (visual->CanvasFlags()& aExcludeCanvasFlags)) + if (aExcludeCanvasFlags && (canvasFlags & aExcludeCanvasFlags)) { continue; } @@ -649,34 +685,50 @@ return hasChanged; } -TBool CHuiCanvasVisual::ChildTreeChanged(TInt aExcludeCanvasFlags) const +// Goes through visual hierarchy and checks if any visual has changed. +// This method does not modify any visuals. Parameter is not const +// because of CanvasVisual method. +TBool CHuiCanvasVisual::RecursiveChildTreeChanged(CHuiVisual* aVisual, TInt aExcludeCanvasFlags) { - // CHuiLayout::Changed() does not check children. - // This utility method checks whole child tree below this visual. TBool changed = EFalse; // Check wheter we should include this visual or igonre it. if (aExcludeCanvasFlags) { - if (!(iCanvasVisualData->iCanvasFlags & aExcludeCanvasFlags)) + if ( !(aVisual->Flags() & EHuiVisualFlagInactive) ) { - changed |= Changed(); + TInt canvasFlags = aVisual->QueryCanvasFlags(); + + if ( !(canvasFlags & aExcludeCanvasFlags) ) + { + changed |= aVisual->Changed(); + } } } - const TInt count = Count(); - for(TInt i = 0; i < count; ++i) + if ( !changed ) { - CHuiCanvasVisual* visual = (CHuiCanvasVisual*) iHuiLayoutPrivateData->iChildren[i]; - changed |= visual->ChildTreeChanged(aExcludeCanvasFlags); - if (changed) + const TInt count = aVisual->Count(); + for(TInt i = 0; i < count; ++i) { - break; + CHuiVisual* visual = &aVisual->Visual(i); + changed |= RecursiveChildTreeChanged( visual, aExcludeCanvasFlags ); + if ( changed ) + { + break; + } } } - return changed; + return changed; } +TBool CHuiCanvasVisual::ChildTreeChanged(TInt aExcludeCanvasFlags) const + { + // CHuiLayout::Changed() does not check children. + // This utility method checks whole child tree below this visual. + return RecursiveChildTreeChanged( + const_cast(this), aExcludeCanvasFlags); + } EXPORT_C void CHuiCanvasVisual::ClearChanged() { @@ -747,8 +799,11 @@ EXPORT_C void CHuiCanvasVisual::ClearCommandSet() { - iCanvasVisualData->iCanvasPainter->ClearCommandSet(); - SetChanged(); + if ( iCanvasVisualData->iCanvasPainter ) + { + iCanvasVisualData->iCanvasPainter->ClearCommandSet(); + SetChanged(); + } } #ifdef HUI_DEBUG_TRACK_DRAWING @@ -815,6 +870,7 @@ if (aCommandType == ECommandBufferAlf) { + ClearFlags(EHuiVisualFlagWserv); delete iCanvasVisualData->iCanvasPainter; iCanvasVisualData->iCanvasPainter = NULL; iCanvasVisualData->iCommandSetType = ECommandBufferAlf; @@ -823,6 +879,7 @@ } else if (aCommandType == ECommandBufferWs) { + SetFlags(EHuiVisualFlagWserv); delete iCanvasVisualData->iCanvasPainter; iCanvasVisualData->iCanvasPainter = NULL; iCanvasVisualData->iCommandSetType = ECommandBufferWs; @@ -983,6 +1040,31 @@ return drawContent; } +// Goes through visual hierarchy and checks if any visual has external content drawing enabled. +TBool CHuiCanvasVisual::RecursiveIsExternalContentDrawingEnabled(CHuiVisual* aVisual) + { + TBool drawExternalContent = EFalse; + + const TInt count = aVisual->Count(); + for(TInt i = 0; i < count; ++i) + { + CHuiVisual* visual = &aVisual->Visual(i); + drawExternalContent |= visual->QueryExternalContentDrawingEnabled(); + if ( drawExternalContent ) + { + break; + } + + drawExternalContent |= RecursiveIsExternalContentDrawingEnabled( visual ); + if ( drawExternalContent ) + { + break; + } + } + + return drawExternalContent; + } + TBool CHuiCanvasVisual::IsExternalContentDrawingEnabled(TBool aIncludeChildren) const { TBool drawExternalContent = EFalse; @@ -990,13 +1072,10 @@ { drawExternalContent = ETrue; } - if (aIncludeChildren) + if (aIncludeChildren && !drawExternalContent) { - for (TInt i=0; !drawExternalContent && iIsExternalContentDrawingEnabled(ETrue); - } + drawExternalContent |= RecursiveIsExternalContentDrawingEnabled( + const_cast(this)); } return drawExternalContent; } @@ -1055,6 +1134,12 @@ EXPORT_C void CHuiCanvasVisual::SetLayerUsesAlphaFlag(TBool aEnabled) { + if (aEnabled == KWindowIsDSAHost) + { + iCanvasVisualData->iCanvasFlags |= EHuiCanvasFlagDisableCanvasContent; + ClearCommandSet(); + return; + } iCanvasVisualData->iLayerUsesAlphaFlag = aEnabled; } @@ -1118,7 +1203,8 @@ } else // background surface was removed { - EnableTransformationL(EFalse); + iCanvasVisualData->iCanvasFlags &= (~EHuiCanvasFlagDisableCanvasContent); + //EnableTransformationL(EFalse); } } @@ -1154,17 +1240,39 @@ } } -void CHuiCanvasVisual::DrawStoredVisualRenderBuffer() const +void CHuiCanvasVisual::DrawStoredVisualRenderBuffer(TInt aCanvasDrawMode) const { CHuiCanvasGc& gc = CanvasGc(); + CHuiCanvasVisual* visual = NULL; + TBool transparent = EffectiveOpacity() < 1.0f; + gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); + if (transparent) + { + gc.EnableEffectiveOpacity(ETrue); + visual = gc.Visual(); + gc.SetVisual(*this); + gc.SetDrawMode(EHuiCanvasDrawModeBlend); + } THuiRealPoint dest_point = DisplayRect().iTl; CHuiCanvasRenderBuffer *stored = iCanvasVisualData->iStoredRenderBuffer; + gc.DrawImage(*stored, dest_point); + if (transparent) + { + gc.SetVisual(*visual); + gc.EnableEffectiveOpacity(EFalse); + } } -void CHuiCanvasVisual::DrawStoredFullScreenRenderBuffer(CHuiGc& aGc) const +void CHuiCanvasVisual::DrawStoredFullScreenRenderBuffer(TInt aCanvasDrawMode, CHuiGc& aGc) const { if (!Display()) return; + if (!iHuiLayoutPrivateData->iGc) + { + CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); + // deleted in CHuiLayout destructor or CHuiCanvasVisual::FreeRenderBuffer when not needed anymore + iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL(); + } CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc; gc.SetGc(aGc); gc.SetDefaults(); @@ -1182,8 +1290,23 @@ THuiRealPoint dest_point = DisplayRect().iTl; CHuiCanvasRenderBuffer *stored = StoredRenderBuffer(); - gc.DrawImage(*stored, dest_point); - + TBool transparent = EffectiveOpacity() < 1.0f; + CHuiCanvasVisual* visual = NULL; + gc.SetDrawMode((THuiCanvasDrawMode)aCanvasDrawMode); + if (transparent) + { + + gc.EnableEffectiveOpacity(ETrue); + visual = gc.Visual(); + gc.SetVisual(*this); + gc.SetDrawMode(EHuiCanvasDrawModeBlend); + } + gc.DrawImage(*stored, dest_point); + if (transparent) + { + gc.SetVisual(*visual); + gc.EnableEffectiveOpacity(EFalse); + } gc.PopTransformationMatrix(); } @@ -1195,24 +1318,47 @@ { delete iCanvasVisualData->iStoredRenderBuffer; iCanvasVisualData->iStoredRenderBuffer = NULL; + delete iHuiLayoutPrivateData->iGc; + iHuiLayoutPrivateData->iGc = NULL; } } } +// Goes through visual hierarchy and checks if any visual has command buffers +// or other drawable content. +TBool CHuiCanvasVisual::RecursiveHasCommandBuffers(CHuiVisual* aVisual) + { + TBool hasCommandBuffers = EFalse; + + const TInt count = aVisual->Count(); + for(TInt i = 0; i < count; ++i) + { + CHuiVisual* visual = &aVisual->Visual(i); + // If visual is a canvas one, then QueryHasDrawableContent returns + // HasCommandBuffers(EFalse) + hasCommandBuffers |= visual->QueryHasDrawableContent(); + if ( hasCommandBuffers ) + { + break; + } + + hasCommandBuffers |= RecursiveHasCommandBuffers( visual ); + if ( hasCommandBuffers ) + { + break; + } + } + + return hasCommandBuffers; + } + EXPORT_C TBool CHuiCanvasVisual::HasCommandBuffers(TBool aIncludeChildren) const { TBool hasCommandBuffers = iCanvasVisualData->iCanvasPainter->HasCommandBuffers(); - if (aIncludeChildren) + if (aIncludeChildren && !hasCommandBuffers) { - for (TInt i=0; iHasCommandBuffers(aIncludeChildren); - if (hasCommandBuffers) - { - break; - } - } + // Include children branch - just check if there is something to draw. + hasCommandBuffers |= RecursiveHasCommandBuffers(const_cast(this)); } return hasCommandBuffers; } @@ -1267,4 +1413,74 @@ return THuiLayoutChildRectLayoutUpdateNeeded; } +void CHuiCanvasVisual::VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams) + { + if (aExtensionUid == KHuiVisualQueryUid && aExtensionParams && *aExtensionParams) + { + THuiVisualQueryParams* params = static_cast(*aExtensionParams); + switch (params->iQueryType) + { + case THuiVisualQueryParams::EQueryCanvasFlags: + params->iValue = CanvasFlags(); + params->iResult = KErrNone; + break; + case THuiVisualQueryParams::EQueryExternalContentDrawingEnabled: + params->iValue = IsExternalContentDrawingEnabled(EFalse); + params->iResult = KErrNone; + break; + case THuiVisualQueryParams::EQueryHasDrawableContent: + params->iValue = HasCommandBuffers(EFalse) || IsBackgroundDrawingEnabled(); + params->iResult = KErrNone; + break; + default: + break; + } + } + else + { + CHuiVisual::VisualExtension(aExtensionUid, aExtensionParams); + } + } +void CHuiCanvasVisual::CollectPaintedRegion(TRegion& aPaintRegion, TInt aExcludeCanvasFlags) const + { + // Only our own painted areas. + TInt paintedAreaCount = PaintedAreaCount(); + for (TInt i=0; iFlags() & EHuiVisualFlagInactive) ) + { + TInt canvasFlags = visual->QueryCanvasFlags(); + + if ( !(canvasFlags & aExcludeCanvasFlags) ) + { + // If this is marked as Wserv visual, it should be safe to cast. + if (visual->Flags() & EHuiVisualFlagWserv) + { + CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*)visual; + canvasVisual->CollectRecursivePaintedRegion(aRecursivePaintRegion, aExcludeCanvasFlags); + } + } + } + } + } + aRecursivePaintRegion.Tidy(); + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiCmdBufferBrush.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiCmdBufferBrush.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCmdBufferBrush.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -167,7 +167,10 @@ CHuiCanvasRenderBuffer* renderbuffer = NULL; renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(*iVisual); - iCanvasGc.ClearRenderBuffer(*renderbuffer, aRectangle /*TRect(0,0,iVisual->DisplayRect().Size().iWidth, iVisual->DisplayRect().Size().iHeight)*/); + if (renderbuffer) + { + iCanvasGc.ClearRenderBuffer(*renderbuffer, aRectangle /*TRect(0,0,iVisual->DisplayRect().Size().iWidth, iVisual->DisplayRect().Size().iHeight)*/); + } } void CHuiCmdBufferBrush::DrawDrawingCommands(TInt aAction, CHuiGc &aGc, TRect aClippingRectangle, TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf, const TRegion ®) const diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiControlGroup.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiControlGroup.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiControlGroup.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -29,7 +29,7 @@ #include "uiacceltk/HuiEnv.h" CHuiControlGroup::CHuiControlGroup(TInt aResourceId, CHuiEnv& aEnv) - : iResourceId(aResourceId), iEnv(aEnv), iAcceptInput(ETrue), iOpacity( 1.f ) + : iResourceId(aResourceId), iEnv(aEnv), iAcceptInput(ETrue), iOpacity( 1.f ),iAlfApp(EFalse) { HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION HUI_PROBE_REPORT_CONSTRUCTED @@ -48,22 +48,29 @@ CHuiControlGroup::~CHuiControlGroup() - { - iUnhandledEventObservers.Close(); + { + + + iEnv.RemoveTheControlGroup(iResourceId); - // The group owns the controls, so it must destroy them. - // Destroy in reverse order so that references will be removed in - // natural order (children of a pane will be removed before the pane). - for(TInt i = iControls.Count() - 1; i >= 0; --i) - { - CHuiControl* c = iControls[i]; - iControls.Remove(i); - delete c; - } - iControls.Reset(); + iUnhandledEventObservers.Close(); + + // The group owns the controls, so it must destroy them. + // Destroy in reverse order so that references will be removed in + // natural order (children of a pane will be removed before the pane). + for(TInt i = iControls.Count() - 1; i >= 0; --i) + { + CHuiControl* c = iControls[i]; + iControls.Remove(i); + delete c; + } + iControls.Reset(); + + delete iTransform; + iTransform = NULL; + HUI_PROBE_REPORT_DESTRUCTED + - delete iTransform; - HUI_PROBE_REPORT_DESTRUCTED } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -48,6 +48,7 @@ #include #include "huiskinbackroundlayout.h" #include "HuiFxEngine.h" +#include "huiextension.h" const TUid KHuiInternalFbsBitmapBufferGcUid = {0x2000e5a3}; @@ -932,6 +933,7 @@ if (iForegroundTexture) { + UpdateForegroundTexture(dirtyRect); DrawForegroundTexture(); } @@ -1525,10 +1527,8 @@ } break; case EClearWithSkinBackground: - TRect skinRect; - TRect dummy; - GetRectForItem(item.SkinBackground(), dummy, skinRect); backgroundTexture = s60skin->BackgroundTexture(item.SkinBackground()); + TRect skinRect = s60skin->SkinRect(item.SkinBackground()); if (backgroundTexture) { THuiImage background(*backgroundTexture); @@ -1622,6 +1622,30 @@ return iForegroundTexture; } +void CHuiDisplay::UpdateForegroundTexture(const TRect& aRect) + { + if (iForegroundTexture && iForegroundBitmap && !aRect.IsEmpty()) + { + TRAP_IGNORE(DoUpdateForegroundTextureL(aRect)); + } + } + +void CHuiDisplay::DoUpdateForegroundTextureL(const TRect& aRect) + { + // First try to upload with faster mechanism + THuiTexturePartialBitmapUploadParams params; + params.iErrorCode = KErrNotSupported; + params.iRect = aRect; + params.iBitmap = iForegroundBitmap; + TAny* ptr = ¶ms; + + MHuiTexture* texture = iForegroundTexture; + texture->TextureExtension(KHuiTexturePartialBitmapUploadUid, &ptr); + if ( params.iErrorCode != KErrNone ) + { + iForegroundTexture->UploadL(*iForegroundBitmap, NULL); + } + } void CHuiDisplay::DrawForegroundTexture() { diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiEnv.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiEnv.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiEnv.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -47,6 +47,8 @@ #include "huicanvastexturecache.h" #include "HuiFxEngine.h" +#include "huisynchronizationobserver.h" + #define HUI_HIRES_TIMER @@ -1069,6 +1071,8 @@ } } + DoSynchronize(); + iCurrentDisplay = NULL; // informs the egosystem that the drawing is done. CHuiStatic::ReportNewFrame(); @@ -1762,3 +1766,64 @@ { return iMemoryLevel; } + +EXPORT_C void CHuiEnv::Synchronize(TInt aId, MHuiSynchronizationObserver* aObserver) + { + iSynchObserver = aObserver; + iSynchId = aId; + + if ( aObserver ) + { + ContinueRefresh(); + } + } + +void CHuiEnv::DoSynchronize() + { + if ( !iSynchObserver ) + { + return; + } + + // Synchronize commands before signalling through P&S + for(TInt i = 0; i < iDisplays.Count(); ++i) + { + if ( ( iDisplays[i]->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer ) + && ( iDisplays[i]->ScreenBufferObserver() == NULL ) ) + { + MakeCurrent(*iDisplays[i]); + iDisplays[i]->RenderSurface().Finish(); + } + } + + iSynchObserver->Synchronized( iSynchId ); + iSynchObserver = NULL; + } + +void CHuiEnv::RemoveTheControlGroup(TInt aId) + { + TInt i; + + for(i = 0; i < iLoadedGroups.Count(); ++i) + { + if(iLoadedGroups[i]->ResourceId() == aId) + { + // This is control group to delete. + CHuiControlGroup* group = iLoadedGroups[i]; + CancelCommands(group); + + for (TInt ii = iDisplays.Count()-1; ii>=0; ii--) + { + TInt index = iDisplays[ii]->Roster().Find(group); + if (index != KErrNotFound) + { + iDisplays[ii]->Roster().Hide(iDisplays[ii]->Roster().ControlGroup(index)); + } + } + + iLoadedGroups.Remove(i); + + } + } + } + diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -238,6 +238,12 @@ { iRoot->EnableMargin(EFalse); } + + // Check if surface pixels are to be used for this effect in all layers. + if (EffectFlags() & KHuiFxEnableBackgroundInAllLayers) + { + iRoot->SetAlwaysReadSurfacePixels(ETrue); + } iRoot->SetTargetRect(targetArea); iRoot->SetSourceRect(targetArea); @@ -257,8 +263,15 @@ // Background has not been disabled with a effect specific flag TBool enableBackground = IsAppliedToBackground() && (!aOpaque || iRoot->IsMarginEnabled()) && !(EffectFlags() & KHuiFxDisableBackground); + if (EffectFlags() & KHuiFxEnableBackgroundInAllLayers) + { + enableBackground = ETrue; + } + + TBool useFrozenBackground = (EffectFlags() & KHuiFxFrozenBackground); + // Check if cache is up-to date or does it need to be refreshed - TBool cachedRenderTargetNeedsRefresh = (iRoot->Changed() || aRefreshCachedRenderTarget || enableBackground); + TBool cachedRenderTargetNeedsRefresh = (iRoot->Changed() || aRefreshCachedRenderTarget || (enableBackground && !useFrozenBackground)); // Try to apply also margins, we cannot just use aDisplayRect directly TRect targetRect = iRoot->VisualRect(); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -63,11 +63,17 @@ void CHuiFxEffectCache::CreateL(MHuiFxEffectCacheNode *aNode) { // registration of fxml file MHuiFxEffectCacheNode *cachedNode = Find(aNode); + MHuiFxEffectCacheNode *dupNode = FindDuplicate(aNode); if (cachedNode) { // found in cache => duplicate registration => no need to do anything cachedNode->Ref(1); delete aNode; } + else if (dupNode) + { // found same file already being loaded + dupNode->Ref(1); + delete aNode; + } else { // not found in cache, so insert it and start parsing the effect. TInt id = UniqueId(); @@ -119,14 +125,14 @@ TInt count = cachedNode->Ref(-1); if (count == 0) { + Remove(iCachedEffects, cachedNode); delete cachedNode; - Remove(iCachedEffects, cachedNode); } } if (cachedNode != aNode) { // this node was not found in iCachedEffects array, so it needs to be in iDuplicateEffects array + Remove(iDuplicateEffects, aNode); delete aNode; - Remove(iDuplicateEffects, aNode); } } @@ -161,6 +167,19 @@ } return 0; } +MHuiFxEffectCacheNode *CHuiFxEffectCache::FindDuplicate(MHuiFxEffectCacheNode *aNode) + { + TInt size = iDuplicateEffects.Count(); + for(TInt i=0;i is not supported.", &(aNode->NodeName())); break; } @@ -1075,6 +1075,10 @@ { ref = EReferencePointDisplayHeight; } + else if ( paramRef.Compare( KLitDisplayHeightMinusVisualTop ) == 0 ) + { + ref = EReferencePointDisplayHeightMinusVisualTop; + } else if ( paramRef.Compare( KLitDisplayTop ) == 0 ) { ref = EReferencePointDisplayTop; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -77,6 +77,26 @@ return EFalse; #endif } + +TBool CHuiFxEngine::FxmlUsesInput1(CHuiFxEffect& aEffect) + { + RArray array; + aEffect.FxmlVisualInputs(array); + + TInt c = array.Count(); + for(TInt i = 0; iSetEffectEndObserver( aEffectEndObserver, aHandle ); - aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; node->SetEffectFlags( aFlags ); CleanupStack::PushL(node); iCache->FindOrCreateL(node); // takes ownership @@ -206,7 +225,6 @@ aFlags |= KHuiFxWaitGroupSyncronization; node->SetEffectGroup(aGroup); } - aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn; node->SetEffectFlags( aFlags ); CleanupStack::PushL(node); @@ -347,6 +365,12 @@ CHuiDisplay* display = &CHuiStatic::Env().PrimaryDisplay(); return display->VisibleArea().Size().iHeight; // was DefaultRenderbuffer()->Size().iHeight } + case EReferencePointDisplayHeightMinusVisualTop: + { + CHuiDisplay* display = &CHuiStatic::Env().PrimaryDisplay(); + TReal32 height = display->VisibleArea().Size().iHeight; // was DefaultRenderbuffer()->Size().iHeight + return height; + } default: break; } @@ -566,6 +590,11 @@ TBool CHuiFxEngine::HasActiveEffects() const { + // Don't report active effects if in SW-rendering mode + if(iLowGraphicsMemoryMode) // != Normal + { + return EFalse; + } return iActiveEffects.Count() > 0; } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -190,6 +190,14 @@ { return; } + + // Make sure background is enabled if needed. + if (AlwaysReadSurfacePixels()) + { + backBuffer->EnableBackground(ETrue); + backBuffer->PrepareForReuse(backBuffer->Size()); + } + sourceBuffer = backBuffer; // Translate the graphics context so that the content appears in the correct place @@ -447,3 +455,12 @@ iLayers[i]->FxmlVisualInputs(aArray); } } + +void CHuiFxGroupLayer::SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels) + { + CHuiFxLayer::SetAlwaysReadSurfacePixels(aAlwaysReadSurfacePixels); + for( TInt i=0 ; i < iLayers.Count() ; i++ ) + { + iLayers[i]->SetAlwaysReadSurfacePixels(aAlwaysReadSurfacePixels); + } + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -188,3 +188,13 @@ { return EFalse; } + +TBool CHuiFxLayer::AlwaysReadSurfacePixels() const + { + return iAlwaysReadSurfacePixels; + } + +void CHuiFxLayer::SetAlwaysReadSurfacePixels(TBool aAlwaysReadSurfacePixels) + { + iAlwaysReadSurfacePixels = aAlwaysReadSurfacePixels; + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxParameterManager.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxParameterManager.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxParameterManager.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -216,6 +216,13 @@ // the bottom right corner of a rect is actually outside the rect aDefaultValue = aVisualRect.iBr.iX; break; + case EReferencePointDisplayHeightMinusVisualTop: + { + TReal32 height = aEngine.GetReferenceValue( aRef ); // this will be display.height + height -= aVisualRect.iTl.iY; + aDefaultValue = height; + break; + } default: // This will return reference points that depend on display size aDefaultValue = aEngine.GetReferenceValue( aRef ); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -300,10 +300,29 @@ // if seems wiser to do the translation first, otherwise the results seem to be unpredictable. // Translation - if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f) + TReal32 translationX = 0.0f; + TReal32 translationY = 0.0f; + TReal32 translationZ = 0.0f; + + if (iTranslationX != 0.0f) + { + translationX = iTranslationX - iVisual->EffectDisplayRect().iTl.iX; + } + if (iTranslationY != 0.0f) { - aGc.Translate(EHuiGcMatrixModel, iTranslationX, iTranslationY, iTranslationZ); + translationY = iTranslationY - iVisual->EffectDisplayRect().iTl.iY; } + + if (iTranslationZ != 0.0f) + { + // Z translation not supported by the model + translationZ = iTranslationZ; + } + + if (translationX != 0.0f || translationY != 0.0f || translationZ != 0.0f) + { + aGc.Translate(EHuiGcMatrixModel, translationX, translationY, translationZ); + } // Scaling if (iScaleX != 1.0f || iScaleY != 1.0f || iScaleZ != 1.0f) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiLayout.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiLayout.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiLayout.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -56,8 +56,7 @@ { CHuiVisual::ConstructL(); iHuiLayoutPrivateData = new (ELeave) THuiLayoutPrivateData; - CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); - iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL(); + iHuiLayoutPrivateData->iGc = NULL; } @@ -74,6 +73,7 @@ } iHuiLayoutPrivateData->iChildren.Reset(); delete iHuiLayoutPrivateData->iGc; + iHuiLayoutPrivateData->iGc = NULL; delete iHuiLayoutPrivateData; } } @@ -311,12 +311,8 @@ TInt count = Count(); for(TInt i = 0; i < count; ++i) { - //Ignore inactive child visuals - if ( iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagInactive ) - { - continue; - } - UpdateChildLayout(i, aTransitionTime); + // size and positio changes must go also to inactive visuals + UpdateChildLayout(i, aTransitionTime); } CHuiVisual::UpdateChildrenLayout(aTransitionTime); @@ -687,7 +683,7 @@ TInt count = Count(); for(TInt i = 0; i < count; ++i) { - if (Flags() & EHuiVisualFlagInactive) + if (iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagInactive) { // No need to clear inactive children continue; @@ -1120,6 +1116,13 @@ void CHuiLayout::DrawStoredBitmap(CHuiGc &aGc) const { if (!Display()) return; + + if (!iHuiLayoutPrivateData->iGc) + { + CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer(); + // deleted in destructor or CHuiCanvasVisual::FreeRenderBuffer when not needed anymore + iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL(); + } CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc; gc.SetGc(aGc); gc.SetDefaults(); diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -527,10 +527,12 @@ TInt j = 0; CHuiDisplay* display = aDisplay ? aDisplay : iDisplay; + + ASSERT(display!=NULL); if (iCanvasRenderBuffer && iCanvasGc) { - DrawSelfFrozen(aGc, aDisplay); + DrawSelfFrozen(aGc, display); return; } @@ -1214,13 +1216,11 @@ for(TInt i = 0; i < visualCount; ++i) { // Ignore inactive visuals - if ( entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive ) + if ( !(entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive) ) { - continue; - } - - // This will clear the change flags of the entire tree of visuals. - entry.iRootVisuals[i]->ClearChanged(); + // This will clear the change flags of the entire tree of visuals. + entry.iRootVisuals[i]->ClearChanged(); + } } } } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -72,7 +72,9 @@ if (iSkinSrvConnected) iSkinSrvSession.Close(); - delete iBackgroundBitmap; + delete iBackgroundBitmap; + iCachedSkinItems.ResetAndDestroy(); + iCachedSkinItems.Close(); } @@ -135,33 +137,45 @@ void CHuiS60Skin::UpdateBackgroundL() { - if(iBackgroundTexture) - { - iBackgroundTexture->Reset(); - delete iBackgroundTexture; - iBackgroundTexture = 0; - } - - HUI_DEBUG1(_L("CHuiS60Skin::UpdateBackgroundL - Free memory in the beginning: %i"), HuiUtil::FreeMemory()); - iBackgroundTexture = CreateSkinBackgroundL(KAknsIIDQsnBgScreen); - iBackgroundTexture->SetSkinContent(ETrue); - iBackgroundTexture->iContentObservers.AppendL(*this); - + if(!iBackgroundTexture) + { + iBackgroundTexture = CreateSkinBackgroundL(KAknsIIDQsnBgScreen); + iBackgroundTexture->SetSkinContent(ETrue); + iBackgroundTexture->iContentObservers.AppendL(*this); + } + else if(iSkinChanged) + { + iBackgroundTexture->Reset(); + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + iBackgroundBitmap = CHuiStatic::GetBgBitmapLC(KAknsIIDQsnBgScreen); + CleanupStack::Pop(iBackgroundBitmap); + // update iBackgroundRect as well + TRect dummy; + GetRectForItem(KAknsIIDQsnBgScreen, dummy, iBackgroundRect); + iBackgroundTexture->UploadL(*iBackgroundBitmap,NULL,EHuiTextureUploadFlagRetainResolution ); + iBackgroundTexture->SetSkinContent(ETrue); + } + else + { + // there should be already up-to-date background texture + } HUI_DEBUG1(_L("CHuiS60Skin::UpdateBackgroundL - Free memory at exit: %i"), HuiUtil::FreeMemory()); } -void CHuiS60Skin::SkinContentChanged() +EXPORT_C void CHuiS60Skin::SkinContentChanged() { iSkinChanged = ETrue; } -void CHuiS60Skin::SkinConfigurationChanged( +EXPORT_C void CHuiS60Skin::SkinConfigurationChanged( const TAknsSkinStatusConfigurationChangeReason aReason ) { } -void CHuiS60Skin::SkinPackageChanged( + +EXPORT_C void CHuiS60Skin::SkinPackageChanged( const TAknsSkinStatusPackageChangeReason aReason ) { @@ -213,11 +227,12 @@ EXPORT_C void CHuiS60Skin::NotifyDisplaySizeChangedL() { // The background is now different. - iReloadBackground = ETrue; SkinContentChanged(); // for changing the iSkinChanged flag Env().NotifySkinChangedL(); Env().TextStyleManager().NotifyDisplaySizeChangedL(); ReloadBgTexturesL(); + + iSkinChanged = EFalse; } @@ -300,8 +315,9 @@ delete bgTexture.iBackgroundTexture; bgTexture.iBackgroundTexture = NULL; } - ((TPrivData*)(iSpare))->iBackgrounds.Reset(); + ((TPrivData*)(iSpare))->iBackgrounds.Reset(); + iCachedSkinItems.ResetAndDestroy(); // reset cached bg images & rects } @@ -317,47 +333,82 @@ MAknsSkinInstance* skin = SkinInstance(); CHuiTexture* texture = CHuiTexture::NewL(); - CleanupStack::PushL(texture); - if(iSkinChanged) - { - - delete iBackgroundBitmap; - iBackgroundBitmap = NULL; - - if (skin) - { - TRect dummy; - TRect skinRect; - GetRectForItem(aID, dummy, skinRect); - - iBackgroundBitmap = new (ELeave) CFbsBitmap(); - User::LeaveIfError( iBackgroundBitmap->Create(skinRect.Size(), EColor64K) ); - - CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iBackgroundBitmap); - CleanupStack::PushL(device); + CleanupStack::PushL(texture); - CFbsBitGc* gc = 0; - User::LeaveIfError( device->CreateContext(gc) ); - CleanupStack::PushL(gc); - iSkinControlContext->SetRect(skinRect); - iSkinControlContext->SetBitmap(aID); - - AknsDrawUtils::DrawBackground(skin, iSkinControlContext, NULL, *gc, TPoint(0,0), skinRect, - KAknsDrawParamDefault); - - CleanupStack::PopAndDestroy(gc); - CleanupStack::PopAndDestroy(device); + if (skin) + { + TRect skinrect; + TRect dummy; + GetRectForItem(aID, dummy, skinrect); + + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(bitmap); + User::LeaveIfError( bitmap->Create(skinrect.Size(), EColor64K) ); + + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(bitmap); + CleanupStack::PushL(device); + + CFbsBitGc* gc = 0; + User::LeaveIfError( device->CreateContext(gc) ); + CleanupStack::PushL(gc); + iSkinControlContext->SetRect(skinrect); + iSkinControlContext->SetBitmap(aID); + + AknsDrawUtils::DrawBackground(skin, iSkinControlContext, NULL, *gc, TPoint(0,0), skinrect, + KAknsDrawParamDefault); + + CleanupStack::PopAndDestroy(gc); + CleanupStack::PopAndDestroy(device); + + texture->UploadL(*bitmap,NULL,EHuiTextureUploadFlagRetainResolution ); + CleanupStack::PopAndDestroy(bitmap); + } + else + { + CFbsBitmap* bitmap = SearchCachedSkinItemBitmap(aID); + if(iSkinChanged || !bitmap) + { + TRect skinrect; + TRect dummy; + GetRectForItem(aID, dummy, skinrect); + + if( aID == KAknsIIDQsnBgScreen) // handle normal background id differently + { + delete iBackgroundBitmap; + iBackgroundBitmap = NULL; + bitmap = CHuiStatic::GetBgBitmapLC(aID); + CleanupStack::Pop(bitmap); + iBackgroundBitmap = bitmap; + iBackgroundRect = skinrect; + } + else // others are cached in skin item array + { + bitmap = CHuiStatic::GetBgBitmapLC(aID); + TInt index = SearchCachedSkinItemIndex(aID); + if( index == KErrNotFound ) // add new + { + CSkinItem* newSkinItem = new (ELeave) CHuiS60Skin::CSkinItem(); + CleanupStack::PushL(newSkinItem); + newSkinItem->iId = aID; + newSkinItem->iSkinRect = skinrect; + newSkinItem->iBitmap = bitmap; + User::LeaveIfError(iCachedSkinItems.Append(newSkinItem)); + CleanupStack::Pop(newSkinItem); + } + else // modify existing + { + iCachedSkinItems[index]->iSkinRect = skinrect; + delete iCachedSkinItems[index]->iBitmap; + iCachedSkinItems[index]->iBitmap = NULL; + iCachedSkinItems[index]->iBitmap = bitmap; + } + CleanupStack::Pop(bitmap); + } } - else - { - iBackgroundBitmap = CHuiStatic::GetBgBitmapLC(aID); - CleanupStack::Pop( iBackgroundBitmap ); - } - } - texture->UploadL(*iBackgroundBitmap,NULL,EHuiTextureUploadFlagRetainResolution ); - + texture->UploadL(*bitmap,NULL,EHuiTextureUploadFlagRetainResolution ); + } + CleanupStack::Pop(texture); - iSkinChanged = EFalse; return texture; } @@ -368,6 +419,8 @@ // no need to render the skin backgrounds separately on bitgdi return; } + iCachedSkinItems.ResetAndDestroy(); // reset cached bg images & rects + TBackgroundTexture bgTexture; TInt itemCount = ((TPrivData*)(iSpare))->iBackgrounds.Count(); for (TInt index = 0; index < itemCount; index++) @@ -425,3 +478,62 @@ } return NULL; } + + +TInt CHuiS60Skin::SearchCachedSkinItemIndex(const TAknsItemID& aId) + { + TInt cacheditemsCount = iCachedSkinItems.Count(); + for(TInt i = 0; i < cacheditemsCount; i++ ) + { + if( iCachedSkinItems[i]->iId == aId ) + { + return i; + } + } + + HUI_DEBUG2(_L("CHuiS60Skin::SeachCachedSkinItemIndex - cached TAknsItemID %i %i (iMajor, iMinor) not found"), aId.iMajor, aId.iMinor ); + + return KErrNotFound; + } + +TRect CHuiS60Skin::SearchCachedSkinItemRect(const TAknsItemID& aId) + { + TRect returnRect = TRect(); + if(aId == KAknsIIDQsnBgScreen) + { + returnRect = iBackgroundRect; + } + else + { + TInt index = SearchCachedSkinItemIndex(aId); + if(index != KErrNotFound ) + { + returnRect = iCachedSkinItems[index]->iSkinRect; + } + } + return returnRect; + } + +CFbsBitmap* CHuiS60Skin::SearchCachedSkinItemBitmap(const TAknsItemID& aId) + { + CFbsBitmap* bitmap = NULL; + if(aId == KAknsIIDQsnBgScreen) + { + bitmap = iBackgroundBitmap; + } + else + { + TInt index = SearchCachedSkinItemIndex(aId); + if(index != KErrNotFound ) + { + bitmap = iCachedSkinItems[index]->iBitmap; + } + } + return bitmap; + } + + +TRect CHuiS60Skin::SkinRect(const TAknsItemID& aID) + { + return SearchCachedSkinItemRect(aID); + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -61,6 +61,102 @@ NONSHARABLE_CLASS(CAppFwProxy): public CBase { public: + class CAlfGuardedSynchCall: public CActive + { + public: + CAlfGuardedSynchCall(const TAlfCommandParams& aParams):CActive(CActive::EPriorityStandard), iPckg(aParams), iPtr(0,0) + { + CActiveScheduler::Add(this); + iStatus = KErrNotFound; + } + + static void DoGuardedOpL(const TAlfCommandParams& aInParams, + TDes8& aOutParams, + RNotifier& aNotifier, + const TDesC8* aInParams2 = 0 // ugly extension, really + ) + { + CAlfGuardedSynchCall* me = new (ELeave) CAlfGuardedSynchCall(aInParams); + + CleanupStack::PushL(me); + User::LeaveIfError(me->iTimer.CreateLocal()); + me->iRetBuf = aOutParams.AllocL(); + me->iPtr.Set((TUint8*)me->iRetBuf->Ptr(),0,aOutParams.MaxSize()); + if (aInParams2) + { + me->iAltInBuf = aInParams2->AllocL(); + } + CleanupStack::Pop(); // me + + if (aInParams2) + { + aNotifier.StartNotifierAndGetResponse(me->iStatus, + TUid::Uid(KAlfAppFwProxyUid), + *me->iAltInBuf, me->iPtr); + } + else + { + aNotifier.StartNotifierAndGetResponse(me->iStatus, + TUid::Uid(KAlfAppFwProxyUid), + me->iPckg, me->iPtr); + } + + me->iTimer.After(me->iTimerStatus, 100000); // 100ms + User::WaitForRequest(me->iStatus, me->iTimerStatus); + TBool timedOut = (me->iStatus == KRequestPending); + + me->iTimer.Cancel(); // Cancel timer anyway + + if (!timedOut) + { + TInt err = me->iStatus.Int(); + User::WaitForRequest(me->iTimerStatus); + aOutParams.Copy(*me->iRetBuf); + delete me; + User::LeaveIfError(err); + } + else + { + me->SetActive(); + User::Leave( KErrTimedOut ); + } + } + + static TInt DoGuardedOp(const TAlfCommandParams& aInParams, + TDes8& aOutParams, + RNotifier& aNotifier) + { + TInt ret = KErrNone; + TRAP(ret, DoGuardedOpL(aInParams, aOutParams, aNotifier);) + return ret; + } + + ~CAlfGuardedSynchCall() + { + Cancel(); + delete iRetBuf; + delete iAltInBuf; + iTimer.Close(); + } + + void RunL() + { + delete this; + } + + void DoCancel() + { + // Cancel will call User::WaitForRequest for iStatus (if this ao is active) + } + + TPckgC iPckg; + HBufC8* iRetBuf; + HBufC8* iAltInBuf; + TPtr8 iPtr; + RTimer iTimer; + TRequestStatus iTimerStatus; + }; + class CAlfLayoutListener: public CActive { public: @@ -82,7 +178,8 @@ TAlfCommandParams params={EAlfIsMirrorred,0,0,0}; TPckgC pkg(params); TBuf8<1> awkwardApiDummy; - iNotif.iNotif.StartNotifierAndGetResponse(iStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy); } + iNotif.iNotif.StartNotifierAndGetResponse(iStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy); + } void DoCancel() { @@ -111,6 +208,7 @@ if (!iConnected) { // perhaps should check also whether eikon server / notifier server exists.. + // This is currently unsafe (synch) call to a process that may be blocked by window server, keep fingers crossed iConnected = (iNotif.Connect() == KErrNone); } return iConnected; @@ -121,11 +219,10 @@ if ( Connect() && iLayoutMirrored == KErrNotFound) { TRequestStatus status; - TAlfCommandParams params={EAlfIsMirrorred,0,0,0}; - TPckgC pkg(params); - TBuf8<1> awkwardApiDummy; - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy); - User::WaitForRequest(status); + TAlfCommandParams inParams={EAlfIsMirrorred,0,0,0}; + TBuf8<1> outParams; + TInt ret = CAlfGuardedSynchCall::DoGuardedOp( inParams, outParams , iNotif ); + // order updates iLayoutUpdateAo = new CAlfLayoutListener(*this); if (iLayoutUpdateAo) @@ -133,7 +230,7 @@ TRAP_IGNORE(iLayoutUpdateAo->RunL()); } - iLayoutMirrored = (status.Int() > 0); + iLayoutMirrored = ret > 0; } return iLayoutMirrored==KErrNotFound?EFalse:iLayoutMirrored; @@ -144,13 +241,9 @@ TInt ret = 0; if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams params={EAlfCbaLocation,0,0,0}; - TPckgC pkg(params); - TBuf8<1> awkwardApiDummy; - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy); - User::WaitForRequest(status); - ret = status.Int(); + TAlfCommandParams inParams={EAlfCbaLocation,0,0,0}; + TBuf8<1> outParams; + ret = CAlfGuardedSynchCall::DoGuardedOp( inParams, outParams , iNotif ); } return ret; @@ -161,13 +254,9 @@ TRect ret=TRect(0,0,0,0); if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams params={EAlfLayoutMetricsRect,aType,0,0}; - TPckgC pkg(params); - TPckg retpkg(ret); - - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg); - User::WaitForRequest(status); + TAlfCommandParams inParams={EAlfLayoutMetricsRect,aType,0,0}; + TPckg outParams(ret); + CAlfGuardedSynchCall::DoGuardedOp( inParams, outParams , iNotif ); } return ret; @@ -178,14 +267,9 @@ { if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams params={EAlfGetCachedColor,aID.iMajor,aID.iMinor,aIndex}; - TPckgC pkg(params); - TPckg retpkg(aRgb); - - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg); - User::WaitForRequest(status); - return status.Int(); + TAlfCommandParams inParams={EAlfGetCachedColor,aID.iMajor,aID.iMinor,aIndex}; + TPckg outParams(aRgb); + return CAlfGuardedSynchCall::DoGuardedOp( inParams, outParams , iNotif); } return KErrCouldNotConnect; @@ -196,15 +280,12 @@ { if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams2 params={EAlfGetSkinBitmap,aID.iMajor,aID.iMinor,aBitmapId,aMaskId,aFileName, aSize, aScaleMode}; - TPckgC pkg(params); + TAlfCommandParams fakeParams={0,0,0,0}; + TAlfCommandParams2 inParams={EAlfGetSkinBitmap,aID.iMajor,aID.iMinor,aBitmapId,aMaskId,aFileName, aSize, aScaleMode}; + TPckgC inBuf(inParams); TInt2 handles = {0,0}; - TPckg retpkg(handles); - - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg); - User::WaitForRequest(status); - User::LeaveIfError(status.Int()); + TPckg outParams(handles); + CAlfGuardedSynchCall::DoGuardedOpL( fakeParams, outParams , iNotif, &inBuf ); if (!handles.iInt1) { User::Leave(KErrNotFound); @@ -221,15 +302,10 @@ { if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams params={EAlfGetSkinBackgroundBitmap,aID.iMajor,aID.iMinor,0}; - TPckgC pkg(params); + TAlfCommandParams inParams={EAlfGetSkinBackgroundBitmap,aID.iMajor,aID.iMinor,0}; TInt handle = 0; - TPckg retpkg(handle); - - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg); - User::WaitForRequest(status); - User::LeaveIfError(status.Int()); + TPckg outParams(handle); + CAlfGuardedSynchCall::DoGuardedOpL( inParams, outParams , iNotif ); User::LeaveIfError(aBitmap->Duplicate(handle)); } } @@ -238,26 +314,12 @@ { if ( Connect() ) { - TRequestStatus status; - TAlfCommandParams params={EGetCachedSkinItemData,aID.iMajor,aID.iMinor,aType}; - TPckgC pkg(params); - TPckg retpkg(aArray); - - iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg); - User::WaitForRequest(status); - User::LeaveIfError(status.Int()); + TAlfCommandParams inParams={EGetCachedSkinItemData,aID.iMajor,aID.iMinor,aType}; + TPckg outParams(aArray); + CAlfGuardedSynchCall::DoGuardedOpL( inParams, outParams , iNotif ); } } - void GetListOfWindowGroupsL(TRequestStatus& aStatus, TPtr8& aPtr) - { - if ( Connect() ) - { - TAlfCommandParams params={EGetListOfWindowGroups,0,0,0}; - TPckgC pkg(params); - iNotif.StartNotifierAndGetResponse(aStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, aPtr); - } - } public: TBool iLayoutMirrored; RNotifier iNotif; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/HuiVisual.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/HuiVisual.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/HuiVisual.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -39,6 +39,8 @@ #include "HuiCmdBufferBrush.h" #include "huicanvasrenderbuffer.h" +#include "huiextension.h" + struct CHuiVisual::THuiVisualPrivateData { public: // Functions @@ -67,8 +69,7 @@ // Data RArray iTacticons; - CHuiDropShadow* iDropShadow; - TRect iPreviousDrawnTvOut; + CHuiDropShadow* iDropShadow; CHuiFxEffect* iEffect; CHuiFxEffectParser* iEffectParser; MHuiEffectable *iEffectable; @@ -218,7 +219,7 @@ CHuiDisplay* display = &Env().Display(i); if (&(display->Roster()) == &roster) { - const TRect& previousDirtyRect = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn; + const TRect& previousDirtyRect = iPreviousDrawn; TRect empty; display->CombineAndAddDirtyRegion(previousDirtyRect, empty); } @@ -690,6 +691,34 @@ EXPORT_C THuiRealRect CHuiVisual::DisplayRect() const __SOFTFP { + // if this visual is wserv owned, we can take some shortcuts + // when calculating the displayrect (ie. none of the "advanced" + // functionality is used + if (iFlags & EHuiVisualFlagWserv) + { + TReal x = iPos.iX.iInterpolationStartValue; + TReal y = iPos.iY.iInterpolationStartValue; + TReal width = iSize.iX.iInterpolationStartValue; + TReal height = iSize.iY.iInterpolationStartValue; + + const CHuiVisual* iter = this; + while(iter) + { + // Move up in the tree. + iter = iter->iLayout; + if(iter) + { + x+=iter->iPos.iX.iInterpolationStartValue; + y+=iter->iPos.iY.iInterpolationStartValue; + } + } + + iDisplayRect.iTl.iX = x; + iDisplayRect.iTl.iY = y; + iDisplayRect.iBr.iX = x+width; + iDisplayRect.iBr.iY = y+height; + return iDisplayRect; + } // Recalculate and cache as necessary. TBool recalculationNeeded = ETrue; @@ -1483,7 +1512,7 @@ ExpandRectWithContent(dirty); } - TRect& previousDrawn = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn; + TRect& previousDrawn = iPreviousDrawn; // CombineAndAddDirtyRegion modifies "dirty" param by transforming it. // "previousDrawn" is supposed to be already transformed. @@ -2153,3 +2182,50 @@ delete iVisualData->iEffectParser; iVisualData->iEffectParser = aEffectParser; } + +TInt CHuiVisual::QueryCanvasFlags() + { + THuiVisualQueryParams p; + p.iQueryType = THuiVisualQueryParams::EQueryCanvasFlags; + p.iValue = 0; + p.iResult = KErrNotSupported; + TAny* ptr = &p; + + VisualExtension(KHuiVisualQueryUid, &ptr); + + // If visual does not support this extension, assume 0 + + return ( p.iResult == KErrNone ) ? p.iValue : 0; + } + +TBool CHuiVisual::QueryExternalContentDrawingEnabled() + { + THuiVisualQueryParams p; + p.iQueryType = THuiVisualQueryParams::EQueryExternalContentDrawingEnabled; + p.iValue = 0; + p.iResult = KErrNotSupported; + TAny* ptr = &p; + + VisualExtension(KHuiVisualQueryUid, &ptr); + + // If visual does not support this extension, assume + // that visual does not have external content drawing enabled. + + return ( p.iResult == KErrNone ) && p.iValue; + } + +TBool CHuiVisual::QueryHasDrawableContent() + { + THuiVisualQueryParams p; + p.iQueryType = THuiVisualQueryParams::EQueryHasDrawableContent; + p.iValue = 0; + p.iResult = KErrNotSupported; + TAny* ptr = &p; + + VisualExtension(KHuiVisualQueryUid, &ptr); + + // If visual does not support this extension, assume + // that it has something to draw. + + return p.iValue || ( p.iResult != KErrNone ); + } diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1193,7 +1193,19 @@ // Could copy only needed rects to avoid excessive clipping iDelayedClipRegion.Copy(iClippingRegion); break; - } + } + + // both points lie outside - but the line may still intersect the region, + // so represent the line as a rect and try an intersection test... + TRect lineBoundingRect(start, end); + lineBoundingRect.Normalize(); + lineBoundingRect.iBr += TPoint(1, 1); + if (IsClipped(lineBoundingRect, iClippingRegion) != EFullyOutside) + { + iDelayedClipRegion.Copy(iClippingRegion); + vis1 = EPartialOverlap; + break; + } } } if (vis1 == EFullyOutside && vis2 == EFullyOutside) @@ -1211,6 +1223,13 @@ EXPORT_C TBool CHuiCanvasGc::ClipNext() { + if (iDelayedClipVisibility == EFullyOutside) + { + // If drawing would fall completely outside the clipping region, we are done. + return EFalse; + } + + const TBool clipOneByOne = iDelayedClipRegion.Count() > MaxNumberOfClipRects(); if (iDelayedClipVisibility != EFullyOutside && iDelayedClipRegion.Count() && iDelayedClipCount < iDelayedClipRegion.Count()) @@ -1224,7 +1243,7 @@ iGc->PushClip(); iDelayedClipRectPushed = ETrue; - if (MaxNumberOfClipRects() == 1) + if (clipOneByOne) { iGc->Clip(iDelayedClipRegion[iDelayedClipCount]); } @@ -1234,18 +1253,21 @@ } } - iDelayedClipCount += MaxNumberOfClipRects(); - - if (iDelayedClipVisibility == EFullyOutside) + TBool continueDrawing = EFalse; + if (clipOneByOne) { - // If drawing would fall completely outside the clipping region, we are done. - return EFalse; + // Clip one by one. + iDelayedClipCount++; + continueDrawing = iDelayedClipCount <= iDelayedClipRegion.Count(); } else { - // Check how many times we must do the operation in case rederer does not support many clip rects at once - return (iDelayedClipCount <= iDelayedClipRegion.Count() || iDelayedClipCount == MaxNumberOfClipRects()); + // Drawing once is sufficient - all clipping can be done. + continueDrawing = !iDelayedClipCount; + iDelayedClipCount++; } + + return continueDrawing; } EXPORT_C void CHuiCanvasGc::DisableDelayedClippingIfNeeded() diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -657,16 +657,30 @@ } UseWsState(); - if ( aFillRule == MWsGraphicsContext::EAlternate ) + if (iWsBrushStyle == MWsGraphicsContext::ENullBrush) { - iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd ); + // nullbrush, but pen style set + // -> draw non filled polygon and + // use pencolor + iCanvasGc->SetPolygonDrawMode( EHuiNoFill ); + iCanvasGc->SetPenColor(iWsPenColor); + iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f)); + } - if ( aFillRule == MWsGraphicsContext::EWinding ) - { - iCanvasGc->SetPolygonDrawMode( EHuiFillNonZero ); + else + { + if ( aFillRule == MWsGraphicsContext::EAlternate ) + { + iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd ); + } + if ( aFillRule == MWsGraphicsContext::EWinding ) + { + iCanvasGc->SetPolygonDrawMode( EHuiFillNonZero ); + } + iCanvasGc->SetPenColor(iWsBrushColor); + iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f)); } - iCanvasGc->SetPenColor(iWsPenColor); - iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f)); + iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode)); iCanvasGc->DrawPolygon( points ); @@ -2067,7 +2081,8 @@ TRgb oldColor = gc->PenColor(); gc->SetPenAlpha(0); gc->SetPenColor(KRgbBlue); - gc->Clear(); + TRect rect = aUpdateRegion.BoundingRect(); + gc->Clear(rect); gc->SetPenAlpha(oldAlpha); gc->SetPenColor(oldColor); } @@ -2106,6 +2121,7 @@ // Set new clipping region which does not clip anything. // We want always draw aUpdateRegion fully to the aRenderbuffer. TRect displayArea = iCanvasGc->Gc()->DisplayArea(); + iCanvasGc->Gc()->SetClip(displayArea); // this call does not transform region anymore // We use translation to get screen coordinates to match render buffer coordinates diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -62,10 +62,6 @@ const TInt KHuiCanvasDisableRenderBufferHandleInterval = 100; // Milliseconds const TInt KHuiCanvasEnableRenderBufferHandleInterval = 500; // Milliseconds -/** Internal constant to identify complex command buffers */ -const TInt KPossiblePerformanceProblemInWindow = 64; - - /** ETrue - use SelectGcL to select gc implementation, EFalse - use KHuiDefaultCanvasWsGc. */ const TBool KHuiUseSelectGc = ETrue; @@ -302,23 +298,13 @@ /* If window shape region has been changed, we should clear the window to get rid of old content. * We also set all command buffers to "not drawn" state so that everything will be redrawn. + * Actual clearing is done after BeginActionL, because drawing phase will start only after calling it. */ - TBool isFullUpdateRegionCleared = EFalse; if(iShapeRegionClearingPending) { - #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL - RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - Clearing fullupdateregion")); - #endif - // Clear the window update region area - TBool doClear = ETrue; - iCanvasWsGc->EnableUpdateRegion(iFullUpdateRegion, doClear); - iCanvasWsGc->DisableUpdateRegion(); - isFullUpdateRegionCleared = ETrue; - // Cause a full redraw for the canvas visual SetAllBuffersChanged(ETrue); ClearAllBufferStatusFlags(EHuiCanvasBufferStatusDrawn); - iShapeRegionClearingPending = EFalse; } @@ -328,6 +314,20 @@ /* Begin draw. If render buffer is used this sets up the render buffer if needed */ iCanvasWsGc->BeginActionL(aAction,aDisplayRect,aUser,cachePrepared,iFullUpdateRegion); + TBool isFullUpdateRegionCleared = EFalse; + if(iShapeRegionClearingPending) + { + #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL + RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - Clearing fullupdateregion")); + #endif + // Clear the window update region area + TBool doClear = ETrue; + iCanvasWsGc->EnableUpdateRegion(iFullUpdateRegion, doClear); + iCanvasWsGc->DisableUpdateRegion(); + isFullUpdateRegionCleared = ETrue; + iShapeRegionClearingPending = EFalse; + } + #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL if (iCanvasWsGc->IsRenderBufferEnabled()) { @@ -2245,7 +2245,13 @@ TInt originalBufferCount = iCommandBuffers.Count(); RemoveBuffersWithoutRealDrawing(); - RemoveBuffersWithOldDisplayRect(); + + // Remove buffers only with moved display rect and modify the clip region + // of buffers with changed size instead of completely removing all. + RemoveBuffersWithMovedDisplayRect(); + ModifyBuffersWithChangedDisplayRect(); + //RemoveBuffersWithOldDisplayRect(); + RemoveBuffersWithEmptyUpdateRegion(); RemoveBuffersWithOverlappingUpdateRegion(); @@ -2253,6 +2259,44 @@ return didRemoveBuffers; } +void CHuiCanvasWsPainter::RemoveBuffersWithMovedDisplayRect() + { + TInt bufferCount = iCommandBuffers.Count(); + + TRect canvas = iCanvasVisual->DisplayRect().Round(); + for (TInt cb = bufferCount - 1; cb >= 0; cb--) + { + CHuiCanvasCommandBuffer* buffer = iCommandBuffers[cb]; + TRect bufRect = buffer->iOriginalDisplayRect.Round(); + + // If the visual has moved, delete the old buffer + if (bufRect.iTl != canvas.iTl) + { + DestroyBuffer(cb); + } + } + } + +void CHuiCanvasWsPainter::ModifyBuffersWithChangedDisplayRect() + { + TInt bufferCount = iCommandBuffers.Count(); + TRect canvasRect = iCanvasVisual->DisplayRect().Round(); + TRegionFix<1> region(canvasRect); + + // If the buffers have different update region than CanvasVisual, clip + // the drawing to canvas visual's & cmdbuffer's updateregions' intersection. + for (TInt cb = 0; cb < bufferCount; cb++) + { + CHuiCanvasCommandBuffer* cmdbuffer = iCommandBuffers[cb]; + if (cmdbuffer->iOriginalDisplayRect.Round() != canvasRect) + { + cmdbuffer->iUpdateRegion.Copy(cmdbuffer->iOriginalUpdateRegion); + cmdbuffer->iUpdateRegion.Intersect(region); + cmdbuffer->iUpdateRegion.Tidy(); + } + } + } + void CHuiCanvasWsPainter::RemoveBuffersWithoutRealDrawing() { TInt bufferCount = iCommandBuffers.Count(); @@ -2488,7 +2532,9 @@ TInt CHuiCanvasWsPainter::EnableRenderBuffer(TBool aEnable) { - if (aEnable != iCanvasWsGc->IsRenderBufferEnabled()) + iEnableRenderBuffer = aEnable; + + if (iCanvasWsGc && ( aEnable != iCanvasWsGc->IsRenderBufferEnabled() ) ) { if (aEnable) { @@ -2604,6 +2650,11 @@ { oldGc->ClearCache(); } + if ( iCanvasWsGc ) + { + // Forward 'enable render buffer' setting to new GC. + iCanvasWsGc->EnableRenderbuffer( iEnableRenderBuffer ); + } #ifdef HUI_DEBUG_TRACK_DRAWING CHuiCanvasWsGc* realGc = iCanvasWsGc; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/huicanvaswsswgc.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huicanvaswsswgc.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswsswgc.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -1325,8 +1325,8 @@ TDisplayMode CHuiCanvasWsSwGc::SelectDisplayMode() { - TDisplayMode mode = EColor16MA; - + TDisplayMode mode = EColor16MAP; + // Note 64K mode cannot be used until separate mask is supported. It might be // possible to generate according to dirty region ? @@ -1477,6 +1477,8 @@ return; } + iBitGc->Reset(); + if (aClear) { if (iDefaultClipRegion.Count()) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp --- a/uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp Fri Mar 19 09:43:21 2010 +0200 @@ -149,7 +149,10 @@ { if ((iAnimationState & EInitializing) && aTexture.iFrameCount > 1 && aTextureId == iTextureId1) { + delete iTexture; iTexture = iTexture1; + delete iTexture2; + iTexture2 = NULL; TRAP_IGNORE(iTexture2 = &iManager.LoadTextureL(*iFilename,EHuiTextureUploadFlagDefault, iTextureId2, 1)) iFrameInterval = aTexture.iFrameInterval; iFrameCount = aTexture.iFrameCount; diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/goommonitor/bwins/goommonitoru.DEF --- a/uiacceltk/hitchcock/goommonitor/bwins/goommonitoru.DEF Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/goommonitor/bwins/goommonitoru.DEF Fri Mar 19 09:43:21 2010 +0200 @@ -21,4 +21,5 @@ ?UsesAbsoluteMemTargets@RGOomMonitorSession@@QAEXH@Z @ 20 NONAME ; void RGOomMonitorSession::UsesAbsoluteMemTargets(int) ?Connect@RGOomMonitorSession@@QAEHAAVTRequestStatus@@@Z @ 21 NONAME ; int RGOomMonitorSession::Connect(class TRequestStatus &) ?AppAboutToStart@RGOomMonitorSession@@QAEXAAVTRequestStatus@@ABVTUid@@@Z @ 22 NONAME ; void RGOomMonitorSession::AppAboutToStart(class TRequestStatus &, class TUid const &) + ?MemoryAllocationsComplete@RGOomMonitorSession@@QAEXXZ @ 23 NONAME ; void RGOomMonitorSession::MemoryAllocationsComplete(void) diff -r 15bf7259bb7c -r 8f67d927ea57 uiacceltk/hitchcock/goommonitor/data/goomconfig.xml --- a/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Tue Feb 02 07:56:43 2010 +0200 +++ b/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml Fri Mar 19 09:43:21 2010 +0200 @@ -18,7 +18,7 @@ actions are needed. This value is meaningful only when "check" or "estimate" sync mode is used with plugins. --> - + - - - + + + + @@ -40,7 +41,7 @@ - + @@ -55,6 +56,11 @@ + +