Merge KhronosRI and bld.inf fix.
authorPat Downey <patd@symbian.org>
Tue, 04 May 2010 16:06:01 +0100
changeset 46 ca46a316904d
parent 45 36b2e23a8629 (diff)
parent 44 c585bdae81dd (current diff)
child 71 9e048f93dc24
Merge KhronosRI and bld.inf fix.
--- a/egl/egltest/bwins/egltestcommonu.def	Tue May 04 14:48:00 2010 +0100
+++ b/egl/egltest/bwins/egltestcommonu.def	Tue May 04 16:06:01 2010 +0100
@@ -20,7 +20,7 @@
 	?Surface@CTestEglSession@@QBEHXZ @ 19 NONAME ; int CTestEglSession::Surface(void) const
 	?ConstructWindowL@CEglTestStep@@IAEXAAVRWindow@@ABVTRect@@@Z @ 20 NONAME ; void CEglTestStep::ConstructWindowL(class RWindow &, class TRect const &)
 	?NativeFbsBitmap@CTestEglSession@@QAEPAVCFbsBitmap@@XZ @ 21 NONAME ; class CFbsBitmap * CTestEglSession::NativeFbsBitmap(void)
-	?GetMatchType@@YA?AW4TEglConfigMatchType@@HW4TEglConfigMatchRule@@@Z @ 22 NONAME ; enum TEglConfigMatchType GetMatchType(int, enum TEglConfigMatchRule)
+	Reserved22 @ 22 NONAME ABSENT
 	?GetConfigExactMatchL@CTestEglSession@@QAEHW4TEglTestConfig@@W4TEglConfigMatchRule@@@Z @ 23 NONAME ; int CTestEglSession::GetConfigExactMatchL(enum TEglTestConfig, enum TEglConfigMatchRule)
 	??0TSgImageInfoTest@@QAE@W4TUidPixelFormat@@VTSize@@@Z @ 24 NONAME ; TSgImageInfoTest::TSgImageInfoTest(enum TUidPixelFormat, class TSize)
 	?InitializeL@CTestEglSession@@QAEXH@Z @ 25 NONAME ; void CTestEglSession::InitializeL(int)
--- a/egl/egltest/src/egltest_benchmark_sgimage.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/egl/egltest/src/egltest_benchmark_sgimage.cpp	Tue May 04 16:06:01 2010 +0100
@@ -875,6 +875,7 @@
 
 void CEglTest_Benchmark_DrawImage::doProcessFunctionL(TInt aIdx)
     {
+    INFO_PRINTF2(_L("CEglTest_Benchmark_DrawImage::doProcessFunctionL, Process %d"),aIdx);
 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
     GetDisplayL();
     CreateEglSessionL(aIdx);
--- a/egl/egltest/src/egltestcommonsession.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/egl/egltest/src/egltestcommonsession.cpp	Tue May 04 16:06:01 2010 +0100
@@ -451,7 +451,7 @@
 		}
 	}
 
-EXPORT_C TEglConfigMatchType GetMatchType(EGLint aAttrib, TEglConfigMatchRule aMatchRule)
+LOCAL_C TEglConfigMatchType GetMatchType(EGLint aAttrib, TEglConfigMatchRule aMatchRule)
 	{
 	const TConfigMatchRuleItem* curMatchRuleItem = KConfigMatchRules[aMatchRule];
 
--- a/fbs/fontandbitmapserver/tfbs/tfonttableandglyph.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/fbs/fontandbitmapserver/tfbs/tfonttableandglyph.cpp	Tue May 04 16:06:01 2010 +0100
@@ -683,54 +683,49 @@
     implementationArray.ResetAndDestroy();
     }
 
+/**
+Worker function that implements the threads executed by SMPAndWDPSafeTest.
+@leave If a leave occurs, either the test failed to be set-up successfully,
+    or the test itself failed.
+*/
+static void DoSMPAndWDPSafeTestFunL()
+    {
+    User::LeaveIfError(RFbsSession::Connect());
+    CFbsBitmap* bmp = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bmp);
+    User::LeaveIfError(bmp->Create(TSize(100,100), EGray2));
+    CFbsBitmapDevice* bmpDevice = CFbsBitmapDevice::NewL(bmp);
+    CleanupStack::PushL(bmpDevice);
+    CFont* font = NULL;
+    TFontSpec fontSpec(KTestFontFaceName, KFontHeight);
+    User::LeaveIfError(bmpDevice->GetNearestFontToMaxHeightInTwips(font, fontSpec, 0));
+
+    for(TInt i = 0; i < 100; i++)
+        {
+        RFontTable fontTable;
+        CleanupClosePushL(fontTable);
+        User::LeaveIfError(fontTable.Open(*font, 0x68656164));
+        TUint32* ptr = (TUint32*)fontTable.TableContent();
+        if (!ptr)
+            {
+            User::Leave(KErrGeneral);
+            }
+        CleanupStack::PopAndDestroy(1); // fontTable;
+        }
+    bmpDevice->ReleaseFont(font);
+    CleanupStack::PopAndDestroy(2); // bmpDevice, bmp
+    RFbsSession::Disconnect();
+    }
+
 static TInt SMPAndWDPSafeTestFun(TAny* /*aParam*/)
     {
-    CFbsBitmapDevice* device1 = NULL;
-    CFont* font;
-    TInt err = 0;
-    CTrapCleanup* trapCleanup=CTrapCleanup::New();
-    
-    err = RFbsSession::Connect();    
-    if(err != KErrNone)
-        User::Panic(_L("FbsSession connection error"), -1);    
-  
-    CFbsBitmap* bmp = NULL;
-    TRAPD(ret1, bmp = new (ELeave) CFbsBitmap);
-    if (bmp == NULL)
-        User::Panic(_L("new CFbsBitmap error"), -1);
-    err = bmp->Create(TSize(100,100),EGray2);
-    if(err != KErrNone)
-            User::Panic(_L("bitmap creation error"), -1);
-    TRAP(err,device1 = CFbsBitmapDevice::NewL(bmp));
-    if(err != KErrNone)
-        User::Panic(_L("fbs device new error"), -1);
-    TFontSpec fontSpec(KTestFontFaceName,KFontHeight); 
-    err = device1->GetNearestFontToMaxHeightInTwips(font,fontSpec,0);  
-    if(err != KErrNone)
-        User::Panic(_L("Get CFont error"), -1);
-    
-    err = KErrNone; 
-    for(TInt i = 0; i < 100; i++)
-    {
-    RFontTable fontTable;
-    err = fontTable.Open(*font, 0x68656164);
-    if (KErrNone != err)
+    CTrapCleanup* trapCleanup = CTrapCleanup::New();
+    if (!trapCleanup)
         {
-        User::Panic(_L("Font table opening failed with error"), err);
-        }
-    TUint32* ptr = (TUint32*)fontTable.TableContent();
-    if (ptr == NULL)
-        {
-        User::Panic(_L("Font table content NULL"), -1);
+        return KErrNoMemory;
         }
-    fontTable.Close();
-    }
-
-    delete device1;
-    delete bmp;
+    TRAPD(err, DoSMPAndWDPSafeTestFunL());
     delete trapCleanup;
-    device1 = NULL;
-    bmp = NULL;
     return err;
     }
 
--- a/graphics_info/graphics_metadata/graphics_metadata.mrp	Tue May 04 14:48:00 2010 +0100
+++ b/graphics_info/graphics_metadata/graphics_metadata.mrp	Tue May 04 16:06:01 2010 +0100
@@ -18,7 +18,7 @@
 source   \sf\os\graphics\graphics_info\graphics_metadata 
 source   \sf\os\graphics\package_definition.xml
 source   \sf\os\graphics\package_definition_v2.xml
-source   \sf\os\graphics\layers.sysdef.xml
+source   \sf\os\graphics\symtb.layers.sysdef.xml
 source   \sf\os\graphics\distribution.policy.s60
 notes_source      \component_defs\release.src
 ipr T 
--- a/graphics_plat/m3g_core_api/inc/M3G/m3g_core.h	Tue May 04 14:48:00 2010 +0100
+++ b/graphics_plat/m3g_core_api/inc/M3G/m3g_core.h	Tue May 04 16:06:01 2010 +0100
@@ -918,7 +918,7 @@
 M3G_API M3GCamera m3gGetCamera          (M3GRenderContext hCtx);
 M3G_API void	m3gSetAlphaWrite		(M3GRenderContext ctx, M3Gbool enable);
 M3G_API M3Gbool	m3gGetAlphaWrite		(M3GRenderContext ctx);
-
+M3G_API void    m3gFreeGLESResources    (M3GRenderContext ctx);
 
 /* -------- SkinnedMesh -------- */
 
--- a/graphicsaccelaration/vgi/inc/vg/vgcontext.h	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsaccelaration/vgi/inc/vg/vgcontext.h	Tue May 04 16:06:01 2010 +0100
@@ -44,6 +44,7 @@
 	VGI_COLOR_BUFFER_FORMAT_RGB888,
 	VGI_COLOR_BUFFER_FORMAT_XRGB8888,
 	VGI_COLOR_BUFFER_FORMAT_ARGB8888,
+	VGI_COLOR_BUFFER_FORMAT_ARGB8888_PRE,
 	VGI_COLOR_BUFFER_FORMAT_XRGB4444,
 } VGIColorBufferFormat;
 
--- a/graphicscomposition/surfaceupdate/group/BLD.INF	Tue May 04 14:48:00 2010 +0100
+++ b/graphicscomposition/surfaceupdate/group/BLD.INF	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -26,12 +26,13 @@
 
 
 PRJ_EXPORTS
-../inc/surfaceupdateclient.h 	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/surfaceupdateclient.h)
-../inc/updateserverprovider.h 	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/updateserverprovider.h)
-../inc/suerror.h 		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/suerror.h)
-../inc/compositionsurfaceupdate.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/compositionsurfaceupdate.h)
-../group/surfaceupdate.iby	/epoc32/rom/include/surfaceupdate.iby
-../group/surfaceupdate_ref.iby	/epoc32/rom/include/surfaceupdate_ref.iby
+../inc/surfaceupdateclient.h        SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/surfaceupdateclient.h)
+../inc/updateserverprovider.h       SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/updateserverprovider.h)
+../inc/suerror.h                    SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/suerror.h)
+../inc/compositionsurfaceupdate.h   SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/compositionsurfaceupdate.h)
+../inc/contentreadyforcomposition.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/contentreadyforcomposition.h)
+../group/surfaceupdate.iby	        /epoc32/rom/include/surfaceupdate.iby
+../group/surfaceupdate_ref.iby	    /epoc32/rom/include/surfaceupdate_ref.iby
 
 
 PRJ_MMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicscomposition/surfaceupdate/inc/contentreadyforcomposition.h	Tue May 04 16:06:01 2010 +0100
@@ -0,0 +1,155 @@
+// 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:
+// Interface to find out when a particular content update 
+// for a given surface has been delivered to the compositor
+// and will be used in future compositions involving that 
+// surface.
+// 
+//
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef __CONTENTREADYFORCOMPOSITION_H__
+#define __CONTENTREADYFORCOMPOSITION_H__
+
+
+#include <e32std.h>
+#include <graphics/surface.h>
+
+
+/**
+MContentReadyForComposition is an interface to find out when a 
+particular content update for a given surface has been delivered to
+the compositor and will be used in future compositions involving that 
+surface.
+
+The compositor maintains a content update count for each registered 
+surface that determines when content ready notifications will be 
+completed. The content update count is internally incremented by the 
+compositor every time it receives a valid content update for a 
+registered surface. Frames may be skipped if the client submits 
+content updates too fast, meaning that not every update is displayed 
+on screen. The first valid content update sets the content update 
+count to one. Updates sent before the surface is registered do not 
+affect the content update count. Content ready notifications for 
+aContentUpdate = 1 will only be successfully completed after at least
+one content update has been received.
+*/
+class MContentReadyForComposition
+    {
+public:
+    enum
+        {
+        KUidContentReadyForComposition = 0x2002E6D5,
+        ETypeId = KUidContentReadyForComposition
+        };
+public:
+
+    /**
+    Requests a notification when a particular content update for a 
+    given surface has been delivered to the compositor. Further, 
+    notification implies that this newest content will be used in 
+    future compositions until such time that newer content is 
+    available.
+
+    @param  aSurface        Id of the surface for which the
+                            notification is required.
+    @param  aNotifyReady    Request status that is signaled on the 
+                            calling thread.
+    @param  aContentUpdate  Content update number for which 
+                            notification is required.
+
+    @note   aContentUpdate is one-based. Content update one 
+            corresponds to the first content submitted to the 
+            compositor for a given surface.
+
+    @note   If aContentUpdate is less than or equal to the current 
+            content that the compositor uses for aSurface during 
+            composition, aNotifyReady is completed with KErrNone 
+            without delay. Else aNotifyReady is completed with 
+            KErrNone when the compositor has received content update
+            number aContentUpdate for the surface.
+
+    @note   aNotifyReady is set to KRequestPending during the call
+            to NotifyContentReady() and remains set to this value 
+            until the request is completed with the appropriate 
+            return code. The client must wait for this asynchronous 
+            completion before attempting to read the return value.
+
+    @note   If the registration count for aSurface becomes zero and 
+            the surface is no longer in use in either the committed 
+            or uncommitted scene while a notification request is 
+            outstanding, the notification is completed with KErrAbort,
+            without delay soon after the surface is unregistered.
+
+    @note   Due to the 64-bit precision of aContentUpdate, the 
+            probability of wrap around is considered slim and 
+            therefore ignored. If wrap around does occur, behaviour of
+            the API is undefined.
+
+    @pre    aSurface is registered.
+    @pre    aContentUpdate >= 1.
+    @pre    There is no outstanding notification request for aSurface. 
+
+    @error  If aSurface is not registered, aNotifyReady is completed
+            with KErrArgument without delay.
+    @error  If aContentUpdate == 0, aNotifyReady is completed with 
+            KErrArgument without delay.
+    @error  If there is an outstanding notification request for 
+            aSurface, aNotifyReady is completed with KErrInUse without
+            delay.
+
+    @post   aNotifyReady will be signaled on the calling thread
+            according to the above criteria.
+    */
+    virtual void NotifyContentReady(const TSurfaceId& aSurface, TUint64 aContentUpdate, TRequestStatus& aNotifyReady) = 0;
+
+    /**
+    Cancels a notification request made previously with 
+    MContentReadyForComposition::NotifyContentReady() for a specific
+    surface.
+
+    @see    MContentReadyForComposition::NotifyContentReady().
+
+    @param  aSurface        Id of the surface for which the 
+                            notification request will be cancelled.
+
+    @pre    aSurface is registered. 
+    
+    @error  If aSurface is not registered, this function is a noop.
+
+    @post   If there is an outstanding notification request for 
+            aSurface at the time of the call, it is completed with 
+            KErrCancel without delay on the thread that originally 
+            called NotifyContentReady() to make the request. If there
+            is no outstanding notification request, this function is 
+            a noop.
+
+    @note   Completion of an outstanding request with KErrCancel
+            must not rely on the calling thread entering the active 
+            scheduler after the call to NotifyContentReadyCancel(). 
+            It is valid for the client to call User::
+            WaitForRequest(aNotifyRequest), where aNotifyRequest is 
+            the outstanding request, immediately after calling 
+            NotifyContentReadyCancel().
+    */
+    virtual void NotifyContentReadyCancel(const TSurfaceId& aSurface) = 0;
+    };
+
+
+#endif //__CONTENTREADYFORCOMPOSITION_H__
--- a/graphicsdeviceinterface/gdi/bwins/GDI2U.def	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/bwins/GDI2U.def	Tue May 04 16:06:01 2010 +0100
@@ -283,12 +283,12 @@
 	?SetShadowColor@CGraphicsContext@@QAEHABVTRgb@@@Z @ 282 NONAME ; int CGraphicsContext::SetShadowColor(class TRgb const &)
 	?GetShadowColor@CGraphicsContext@@QAEHAAVTRgb@@@Z @ 283 NONAME ; int CGraphicsContext::GetShadowColor(class TRgb &)
 	?IsFbsBitGc@CGraphicsContext@@QBEHXZ @ 284 NONAME ; int CGraphicsContext::IsFbsBitGc(void) const
-	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@@Z @ 285  NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &)
-	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@ABUTDrawTextParam@1@@Z @ 286  NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, struct CGraphicsContext::TDrawTextParam const &)
-	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTRect@@HW4TTextAlign@1@H@Z @ 287  NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TRect const &, int, enum CGraphicsContext::TTextAlign, int)
-	?DrawTextExtended@CGraphicsContext@@QAEHABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@ABUTDrawTextExtendedParam@1@@Z @ 288  NONAME ; int CGraphicsContext::DrawTextExtended(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, struct CGraphicsContext::TDrawTextExtendedParam const &)
-	?DrawTextVertical@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@H@Z @ 289  NONAME ; void CGraphicsContext::DrawTextVertical(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, int)
-	?DrawTextVertical@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTRect@@HHW4TTextAlign@1@H@Z @ 290  NONAME ; void CGraphicsContext::DrawTextVertical(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TRect const &, int, int, enum CGraphicsContext::TTextAlign, int)
+	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@@Z @ 285 NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &)
+	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@ABUTDrawTextParam@1@@Z @ 286 NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, struct CGraphicsContext::TDrawTextParam const &)
+	?DrawText@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTRect@@HW4TTextAlign@1@H@Z @ 287 NONAME ; void CGraphicsContext::DrawText(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TRect const &, int, enum CGraphicsContext::TTextAlign, int)
+	?DrawTextExtended@CGraphicsContext@@QAEHABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@ABUTDrawTextExtendedParam@1@@Z @ 288 NONAME ; int CGraphicsContext::DrawTextExtended(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, struct CGraphicsContext::TDrawTextExtendedParam const &)
+	?DrawTextVertical@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTPoint@@H@Z @ 289 NONAME ; void CGraphicsContext::DrawTextVertical(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TPoint const &, int)
+	?DrawTextVertical@CGraphicsContext@@QAEXABVTDesC16@@PBVTTextParameters@1@ABVTRect@@HHW4TTextAlign@1@H@Z @ 290 NONAME ; void CGraphicsContext::DrawTextVertical(class TDesC16 const &, class CGraphicsContext::TTextParameters const *, class TRect const &, int, int, enum CGraphicsContext::TTextAlign, int)
 	?TextWidthInPixels@CFont@@QBEHABVTDesC16@@PBVTMeasureTextInput@1@@Z @ 291 NONAME ; int CFont::TextWidthInPixels(class TDesC16 const &, class CFont::TMeasureTextInput const *) const
 	?Open@RFontTable@@QAEHAAVCFont@@K@Z @ 292 NONAME ; int RFontTable::Open(class CFont &, unsigned long)
 	?Next@RGlyphOutlineIterator@@QAEHXZ @ 293 NONAME ; int RGlyphOutlineIterator::Next(void)
@@ -299,7 +299,7 @@
 	?Close@RGlyphOutlineIterator@@QAEXXZ @ 298 NONAME ; void RGlyphOutlineIterator::Close(void)
 	?Close@RFontTable@@QAEXXZ @ 299 NONAME ; void RFontTable::Close(void)
 	??0RGlyphOutlineIterator@@QAE@XZ @ 300 NONAME ; RGlyphOutlineIterator::RGlyphOutlineIterator(void)
-	?Open@RGlyphOutlineIterator@@QAEHAAVCFont@@PAIHH@Z @ 301 NONAME ; int RGlyphOutlineIterator::Open(class CFont &, unsigned int *, int, int)
+	?Open@RGlyphOutlineIterator@@QAEHAAVCFont@@PBIHH@Z @ 301 NONAME ; int RGlyphOutlineIterator::Open(class CFont &, unsigned int const *, int, int)
 	??0RFontTable@@QAE@XZ @ 302 NONAME ; RFontTable::RFontTable(void)
 	?Image@RGlyphDataIterator@@QBEABVRSgImage@@XZ @ 303 NONAME ABSENT ; class RSgImage const & RGlyphDataIterator::Image(void) const
 	??0RGlyphMetricsArray@@QAE@XZ @ 304 NONAME ABSENT ; RGlyphMetricsArray::RGlyphMetricsArray(void)
@@ -316,4 +316,5 @@
 	?Open@RGlyphDataIterator@@QAEHAAVCFont@@PBIH@Z @ 315 NONAME ABSENT ; int RGlyphDataIterator::Open(class CFont &, unsigned int const *, int)
 	?SetName@TTypeface@@QAEXABVTDesC16@@@Z @ 316 NONAME ; void TTypeface::SetName(class TDesC16 const &)
 	?Name@TTypeface@@QBEABVTDesC16@@XZ @ 317 NONAME ; class TDesC16 const & TTypeface::Name(void) const
+	
 
--- a/graphicsdeviceinterface/gdi/eabi/GDI2U.def	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/eabi/GDI2U.def	Tue May 04 16:06:01 2010 +0100
@@ -366,7 +366,7 @@
 	_ZN10RFontTableC1Ev @ 365 NONAME
 	_ZN10RFontTableC2Ev @ 366 NONAME
 	_ZN21RGlyphOutlineIterator4NextEv @ 367 NONAME
-	_ZN21RGlyphOutlineIterator4OpenER5CFontPjii @ 368 NONAME
+	_ZN21RGlyphOutlineIterator4OpenER5CFontPKjii @ 368 NONAME
 	_ZN21RGlyphOutlineIterator5CloseEv @ 369 NONAME
 	_ZN21RGlyphOutlineIteratorC1Ev @ 370 NONAME
 	_ZN21RGlyphOutlineIteratorC2Ev @ 371 NONAME
--- a/graphicsdeviceinterface/gdi/group/graphics_gdi.mrp	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/group/graphics_gdi.mrp	Tue May 04 16:06:01 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# 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"
--- a/graphicsdeviceinterface/gdi/inc/GDI.H	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/inc/GDI.H	Tue May 04 16:06:01 2010 +0100
@@ -2268,14 +2268,16 @@
 	
 	Note:
 	
-	The pen is used to draw lines, the outlines of filled shapes, and text. The 
-	class provides member functions to set the colour of the pen, the style of 
+	The pen is used to draw lines, the outlines of filled shapes, and text. In case
+	of outlined text, the pen is used to draw the outline of the font.
+	
+	The	class provides member functions to set the colour of the pen, the style of 
 	line and the line size drawn.
 	
 	@param aColor An RGB colour for the pen. 
 	@see CGraphicsContext::SetDrawMode() */
 	virtual void SetPenColor(const TRgb& aColor)=0;
-
+ 
 	/** Sets the line drawing style for the pen. 
 	
 	There are 6 pen styles. If no pen style is set, then the default is 
@@ -2361,8 +2363,9 @@
 	
 	Notes:
 	
-	The brush is used for filling shapes and the background of text boxes. The 
-	brush has colour, style, pattern and pattern origin parameters.
+	The brush is used for filling shapes and the background of text boxes. In 
+	case of outlined text, the brush is used for filling the font. The brush 
+	has colour, style, pattern and pattern origin parameters.
 	
 	If no brush colour has been set, it defaults to white. However the default 
 	brush style is null, so when drawing to a window the default appears to be 
--- a/graphicsdeviceinterface/gdi/inc/gdiplatapi.h	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/inc/gdiplatapi.h	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -58,7 +58,7 @@
     {
 public:
     IMPORT_C RGlyphOutlineIterator();
-    IMPORT_C TInt Open(CFont& aFont, TUint* aCodes, TInt aCount, TBool aHinted = EFalse);
+    IMPORT_C TInt Open(CFont& aFont, const TUint* aCodes, TInt aCount, TBool aHinted = EFalse);
     IMPORT_C TInt Next();
     IMPORT_C const TUint8 *Outline() const;
     IMPORT_C TInt OutlineLength() const;
--- a/graphicsdeviceinterface/gdi/sgdi/FONT.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/gdi/sgdi/FONT.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1676,7 +1676,7 @@
     }
 
 EXPORT_C TInt
-RGlyphOutlineIterator::Open(CFont& aFont, TUint* aCodes, TInt aCount, TBool aHinted) 
+RGlyphOutlineIterator::Open(CFont& aFont, const TUint* aCodes, TInt aCount, TBool aHinted) 
     {
     if (NULL == aCodes || 0 == aCount)
         {
--- a/graphicsdeviceinterface/screendriver/sbit/BMDRAW16.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sbit/BMDRAW16.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-20010 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"
@@ -16,6 +16,7 @@
 #include "BMDRAW.H"
 #include "BitDrawInterfaceId.h"
 #include <graphics/lookuptable.h>
+#include <graphics/blendingalgorithms.h>
 
 #if defined(SYMBIAN_USE_FAST_FADING)
 // 16bpp fast fade - half the contrast and brighten
@@ -1427,9 +1428,6 @@
 													TUint32 aOutlinePenColor, TUint32 aShadowColor,
 													TUint32 aFillColor, const TUint8* aDataBuffer)
 	{
-	const TInt alpha = aOutlinePenColor >> 24;
-	if (alpha==0 || aLength<=0)
-		return(KErrNone);
 	DeOrientate(aX,aY);
 	TUint16* pixelPtr = PixelAddress(aX,aY);
 	const TInt pixelPtrInc = LogicalPixelAddressIncrement();
@@ -1437,7 +1435,9 @@
 	TInt blendedRedColor;
 	TInt blendedGreenColor;
 	TInt blendedBlueColor;
+	TUint blendedAlpha;
 	TUint32 finalColor;
+	const TUint16* normTable = PtrTo16BitNormalisationTable();
 
 	//Get red color. Equivalent to TRgb::Red()
 	const TInt redOutlinePenColor = (aOutlinePenColor & 0xff0000) >> 16;
@@ -1454,69 +1454,58 @@
 	const TInt blueShadowColor = aShadowColor & 0xff;
 	const TInt blueFillColor = aFillColor & 0xff;
 
+	//Get alpha color. Equivalent to TRgb::Alpha()
+	const TUint alphaOutlinePenColor = aOutlinePenColor >> 24;
+	const TUint alphaShadowColor = aShadowColor >> 24;
+	const TUint alphaFillColor = aFillColor >> 24;
+
 	while (aDataBuffer < dataBufferPtrLimit)
 		{
 		TUint8 index = *aDataBuffer++;
-
 		if (255 == FourColorBlendLookup[index][KBackgroundColorIndex])
 			{
 			//background colour
-			//No drawing required so move on to next pixel.
-			pixelPtr += pixelPtrInc;
-			continue;
+			//No drawing required
 			}
 		else if (255 == FourColorBlendLookup[index][KFillColorIndex])
 			{
 			//Use fill colour to draw
 			finalColor = aFillColor;
+			*pixelPtr = Blend32To16((finalColor | 0xff000000), alphaFillColor, *pixelPtr);
 			}
 		else if (255 == FourColorBlendLookup[index][KShadowColorIndex])
 			{
 			//Use shadow colour to draw
 			finalColor = aShadowColor;
+			*pixelPtr = Blend32To16((finalColor | 0xff000000), alphaShadowColor, *pixelPtr);
 			}
 		else if (255 == FourColorBlendLookup[index][KOutlineColorIndex])
 			{
 			//Use outline colour to draw
-			finalColor = aOutlinePenColor;
+			finalColor = aOutlinePenColor; 
+			*pixelPtr = Blend32To16((finalColor | 0xff000000), alphaOutlinePenColor, *pixelPtr);
 			}
 		else
 			{
 			//Get the background pixel colour. Using the lookup table to convert 16 to 32 bit colour
-			blendedRedColor = redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-						   		redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-						  		redFillColor * FourColorBlendLookup[index][KFillColorIndex];
-
-			blendedGreenColor = greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								greenFillColor * FourColorBlendLookup[index][KFillColorIndex];
-
-			blendedBlueColor = blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								blueFillColor * FourColorBlendLookup[index][KFillColorIndex];
+			blendedRedColor = (redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor + 
+								redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								redFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedGreenColor = (greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedBlueColor = (blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedAlpha = (alphaOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
+							alphaShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
+							alphaFillColor * FourColorBlendLookup[index][KFillColorIndex]) >> 8;
 
-			TInt backGroundAlpha=FourColorBlendLookup[index][KBackgroundColorIndex];
-			if (backGroundAlpha)
-				{
-				const TUint8* pixelPtr8 = reinterpret_cast<TUint8*>(pixelPtr); 
-				const TUint8 low = *pixelPtr8++;
-				const TUint8 high = *pixelPtr8++;
-				TUint32 backgroundColor = (*(Convert16to32bppHigh() + high)) | (*(Convert16to32bppLow() + low));
-				blendedRedColor += ((backgroundColor & 0xff0000) >> 16) * backGroundAlpha;
-				blendedGreenColor += ((backgroundColor & 0xff00) >> 8) * backGroundAlpha;
-				blendedBlueColor += (backgroundColor & 0xff) * backGroundAlpha;
-				}
-			//Equivalent to TRgb::TRgb(TUint32)
-			finalColor = ((blendedRedColor&0xFF00)<<8) | (blendedGreenColor&0xFF00) | (blendedBlueColor>>8);
-			}
-
-		if (alpha == 0xff)
-			{
-			*pixelPtr = Conv32To16(finalColor);
-			}
-		else
-			{
-			*pixelPtr = Blend32To16NoChecks(finalColor, alpha, *pixelPtr);
+			finalColor = PMA2NonPMAPixel((blendedAlpha << 24) | (blendedRedColor << 16) | (blendedGreenColor << 8) | blendedBlueColor, normTable);		
+			*pixelPtr = Blend32To16((finalColor | 0xff000000), blendedAlpha, *pixelPtr);
 			}
 		pixelPtr += pixelPtrInc;
 		}
--- a/graphicsdeviceinterface/screendriver/sbit/BMDRAW24U.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sbit/BMDRAW24U.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-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"
@@ -16,6 +16,7 @@
 #include "BMDRAW.H"
 #include "BitDrawInterfaceId.h"
 #include <graphics/lookuptable.h>
+#include <graphics/blendingalgorithms.h>
 
 TInt CDrawUTwentyFourBppBitmap::Construct(TSize aSize)
 	{
@@ -1184,9 +1185,6 @@
 														TUint32 aOutlinePenColor, TUint32 aShadowColor,
 														TUint32 aFillColor, const TUint8* aDataBuffer)
 	{
-	const TInt alpha = aOutlinePenColor >> 24;
-	if (alpha==0 || aLength<=0)
-		return KErrNone;
 	DeOrientate(aX,aY);
 	TUint32* pixelPtr = PixelAddress(aX,aY);
 	const TInt pixelPtrInc = PixelAddressIncrement();
@@ -1194,8 +1192,10 @@
 	TInt blendedRedColor;
 	TInt blendedGreenColor;
 	TInt blendedBlueColor;
+	TInt blendedAlpha;
 	TUint8 index = 0;
 	TUint32 finalColor;
+	const TUint16* normTable = PtrTo16BitNormalisationTable();
 
 	//Get red color. Equivalent to TRgb::Red()
 	const TInt redOutlinePenColor = (aOutlinePenColor & 0xff0000) >> 16;
@@ -1212,72 +1212,58 @@
 	const TInt blueShadowColor = aShadowColor & 0xff;
 	const TInt blueFillColor = aFillColor & 0xff;
 
-	const TUint32 mask2 = alpha | (alpha << 16);
+	//Get alpha color. Equivalent to TRgb::Alpha()
+	const TInt alphaOutlinePenColor = aOutlinePenColor >> 24;
+	const TInt alphaShadowColor = aShadowColor >> 24;
+	const TInt alphaFillColor = aFillColor >> 24;
+
 	while (aDataBuffer < dataBufferPtrLimit)
 		{
 		index = *aDataBuffer++;
-		
 		if (255 == FourColorBlendLookup[index][KBackgroundColorIndex])
 			{
 			//background colour
-			//No drawing required so move on to next pixel.
-			pixelPtr += pixelPtrInc;
-			continue;
+			//No drawing required
 			}
 		else if (255 == FourColorBlendLookup[index][KFillColorIndex])
 			{
 			//Use fill colour to draw
 			finalColor = aFillColor;
+			AlphaBlendPixelToDest((finalColor | 0xff000000), alphaFillColor, pixelPtr);
 			}
 		else if (255 == FourColorBlendLookup[index][KShadowColorIndex])
 			{
 			//Use shadow colour to draw
 			finalColor = aShadowColor;
+			AlphaBlendPixelToDest((finalColor | 0xff000000), alphaShadowColor, pixelPtr);
 			}
 		else if (255 == FourColorBlendLookup[index][KOutlineColorIndex])
 			{
 			//Use outline colour to draw
 			finalColor = aOutlinePenColor;
+			AlphaBlendPixelToDest((finalColor | 0xff000000), alphaOutlinePenColor, pixelPtr);
 			}
 		else
 			{
-			TUint32 backgroundColor = *pixelPtr;
-			blendedRedColor =   redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-						   		redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-						  		redFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-						  		((backgroundColor & 0xff0000) >> 16) * FourColorBlendLookup[index][KBackgroundColorIndex];
+			blendedRedColor = (redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor + 
+						   		redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+						  		redFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+
+			blendedGreenColor = (greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
 
-			blendedGreenColor = greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-								((backgroundColor & 0xff00) >> 8) * FourColorBlendLookup[index][KBackgroundColorIndex];
+			blendedBlueColor = (blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
 
-			blendedBlueColor =  blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-								(backgroundColor & 0xff) * FourColorBlendLookup[index][KBackgroundColorIndex];
+			blendedAlpha = (alphaOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
+							alphaShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
+							alphaFillColor * FourColorBlendLookup[index][KFillColorIndex]) >> 8;
 
-			//Equivalent to TRgb::TRgb(TUint32)
-			finalColor = ((blendedRedColor&0xFF00) << 8) | (blendedGreenColor&0xFF00) | (blendedBlueColor>>8);
+			finalColor = PMA2NonPMAPixel((blendedAlpha << 24) | (blendedRedColor << 16) | (blendedGreenColor << 8) | blendedBlueColor, normTable);		
+			AlphaBlendPixelToDest(finalColor | 0xff000000, blendedAlpha, pixelPtr);
 			}
-
-		if (alpha != 0xff)
-			{
-			TUint32 backgroundColor = *pixelPtr;
-			//Draw the final colour
-//
-			const TUint32 s_rb = finalColor & 0x00FF00FF;
-			const TUint32 s_g = (finalColor & 0xFF00) >> 8;
-			const TUint32 d_rb = backgroundColor & 0x00FF00FF;
-			const TUint32 rb = ((((alpha * ((0x01000100 + s_rb) - d_rb)) >> 8) + d_rb) - mask2) & 0x00FF00FF;
-
-			const TInt d_g = (backgroundColor & 0xFF00) >> 8;
-			const TInt g = ((alpha * (s_g - d_g)) >> 8) + d_g;
-	
-			finalColor = rb | (g<<8);
-			}
-
-		*pixelPtr = (finalColor | 0xff000000);
 		pixelPtr += pixelPtrInc;
 		}
 	return KErrNone;
--- a/graphicsdeviceinterface/screendriver/sbit/BMDRAW32A.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sbit/BMDRAW32A.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-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"
@@ -14,6 +14,8 @@
 //
 
 #include "BMDRAW.H"
+#include <graphics/lookuptable.h>
+#include <graphics/blendingalgorithms.h>
 
 /**
 Performs a blend based on the PD method, with 2* 16 bit in one 32 bit operation optimisation.
@@ -37,6 +39,10 @@
 I do this multiply after the CSrc*MulSrc, while I still have a 16bit intermediate result.
 It is possible to generate a faster, less accurate result by exhaustively finding
 the highest value that can be added instead of rb = rb+((rb>>8)&0x00ff00ff)+0x00800080; without causing an overflow.
+@param aBeneath non-premultiplied color with alpha of the destination 
+@param aSrcColor non-premultiplied color with alpha of the source
+@param aMaskBuffer mask
+@return pre multiplied color resulting from the blending operation
 */
 FORCEINLINE TUint32 OptimizedBlend32A(TUint32 aBeneath,TUint32 aSrcColor,TUint8 aMaskBuffer)
  	{
@@ -636,9 +642,11 @@
 	TInt blendedRedColor;
 	TInt blendedGreenColor;
 	TInt blendedBlueColor;
+	TInt blendedAlpha;
 	TUint8 index = 0;
 	TUint32 finalColor;
-	
+	const TUint16* normTable = PtrTo16BitNormalisationTable();
+
 	//Get red color. Equivalent to TRgb::Red()
 	const TInt redOutlinePenColor = (aOutlinePenColor & 0xff0000) >> 16;
 	const TInt redShadowColor = (aShadowColor & 0xff0000) >> 16;
@@ -653,7 +661,11 @@
 	const TInt blueOutlinePenColor = aOutlinePenColor & 0xff;
 	const TInt blueShadowColor = aShadowColor & 0xff;
 	const TInt blueFillColor = aFillColor & 0xff;
-	const TInt alpha = aOutlinePenColor >> 24;
+
+	//Get alpha color. Equivalent to TRgb::Alpha()
+	const TInt alphaOutlinePenColor = aOutlinePenColor >> 24;
+	const TInt alphaShadowColor = aShadowColor >> 24;
+	const TInt alphaFillColor = aFillColor >> 24;
 
 	while (aDataBuffer < dataBufferPtrLimit)
 		{
@@ -661,47 +673,53 @@
 		if(255 == FourColorBlendLookup[index][KBackgroundColorIndex])
 			{
 			//background colour
-			//No drawing required so move on to next pixel.
-			pixelPtr += pixelPtrInc;
-			continue;
+			//No drawing required
 			}
 		else if (255 == FourColorBlendLookup[index][KFillColorIndex])
 			{
 			//Use fill colour to draw
-			finalColor = aFillColor;
+			finalColor = OptimizedBlend32A(*pixelPtr, aFillColor, alphaFillColor);
+			*pixelPtr = PMA2NonPMAPixel(finalColor, normTable);
 			}
 		else if (255 == FourColorBlendLookup[index][KShadowColorIndex])
 			{
 			//Use shadow colour to draw
-			finalColor = aShadowColor;
+			finalColor = OptimizedBlend32A(*pixelPtr, aShadowColor, alphaShadowColor);
+			*pixelPtr = PMA2NonPMAPixel(finalColor, normTable);
 			}
 		else if (255 == FourColorBlendLookup[index][KOutlineColorIndex])
 			{
 			//Use outline colour to draw
-			finalColor = aOutlinePenColor;
+			finalColor = OptimizedBlend32A(*pixelPtr, aOutlinePenColor, alphaOutlinePenColor);
+			*pixelPtr = PMA2NonPMAPixel(finalColor, normTable);
 			}
 		else
 			{
-			const TUint32 backgroundColor = *pixelPtr;
-			
-			blendedRedColor = (redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-						   		redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-						  		redFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-						  		((backgroundColor & 0xff0000) >> 16) * FourColorBlendLookup[index][KBackgroundColorIndex]) >> 8;
+			blendedRedColor = (redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor + 
+								redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								redFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedGreenColor = (greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedBlueColor = (blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedAlpha = (alphaOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
+							alphaShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
+							alphaFillColor * FourColorBlendLookup[index][KFillColorIndex]) >> 8;
 
-			blendedGreenColor = (greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-								((backgroundColor & 0xff00) >> 8) * FourColorBlendLookup[index][KBackgroundColorIndex]) >> 8;
-
-			blendedBlueColor = (blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
-								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
-								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] + 
-								(backgroundColor & 0xff) * FourColorBlendLookup[index][KBackgroundColorIndex]) >> 8;
-
-			finalColor = (blendedRedColor << 16) | (blendedGreenColor << 8) | blendedBlueColor | 0xff000000;
+			// The blended colours have been alpha multiplied, hence the resulting colour is 16MAP
+			// Before doing the OptimizedBlend with the destination, note the following
+			//	- The source alpha is set as fully opaque so that the blend is just with the mask
+			//	- Input parameters for OptimizedBlend are NON-PRE, hence conversion from PRE to NON-PRE beforehand
+			//	- output parameter for OptimizedBlend is PRE, hence conversion from PRE to NON-PRE afterwards
+			finalColor = PMA2NonPMAPixel((blendedAlpha << 24) | (blendedRedColor << 16) | (blendedGreenColor << 8) | blendedBlueColor, normTable);
+			finalColor = OptimizedBlend32A(*pixelPtr, finalColor | 0xff000000, blendedAlpha);
+			*pixelPtr = PMA2NonPMAPixel(finalColor, normTable);
 			}
-		*pixelPtr = OptimizedBlend32A(*pixelPtr, finalColor, alpha);
 		pixelPtr += pixelPtrInc;
 		}
 	return KErrNone;
--- a/graphicsdeviceinterface/screendriver/sbit/BMDRAW32PMA.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sbit/BMDRAW32PMA.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -696,10 +696,6 @@
 															TUint32 aOutlinePenColor, TUint32 aShadowColor,
 															TUint32 aFillColor, const TUint8* aDataBuffer)
 	{
-	const TUint alphaShifted = aOutlinePenColor & 0xff000000;
-	const TUint alpha = alphaShifted>>24;
-	if (alpha==0 || aLength<=0)
-		return KErrNone;
 	DeOrientate(aX,aY);
 	TUint32* pixelPtr = PixelAddress(aX,aY);
 	const TInt pixelPtrInc = PixelAddressIncrement();
@@ -707,6 +703,7 @@
 	TInt blendedRedColor;
 	TInt blendedGreenColor;
 	TInt blendedBlueColor;
+	TInt blendedAlpha;
 	TUint8 index = 0;
 	TUint32 finalColor;
 
@@ -724,81 +721,63 @@
 	const TInt blueOutlinePenColor = aOutlinePenColor & 0xff;
 	const TInt blueShadowColor = aShadowColor & 0xff;
 	const TInt blueFillColor = aFillColor & 0xff;
-	const TUint16* normTable = PtrTo16BitNormalisationTable();
+
+	//Get alpha color. Equivalent to TRgb::Alpha()
+	const TInt alphaOutlinePenColor = aOutlinePenColor >> 24;
+	const TInt alphaShadowColor = aShadowColor >> 24;
+	const TInt alphaFillColor = aFillColor >> 24;
 
 	// Calculate PMA values for aFillColor & aOutlinePenColor that we can use for fast blending in the simple cases
 	// Don't pre calculate PMA version of aShadowColor as it is presumed not to be used enough to make this worthwhile
-	const TUint32 pmaFillColor = NonPMA2PMAPixel((aFillColor&0x00FFFFFF)|alphaShifted);
+	const TUint32 pmaFillColor = NonPMA2PMAPixel(aFillColor);
 	const TUint32 pmaOutlineColor = NonPMA2PMAPixel(aOutlinePenColor);
+
 	while (aDataBuffer < dataBufferPtrLimit)
 		{
-		TUint backgroundAlpha;
-		TUint outlineAlpha;
-		TUint shadowAlpha;
-		TUint fillAlpha;
 		index = *aDataBuffer++;
-		backgroundAlpha = FourColorBlendLookup[index][KBackgroundColorIndex];
-		if (backgroundAlpha == 255)
+		if (255 == FourColorBlendLookup[index][KBackgroundColorIndex])
 			{
 			//background colour
-			//No drawing required so move on to next pixel.
-			pixelPtr += pixelPtrInc;
-			continue;
+			//No drawing required
 			}
-		fillAlpha=FourColorBlendLookup[index][KFillColorIndex];
-		if (fillAlpha == 255)
+		else if (255 == FourColorBlendLookup[index][KFillColorIndex])
 			{
 			//Use fill colour to draw
 			finalColor = pmaFillColor;
-oneColorBlend:
-			if (alpha==0xFF)
-				*pixelPtr=finalColor;
-			else
-				PMABlend_noChecksInplace(*pixelPtr, finalColor, alpha);
-			pixelPtr += pixelPtrInc;
-			continue;
+			PMAInplaceBlend(*pixelPtr, finalColor);
 			}
-		outlineAlpha = FourColorBlendLookup[index][KOutlineColorIndex];
-		if (outlineAlpha == 255)
+		else if (255 == FourColorBlendLookup[index][KOutlineColorIndex])
 			{
 			//Use outline colour to draw
 			finalColor = pmaOutlineColor;
-			goto oneColorBlend;
+			PMAInplaceBlend(*pixelPtr, finalColor);
 			}
-		shadowAlpha = FourColorBlendLookup[index][KShadowColorIndex];
-		if (shadowAlpha == 255)
+		else if (255 == FourColorBlendLookup[index][KShadowColorIndex])
 			{
 			//Use shadow colour to draw
-			finalColor = NonPMA2PMAPixel((aShadowColor&0x00FFFFFF)|alphaShifted);
-			goto oneColorBlend;
+			finalColor = NonPMA2PMAPixel(aShadowColor);
+			PMAInplaceBlend(*pixelPtr, finalColor);
 			}
-		blendedRedColor = redOutlinePenColor * outlineAlpha + 
-					   		redShadowColor * shadowAlpha +
-					  		redFillColor * fillAlpha;
-
-		blendedGreenColor = greenOutlinePenColor * outlineAlpha + 
-							greenShadowColor * shadowAlpha +
-							greenFillColor * fillAlpha;
-
-		blendedBlueColor = blueOutlinePenColor * outlineAlpha + 
-							blueShadowColor * shadowAlpha +
-							blueFillColor * fillAlpha;
-		if (backgroundAlpha)
-			{
-			const TUint32 backgroundColor = PMA2NonPMAPixel(*pixelPtr, normTable);
-			blendedRedColor += ((backgroundColor & 0xff0000) >> 16) * backgroundAlpha;
-			blendedGreenColor += ((backgroundColor & 0xff00) >> 8) * backgroundAlpha;
-			blendedBlueColor += (backgroundColor & 0xff) * backgroundAlpha;
-			}
-		finalColor = ((blendedRedColor&0xFF00)<<8) | (blendedGreenColor&0xFF00) | (blendedBlueColor>>8);
-
-		if (alpha==0xFF)
-			*pixelPtr=finalColor|0xFF000000;
 		else
 			{
-			//pre-multiply, inplace.
-			finalColor = NonPMA2PMAPixel(finalColor|alphaShifted);
-			PMABlend_noChecksInplace(*pixelPtr, finalColor, alpha);
+			blendedRedColor = (redOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor + 
+								redShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								redFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedGreenColor = (greenOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								greenShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								greenFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedBlueColor = (blueOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] * alphaOutlinePenColor  + 
+								blueShadowColor * FourColorBlendLookup[index][KShadowColorIndex] * alphaShadowColor +
+								blueFillColor * FourColorBlendLookup[index][KFillColorIndex] * alphaFillColor) >> 16;
+	
+			blendedAlpha = (alphaOutlinePenColor * FourColorBlendLookup[index][KOutlineColorIndex] + 
+							alphaShadowColor * FourColorBlendLookup[index][KShadowColorIndex] +
+							alphaFillColor * FourColorBlendLookup[index][KFillColorIndex]) >> 8;
+
+			finalColor = (blendedAlpha << 24) | (blendedRedColor << 16) | (blendedGreenColor  << 8 )| (blendedBlueColor);
+			PMAInplaceBlend(*pixelPtr, finalColor);
 			}
 		pixelPtr += pixelPtrInc;
 		}
--- a/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -17,7 +17,6 @@
 #include <cdsb.h>
 #include <e32hal.h>
 
-
 #ifdef SYMBIAN_GRAPHICS_GCE
 #undef __WINS__
 #include "../sgeneric/scdraw.h"
@@ -73,8 +72,6 @@
 #ifdef SYMBIAN_GRAPHICS_GCE
     CScreenDeviceHelper iSurfaceUpdater;
     TUidPixelFormat iPixelFormat;
-    TBool iDsaBufferIsBusy;
-    TRequestStatus iDsaBufferAvailable;
 #endif
 	TAcceleratedBitmapInfo iBitmapInfo;
 	TUint32 iSettingsFlags;
@@ -110,9 +107,6 @@
 #ifndef __WINS__
 	iVideoAddress(NULL),
 #endif
-#ifdef SYMBIAN_GRAPHICS_GCE
-	iDsaBufferIsBusy(EFalse),
-#endif
 	iBitmapInfo(),
 	iSettingsFlags(ENone),
 	iUpdateRect(),
@@ -165,9 +159,13 @@
 		}
 
 	__ASSERT_ALWAYS(aScreenRect.iTl.iX >= 0 &&
-					aScreenRect.iTl.iY >= 0 &&
-					aScreenRect.Width() <= screenWidth &&
-					aScreenRect.Height() <= screenHeight, Panic(EPanicOutOfBounds));
+	                aScreenRect.iTl.iY >= 0 &&
+	                ((aScreenRect.Width() <= screenWidth &&
+	                aScreenRect.Height() <= screenHeight)
+	                ||
+	                (aScreenRect.Width() <= screenHeight &&
+	                aScreenRect.Height() <= screenWidth)),
+	                Panic(EPanicOutOfBounds));
 
 	__ASSERT_ALWAYS(aScreenRect.Width() > 0 &&
 					aScreenRect.Height() > 0, Panic(EPanicInvalidRect));
@@ -529,14 +527,7 @@
 #else
 	TUint8* pD = (TUint8*)iVideoAddress;
 	const TUint dD = iDisplayOffsetLines;
-#ifdef SYMBIAN_GRAPHICS_GCE
-	if (iDsaBufferIsBusy)
-		{
-		User::WaitForRequest(iDsaBufferAvailable);
-		__ASSERT_DEBUG(iDsaBufferAvailable != KRequestPending, Panic(EPanicIncompleteRequest));
-		iDsaBufferIsBusy=EFalse;
-		}
-#endif	
+
 	for(TInt y=iUpdateRect.Height(); y>0; y--)
 		{
 		Mem::Move((void *)pD, (void *)pS, dS);
@@ -546,17 +537,18 @@
 #endif
 	
 #ifdef SYMBIAN_GRAPHICS_GCE
-	iDsaBufferIsBusy=ETrue;
+	// update the region and complete notification on the client's TRequestStatus
+	// This means the backbuffer is held up until the surface update has completed
+	// notification.
 	iSurfaceUpdater.UpdateRegion(iUpdateRect);
-	iDsaBufferAvailable = KRequestPending;
-	iSurfaceUpdater.NotifyWhenAvailable(iDsaBufferAvailable);
-	iSurfaceUpdater.Update();
+	iSurfaceUpdater.Update(aComplete);
+#else
+	// In the generic implementation, complete the request immediately to allow the client
+	// to render to the back buffer
+	TRequestStatus* pComplete=&aComplete;
+	User::RequestComplete(pComplete,KErrNone);
 #endif
-	// In the generic implementation, complete the request immediately to allow the client
-    // to render to the back buffer
-	TRequestStatus* pComplete=&aComplete;
 
-    User::RequestComplete(pComplete,KErrNone);
  	}
 
 //
@@ -606,15 +598,6 @@
 	TUint8* pS = iBitmapInfo.iAddress + offX + (offY*dS);
 	TUint8* pD = (TUint8*)iVideoAddress + offX + (offY*dD);
 
-#ifdef SYMBIAN_GRAPHICS_GCE
-	if (iDsaBufferIsBusy)
-		{
-		User::WaitForRequest(iDsaBufferAvailable);
-		__ASSERT_DEBUG(iDsaBufferAvailable != KRequestPending, Panic(EPanicIncompleteRequest));
-		iDsaBufferIsBusy=EFalse;
-		}
-#endif	
-	
 	for(TInt y=aScreenRect.Height(); y>0; y--)
 		{
 		Mem::Move((void *)pD, (void *)pS, bytesToCopy);
@@ -624,16 +607,18 @@
 #endif
 
 #ifdef SYMBIAN_GRAPHICS_GCE
-	iDsaBufferIsBusy=ETrue;
+	// update the region and complete notification on the client's TRequestStatus
+	// This means the backbuffer is held up until the surface update has completed
+	// notification.
 	iSurfaceUpdater.UpdateRegion(iUpdateRect);
-	iDsaBufferAvailable = KRequestPending;
-	iSurfaceUpdater.NotifyWhenAvailable(iDsaBufferAvailable);
-	iSurfaceUpdater.Update();
+	iSurfaceUpdater.Update(aComplete);
+#else
+	// In the generic implementation, complete the request immediately to allow the client
+	// to render to the back buffer
+	TRequestStatus* pComplete=&aComplete;
+	User::RequestComplete(pComplete,KErrNone);
 #endif	
-	// In the generic implementation, complete the request immediately.
-	TRequestStatus* pComplete=&aComplete;
 
-	User::RequestComplete(pComplete,KErrNone);
 	}
 
 #ifdef __WINS__
@@ -728,6 +713,7 @@
 	}
 #endif
 
+
 //
 // Close - Deallocate resources and cancel outstanding updates
 //
@@ -735,6 +721,9 @@
 	{
 	if(iCreated)
 		{
+#ifdef SYMBIAN_GRAPHICS_GCE
+		iSurfaceUpdater.CancelUpdateNotification();
+#endif
 		User::Free(iBitmapInfo.iAddress);
 		iBitmapInfo.iAddress = NULL;
 		iCreated = EFalse;
--- a/graphicsdeviceinterface/screendriver/sgeneric/scdraw.h	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scdraw.h	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -61,10 +61,13 @@
 	inline TInt ScreenNumber() const { return iSurface.iInternal[TSurfaceId::TScreenSurfaceUsage::EScreenField]; }
 
 	void Update();
+	void Update(TRequestStatus& aStatus);
+
 	void Update(const TRegion& aRegion);
 	void UpdateRegion(const TRect& aRect);
 	void ResetUpdateRegion();
 	void NotifyWhenAvailable(TRequestStatus& aStatus);
+	void CancelUpdateNotification();
 
 	void GetSurface(TSurfaceId& aSid) const ;
 	TUint DeviceOrientationsAvailable(const TSize& aScreenSize) const ;
--- a/graphicsdeviceinterface/screendriver/sgeneric/scdraw.inl	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scdraw.inl	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-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"
@@ -49,7 +49,7 @@
 		{	//Note: This will cause WServ startup to fail. WServ only accepts KErrNotSupported
 		return KErrHardwareNotAvailable;
 		}
-	TInt ret = CDrawXxxBppBitmap::Construct(aSize);
+	TInt ret = CDrawXxxBppBitmap::Construct(aSize, iHelper.BytesPerScanline());
 	if (ret == KErrNone)
 		{
 		CDrawXxxBppBitmap::iBits = (TUint32*)iHelper.AddressFirstPixel();
--- a/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -27,8 +27,7 @@
 #include "scdraw.h"
 #include "scdraw.inl"
 #include <graphics/gdi/gdiconsts.h>
-
-
+#include <graphics/suerror.h>
 /**
 Creates an instance of CFbsDrawDevice class.
 @param aScreenNo Screen number
@@ -341,6 +340,11 @@
 	iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);
 	}
 
+void CScreenDeviceHelper::CancelUpdateNotification()
+	{
+	iSurfaceUpdateSession.CancelAllUpdateNotifications();
+	}
+
 /**
 Implementation of corresponding function in CDrawDevice, utilizing a tracked
 update region. Updates the screen from the surface, if the update region is
@@ -348,11 +352,24 @@
 */
 void CScreenDeviceHelper::Update()
 	{
-	if (iUpdateRegion.IsEmpty())
-		return;
+	TRequestStatus updateComplete = KRequestPending;
+	Update(updateComplete);
+	User::WaitForRequest(updateComplete);
+	}
 
-	iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurface, 0, &iUpdateRegion);
-	iUpdateRegion.Clear();
+void CScreenDeviceHelper::Update(TRequestStatus& aStatus)
+	{
+	if (!iUpdateRegion.IsEmpty())
+		{
+		iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);
+		iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iSurface, 0, &iUpdateRegion);
+		iUpdateRegion.Clear();
+		}
+	else
+		{
+		TRequestStatus* pComplete=&aStatus;
+		User::RequestComplete(pComplete,KErrNone);	    
+		}
 	}
 
 /**
--- a/graphicsdeviceinterface/screendriver/tsrc/TLLD.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/tsrc/TLLD.CPP	Tue May 04 16:06:01 2010 +0100
@@ -670,7 +670,7 @@
 	iReportIteration = 1;
 	iTotalReportIterations = KNumBlendingColors;
 	((CTLowLevelStep*)iStep)->SetTestStepID(_L("GRAPHICS-SCREENDRIVER-0002"));
-	TestWriteRgbOutlineAndShadow();
+	//TestWriteRgbOutlineAndShadow(); // commented out pending case resolution #327407
 	TRAP(err,((CTLowLevelStep*)iStep)->RecordTestResultL(););
     	if (err!=KErrNone)
     		INFO_PRINTF1(_L("Failed to record test result"));
--- a/graphicstest/uibench/group/te_uibench.iby	Tue May 04 14:48:00 2010 +0100
+++ b/graphicstest/uibench/group/te_uibench.iby	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-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"
@@ -23,7 +23,6 @@
 // MCL profiler is not built for SMP
 #include <profiler.iby>
 #endif
-#include <dummyfonts.iby>
 #ifdef SYMBIAN_GRAPHICS_USE_GCE
 #include <directgdi.iby>
 #include <directgdiadapter.iby>
@@ -61,6 +60,10 @@
 
 REM test font files for fbsfonthandleperf.cpp
 data=DATAZ_\PlatTest\Graphics\TestData\ceurope.gdr			\PlatTest\Graphics\TestData\ceurope.gdr
+data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont		\PlatTest\Graphics\TestData\dummy_fonts\dummyFont
+data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_b		\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_b
+data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_i		\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_i
+data=DATAZ_\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_bi		\PlatTest\Graphics\TestData\dummy_fonts\dummyFont_bi
 
 REM sprite animation dll file for sprite performance tests
 file=ABI_DIR\DEBUG_DIR\te_spriteanimdll.dll	system\libs\te_spriteanimdll.dll
--- a/graphicstest/uibench/src/tfbsfonthandleperf.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/graphicstest/uibench/src/tfbsfonthandleperf.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -790,6 +790,7 @@
 	SetTestStepID(_L("GRAPHICS-UI-BENCH-0140"));
 	AliasedFontCreationL();
 	RecordTestResultL();
+	CloseTMSGraphicsStep();
 	return TestStepResult();
 	}
 
@@ -857,46 +858,24 @@
 	CleanupStack::PushL(dummyRasterizer);
 	fontStore->InstallRasterizerL(dummyRasterizer);
 	CleanupStack::Pop();
-
+	
+	// Check font files exist before testing
+	TRAPD(err, DoAddAndRemoveFilesL(aTestOpenFont, fontStore));
+	if (err != KErrNone)
+        {
+        _LIT(KLog,"Failed to load font files. Error code: %d");
+        INFO_PRINTF2(KLog,err);
+        User::Leave(err);
+        }
+	
+	// Perform the iterations to test
 	iProfiler->InitResults();
 	for(TInt count=KIterationsToTest; count>=0; --count)
 		{
-		if (aTestOpenFont)
-			{
-			//Add font files to fontstore
-			TUid id1 = fontStore->AddFileL(KFontDummy);
-			TUid id2 = fontStore->AddFileL(KFontDummy_b);
-			TUid id3 = fontStore->AddFileL(KFontDummy_i);
-			TUid id4 = fontStore->AddFileL(KFontDummy_bi);
-			//Remove font files from fontstore
-			fontStore->RemoveFile(id1);
-			fontStore->RemoveFile(id2);
-			fontStore->RemoveFile(id3);
-			fontStore->RemoveFile(id4);
-			}
-		else
-			{
-			//Add & remove font file to fontstore
-			TUid id1=TUid::Null();
-			TRAPD(err,id1=fontStore->AddFileL(KBitmapFont));
-			if (err!=KErrNone)
-				{
-				_LIT(KLog,"Loading font file %S gave error %d");
-				INFO_PRINTF3(KLog,&KBitmapFont,err);
-				User::Leave(err);
-				}
-			fontStore->RemoveFile(id1);
-			// total of 4 times, for comparison with Open Font test
-			TUid id2 = fontStore->AddFileL(KBitmapFont);
-			fontStore->RemoveFile(id2);
-			TUid id3 = fontStore->AddFileL(KBitmapFont);
-			fontStore->RemoveFile(id3);
-			TUid id4 = fontStore->AddFileL(KBitmapFont);
-			fontStore->RemoveFile(id4);
-			}
-
+        DoAddAndRemoveFilesL(aTestOpenFont, fontStore);
 		iProfiler->MarkResultSetL();
 		}
+	
 	TInt64 duration=iProfiler->GetTrimedMean();
 	if (aTestOpenFont)
 		{
@@ -911,6 +890,36 @@
 	heap->Close();
 	}
 
+// Do the add and removing files.
+void CTFbsFontHandlePerf::DoAddAndRemoveFilesL(TBool aTestOpenFont, CFontStore* aFontStore)
+    {
+    if (aTestOpenFont)
+        {
+        //Add font files to fontstore
+        TUid id1 = aFontStore->AddFileL(KFontDummy);
+        TUid id2 = aFontStore->AddFileL(KFontDummy_b);
+        TUid id3 = aFontStore->AddFileL(KFontDummy_i);
+        TUid id4 = aFontStore->AddFileL(KFontDummy_bi);
+        //Remove font files from fontstore
+        aFontStore->RemoveFile(id1);
+        aFontStore->RemoveFile(id2);
+        aFontStore->RemoveFile(id3);
+        aFontStore->RemoveFile(id4);
+        }
+    else
+        {
+        //Add & remove font file to fontstore a total of 4 times, for comparison with Open Font test
+        TUid id1 = aFontStore->AddFileL(KBitmapFont);
+        aFontStore->RemoveFile(id1);
+        TUid id2 = aFontStore->AddFileL(KBitmapFont);
+        aFontStore->RemoveFile(id2);
+        TUid id3 = aFontStore->AddFileL(KBitmapFont);
+        aFontStore->RemoveFile(id3);
+        TUid id4 = aFontStore->AddFileL(KBitmapFont);
+        aFontStore->RemoveFile(id4);
+        }
+    }
+
 // Add fontfile that is already opened.
 void CTFbsFontHandlePerf::AddingOpenedFontFilesL(TBool aTestOpenFont)
 	{
--- a/graphicstest/uibench/src/tfbsfonthandleperf.h	Tue May 04 14:48:00 2010 +0100
+++ b/graphicstest/uibench/src/tfbsfonthandleperf.h	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-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"
@@ -80,6 +80,7 @@
 	void FontDuplicateL();
 	void FontGetNearestFontToDesignHeightInPixelsL(const TDesC& aFontName, const TDesC& aTestName);	
 	void AddAndRemoveFilesL(TBool aTestOpenFont);
+	void DoAddAndRemoveFilesL(TBool aTestOpenFont, CFontStore* aFontStore);
 	void AddingOpenedFontFilesL(TBool aTestOpenFont);
 	void FontDrawTextGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, const TDesC& aOutputText);
 	void FontDrawStringWithoutGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, TInt aFontHeight,const TDesC& aOutputString);
--- a/m3g/m3gcore11/BWINS/m3gcoreU.DEF	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/BWINS/m3gcoreU.DEF	Tue May 04 16:06:01 2010 +0100
@@ -342,4 +342,5 @@
 	m3gSetAlphaWrite @ 341 NONAME
 	m3gGetAlphaWrite @ 342 NONAME
 	m3gInvalidateMemoryTarget @ 343 NONAME
+	m3gFreeGLESResources @ 344 NONAME
 
--- a/m3g/m3gcore11/EABI/m3gcoreU.DEF	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/EABI/m3gcoreU.DEF	Tue May 04 16:06:01 2010 +0100
@@ -342,4 +342,5 @@
 	m3gSetAlphaWrite @ 341 NONAME
 	m3gGetAlphaWrite @ 342 NONAME
 	m3gInvalidateMemoryTarget @ 343 NONAME
+	m3gFreeGLESResources @ 344 NONAME
 
--- a/m3g/m3gcore11/group/m3g.mmp	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/group/m3g.mmp	Tue May 04 16:06:01 2010 +0100
@@ -30,8 +30,8 @@
 ALWAYS_BUILD_AS_ARM
 
 // Uncomment the following flags to enable ARMv6 and/or VFP optimizations.
-//#define __ARMV6_SUPPORT
-//#define __VFPV2_SUPPORT
+#define __ARMV6_SUPPORT
+#define __VFPV2_SUPPORT
 
 #ifdef ARMCC
 #ifdef __ARMV6_SUPPORT
--- a/m3g/m3gcore11/inc/m3g_config.h	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/inc/m3g_config.h	Tue May 04 16:06:01 2010 +0100
@@ -32,6 +32,21 @@
 /* Support antialiasing */
 #define M3G_SUPPORT_ANTIALIASING    M3G_TRUE
 
+/*!
+ * \internal
+ * \def M3G_ENABLE_GLES_RESOURCE_HANDLING
+ * \brief Allow GLES resource freeing 
+ *
+ * This feature can be used with HW renderers with external memory architecture 
+ * to free all graphics resources allocated by M3G. 
+ *
+ * Enabling this feature is likely to increase host memory consumption (a copy of 
+ * all texture image data has to be kept kept in host memory), so it's advised to 
+ * undefine the flag when using SW GLES or HW GLES with unified memory architecture.
+ */
+#define M3G_ENABLE_GLES_RESOURCE_HANDLING
+
+
 #if defined(M3G_DEBUG)
 /*
 #define M3G_ENABLE_PROFILING
--- a/m3g/m3gcore11/inc/m3g_interface.h	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/inc/m3g_interface.h	Tue May 04 16:06:01 2010 +0100
@@ -132,8 +132,11 @@
  * Other internal functions
  *------------------------------------------------------------------*/
 
-static void     m3gAddChildObject(Interface *m3g);
-static void     m3gDelChildObject(Interface *m3g);
+static void     m3gAddChildObject(Interface *m3g, Object *obj);
+static void     m3gDelChildObject(Interface *m3g, Object *obj);
+
+#include "m3g_array.h"
+static void     m3gGetObjectsWithClassID(Interface *m3g, M3GClass classID, PointerArray* objects);
 
 #if !defined(M3G_NGL_TEXTURE_API)
 static void     m3gDeleteGLTextures(Interface *m3g, M3Gsizei n, M3Guint *t);
--- a/m3g/m3gcore11/src/m3g_image.c	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_image.c	Tue May 04 16:06:01 2010 +0100
@@ -835,22 +835,33 @@
                              M3Gsizei count)
 {
     M3Guint temp[SPAN_BUFFER_SIZE];
+    const char endianTest[4] = { 1, 0, 0, 0 };
 
     M3Guint srcBpp = m3gBytesPerPixel(srcFormat);
     M3Guint dstBpp = m3gBytesPerPixel(dstFormat);
     M3G_ASSERT(srcBpp > 0 && dstBpp > 0);
 
     while (count > 0) {
-        M3Gsizei n = (count < SPAN_BUFFER_SIZE) ? count : SPAN_BUFFER_SIZE;
-        if (srcFormat == M3G_ARGB8 && dstFormat != M3G_ARGB8) {
+        M3Gsizei n = count;
+
+        /* Check the source and destination formats to avoid 
+           the intermediate ARGB format conversion. */
+        if (((srcFormat == M3G_RGBA8 && (dstFormat == M3G_BGRA8 || dstFormat == M3G_BGR8_32))
+            || (dstFormat == M3G_RGBA8 && (srcFormat == M3G_BGRA8 || srcFormat == M3G_BGR8_32))) 
+            && (n > 2) && ((*(const int *)endianTest) == 1)) {
+            /* use fast path for RGBA<->BGRA conversion */
+            fastConvertBGRAToRGBA(src, n * srcBpp, n, 1, dst);
+        } else if (srcFormat == M3G_ARGB8 && dstFormat != M3G_ARGB8) {
             convertFromARGB((M3Guint*)src, n, dstFormat, dst);
         } else if (srcFormat != M3G_ARGB8 && dstFormat == M3G_ARGB8) {
             convertToARGB(srcFormat, src, n, (M3Guint*)dst);
         } else {
+            /* no luck, do the conversion via ARGB (source format -> ARGB -> destination format) */
+            n = (count < SPAN_BUFFER_SIZE) ? count : SPAN_BUFFER_SIZE;
             convertToARGB(srcFormat, src, n, temp);
             convertFromARGB(temp, n, dstFormat, dst);
         }
-        count -= SPAN_BUFFER_SIZE; /* \note may go negative */
+        count -= n;
         src += n * srcBpp;
         dst += n * dstBpp;
     }
@@ -1302,6 +1313,12 @@
                 return NULL;
             }
 
+#ifdef M3G_ENABLE_GLES_RESOURCE_HANDLING
+            /* If GLES resource freeing (see function m3gFreeGLESResources) 
+               is enabled, the GL texture might get deleted at any point, so
+			   a copy of the texture data has to be always kept in memory. */
+            img->pinned = M3G_TRUE;
+#else           
             /* Lock the image data in memory if the image is dynamic,
              * or the format has alpha information; otherwise, we'll
              * be able to get rid of an extra copy when generating a
@@ -1312,7 +1329,7 @@
                     img->format != M3G_LUMINANCE)) {
                 img->pinned = M3G_TRUE;
             }
-
+#endif
             /* If the image can be used as a rendering target, clear
              * to opaque white by default */
             
@@ -1368,13 +1385,14 @@
     
     image->flags = flags;
 
+#ifndef M3G_ENABLE_GLES_RESOURCE_HANDLING
     /* If the image format has no alpha information, we can discard
      * the image data under suitable conditions */
     
     if (image->format == M3G_RGB || image->format == M3G_LUMINANCE) {
         image->pinned = M3G_FALSE;
     }
-    
+#endif    
     M3G_LOG1(M3G_LOG_IMAGES, "Image 0x%08X made immutable\n",
              (unsigned) image);
 }
--- a/m3g/m3gcore11/src/m3g_interface.c	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_interface.c	Tue May 04 16:06:01 2010 +0100
@@ -68,8 +68,6 @@
         /*@shared@*/ m3gReleaseTargetFunc *releaseTarget;
     } func;
     
-    /*Object *objects;*/
-
     /*! \internal \brief Latest error code for this interface */
     M3Genum error;
 
@@ -90,6 +88,8 @@
     M3Gint glRefCount;
 #   endif
 
+    /* \internal \brief List of live objects */
+    PointerArray objects;     
     /*! \internal \brief Number of objects registered for this interface */
     M3Gint objCount;
 
@@ -946,20 +946,26 @@
  * \internal
  * \brief
  */
-static void m3gAddChildObject(Interface *m3g)
+static void m3gAddChildObject(Interface *m3g, Object *obj)
 {
     M3G_ASSERT(!m3g->shutdown);
     M3G_ASSERT(m3gInRange(m3g->objCount, 0, 0x7FFFFFFF));
     ++m3g->objCount;
+
+    /* Add the object to the list of live objects */
+    m3gArrayAppend(&m3g->objects, obj, m3g);
 }
 
 /*!
  * \internal
  * \brief
  */
-static void m3gDelChildObject(Interface *m3g)
+static void m3gDelChildObject(Interface *m3g, Object *obj)
 {
     M3G_ASSERT(m3g->objCount > 0);
+
+    /* Remove the object from the list of live objects */
+    m3gArrayDelete(&m3g->objects, m3gArrayFind(&m3g->objects, obj));
     if (--m3g->objCount == 0 && m3g->shutdown) {
         m3gDeleteInterface(m3g);
     }
@@ -968,6 +974,19 @@
 #if !defined(M3G_NGL_TEXTURE_API)
 /*!
  * \internal
+ * \brief Get a list of live objects with matching class ID
+ */
+static void m3gGetObjectsWithClassID(Interface *m3g, M3GClass classID, PointerArray* objects)
+{
+    M3Gsizei i = m3gArraySize(&m3g->objects);
+    while (i > 0) {
+        M3GObject obj = (M3GObject)m3gGetArrayElement(&m3g->objects, --i);
+        if (m3gGetClass(obj) == classID)
+            m3gArrayAppend(objects, obj, m3g);
+    }
+}
+/*!
+ * \internal
  * \brief Queue OpenGL texture objects for deletion
  *
  * The objects will be deleted when a GL context is next made current.
@@ -1242,6 +1261,7 @@
 
     M3G_ASSERT(numConfigs > 0);
     
+    eglBindAPI(EGL_OPENGL_ES_API);
     ctx = eglCreateContext(eglGetDisplay(0),
                            config,
                            NULL,
@@ -1661,6 +1681,7 @@
         /* All done! Now we can allocate the more trival stuff */
 
         m3g->tcache = m3gCreateTransformCache(m3g);
+        m3gInitArray(&m3g->objects);
         
         M3G_LOG1(M3G_LOG_INTERFACE,
                  "Interface 0x%08X initialized\n", (unsigned) m3g);
@@ -1690,6 +1711,7 @@
         return;
     }
 
+    m3gDestroyArray(&m3g->objects, m3g);
 #   if !defined(M3G_NGL_TEXTURE_API)
     /* Free the list of dead GL objects (those will have been deleted
      * along with the owning contexts by now) */
--- a/m3g/m3gcore11/src/m3g_math.c	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_math.c	Tue May 04 16:06:01 2010 +0100
@@ -1016,7 +1016,6 @@
     M3G_ASSERT(dst != NULL && left != NULL && right != NULL);
 
     {
-        
 #       if defined(M3G_HW_FLOAT)
         if (!left->complete) {
             m3gFillClassifiedMatrix((Matrix*)left);
@@ -1025,7 +1024,6 @@
             m3gFillClassifiedMatrix((Matrix*)right);
         }
 #       else
-        int row;
         const unsigned lmask = left->mask;
         const unsigned rmask = right->mask;
 #       endif
@@ -1033,25 +1031,29 @@
 #if defined(M3G_HW_FLOAT_VFPV2)
 		_m3gGenericMatrixProduct(dst, left, right);
 #else	
-        for (row = 0; row < 4; ++row) {
-            int col;
-            for (col = 0; col < 4; ++col) {
-                int k;
-                M3Gfloat a = 0;
-                for (k = 0; k < 4; ++k) {
-                    M3Gint lidx = MELEM(row, k);
-                    M3Gint ridx = MELEM(k, col);
-#                   if defined(M3G_HW_FLOAT)
-                    a = m3gMadd(left->elem[lidx], right->elem[ridx], a);
-#                   else
-                    a = m3gClassifiedMadd((lmask >> (2 * lidx)) & 3,
-                                          &left->elem[lidx],
-                                          (rmask >> (2 * ridx)) & 3,
-                                          &right->elem[ridx],
-                                          a);
-#                   endif /*!M3G_HW_FLOAT*/
+        {
+            int row;
+
+            for (row = 0; row < 4; ++row) {
+                int col;
+                for (col = 0; col < 4; ++col) {
+                    int k;
+                    M3Gfloat a = 0;
+                    for (k = 0; k < 4; ++k) {
+                        M3Gint lidx = MELEM(row, k);
+                        M3Gint ridx = MELEM(k, col);
+#                       if defined(M3G_HW_FLOAT)
+                        a = m3gMadd(left->elem[lidx], right->elem[ridx], a);
+#                       else
+                        a = m3gClassifiedMadd((lmask >> (2 * lidx)) & 3,
+                                              &left->elem[lidx],
+                                              (rmask >> (2 * ridx)) & 3,
+                                              &right->elem[ridx],
+                                              a);
+#                       endif /*!M3G_HW_FLOAT*/
+                    }
+                    M44F(dst, row, col) = a;
                 }
-                M44F(dst, row, col) = a;
             }
         }
 #endif /*!M3G_HW_FLOAT_VFPV2*/
@@ -3011,8 +3013,6 @@
         return;
     }
     else {
-        Vec4 v = *vec;
-        int i;
         int n = m3gIsWUnity(mtx) ? 3 : 4;
 
         if (!mtx->complete) {
@@ -3021,12 +3021,17 @@
 #if	defined(M3G_HW_FLOAT_VFPV2)
 		_m3gTransformVec4(mtx, vec, n);
 #else
-        for (i = 0; i < n; ++i) {
-            M3Gfloat d = m3gMul(M44F(mtx, i, 0), v.x);
-            d = m3gMadd(M44F(mtx, i, 1), v.y, d);
-            d = m3gMadd(M44F(mtx, i, 2), v.z, d);
-            d = m3gMadd(M44F(mtx, i, 3), v.w, d);
-            (&vec->x)[i] = d;
+        {
+            Vec4 v = *vec;
+            int i;
+
+            for (i = 0; i < n; ++i) {
+                M3Gfloat d = m3gMul(M44F(mtx, i, 0), v.x);
+                d = m3gMadd(M44F(mtx, i, 1), v.y, d);
+                d = m3gMadd(M44F(mtx, i, 2), v.z, d);
+                d = m3gMadd(M44F(mtx, i, 3), v.w, d);
+                (&vec->x)[i] = d;
+            }
         }
 #endif
     }
--- a/m3g/m3gcore11/src/m3g_object.c	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_object.c	Tue May 04 16:06:01 2010 +0100
@@ -56,7 +56,7 @@
     
     M3G_VALIDATE_OBJECT(obj);
 
-    m3gAddChildObject(interface);
+    m3gAddChildObject(interface, obj);
     m3gMarkObject(obj);
     
     m3gIncStat(M3G_INTERFACE(obj), M3G_STAT_OBJECTS, 1);
@@ -86,7 +86,7 @@
         m3gFree(obj->interface, obj->animTracks);
     }
 
-    m3gDelChildObject(obj->interface);
+    m3gDelChildObject(obj->interface, obj);
     m3gUnmarkObject(obj);
     
     m3gIncStat(M3G_INTERFACE(obj), M3G_STAT_OBJECTS, -1);
--- a/m3g/m3gcore11/src/m3g_rendercontext.c	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_rendercontext.c	Tue May 04 16:06:01 2010 +0100
@@ -403,6 +403,70 @@
 	return ctx->alphaWrite;
 }
 
+/*!
+ * \brief Frees all GLES resources allocated by the M3G API 
+ *        (EGL surfaces, contexts and texture objects). 
+ *
+ * \note M3G must not be bound to any target when calling this.
+ *
+ */
+M3G_API void m3gFreeGLESResources(M3GRenderContext ctx)
+{
+#ifdef M3G_ENABLE_GLES_RESOURCE_HANDLING
+
+    PointerArray image2DObjects;
+    M3Gint i;
+
+    /* M3G must not be bound to a rendering target at this point. */
+    if (ctx->target.type != SURFACE_NONE) {
+        m3gRaiseError(M3G_INTERFACE(ctx), M3G_INVALID_OPERATION);
+    }
+
+    /* EGL might not be initialized yet, so do it here just in case. */ 
+    eglInitialize(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL);
+    eglBindAPI(EGL_OPENGL_ES_API);
+    eglMakeCurrent(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL, NULL);
+
+    /* Delete EGL surfaces */
+    for (i = 0; i < M3G_MAX_GL_SURFACES; ++i) {
+        GLSurfaceRecord *surf = &ctx->glSurface[i];
+        if (surf->handle) {
+            m3gDeleteGLSurface(surf->handle);
+        }
+        m3gZero(surf, sizeof(GLSurfaceRecord));
+    }
+    if (ctx->backBuffer.glSurface != NULL) {
+        m3gDeleteGLSurface(ctx->backBuffer.glSurface);
+        m3gZero(&ctx->backBuffer, sizeof(BackBuffer));
+    }
+
+    /* Delete EGL contexts */
+    for (i = 0; i < M3G_MAX_GL_CONTEXTS; ++i) {
+        GLContextRecord *context = &ctx->glContext[i];
+        if (context->handle) {
+            m3gDeleteGLContext(context->handle);
+        }
+        m3gZero(context, sizeof(GLContextRecord));
+    }
+
+    /* Delete references to GLES texture objects from all live Image2D objects. 
+       Texture objects themselves have already been destroyed with the last GL context. */
+
+    m3gInitArray(&image2DObjects);
+    m3gGetObjectsWithClassID(M3G_INTERFACE(ctx), M3G_CLASS_IMAGE, &image2DObjects);
+
+    i = m3gArraySize(&image2DObjects);
+
+    while (i > 0) {
+        Image *image = (Image*)m3gGetArrayElement(&image2DObjects, --i);
+
+        m3gInvalidateImage(image);
+        image->texObject = 0;
+    }
+    m3gDestroyArray(&image2DObjects, M3G_INTERFACE(ctx));
+#endif
+}
+
 
 /*!
  * \internal
@@ -1324,8 +1388,8 @@
      * last time we rendered, then release the GL context so we don't
      * hog resources */
 #   if !defined(M3G_NGL_CONTEXT_API)
-    if (ctx->target.type != SURFACE_EGL) {
-//    m3gSwapBuffers(ctx->target.surface);
+    if (ctx->target.type == SURFACE_WINDOW) {
+        m3gSwapBuffers(ctx->target.surface);
     }
 #   endif
     m3gCollectGLObjects(M3G_INTERFACE(ctx));
--- a/m3g/m3gcore11/src/m3g_rendercontext.inl	Tue May 04 14:48:00 2010 +0100
+++ b/m3g/m3gcore11/src/m3g_rendercontext.inl	Tue May 04 16:06:01 2010 +0100
@@ -190,7 +190,6 @@
 {
     M3G_LOG(M3G_LOG_INTERFACE, "Initializing EGL\n");
     eglInitialize(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL);
-    eglBindAPI(EGL_OPENGL_ES_API);
 }
 
 /*!
@@ -760,7 +759,7 @@
     if (surfaceType == SURFACE_IMAGE) {
         return M3G_FALSE;
     }
-    if (surfaceType == SURFACE_EGL) {
+    if (surfaceType == SURFACE_EGL || surfaceType == SURFACE_WINDOW) {
         return M3G_TRUE;
     }
     
@@ -1059,32 +1058,50 @@
             stride = ctx->target.stride;
         }
                 
-        /* OK, got the pointer; now, copy a scanline at a
-         * time, and we can pretty much assume conversion
-         * since the fast method didn't work */
+        /* OK, got the pointer; now, copy a few scanlines at a
+         * time, and we can pretty much assume conversion since 
+         * the fast method didn't work */
+
+#define READPIXELS_BUFFER_SIZE      16384
+
+        if (width > 0 && height > 0) {
 
-        temp = m3gAllocTemp(M3G_INTERFACE(ctx), width * 4);
-        if (!temp) {
-            return; /* out of memory */
-        }
+            M3Gint bufSize = (width * 4 > READPIXELS_BUFFER_SIZE ? width * 4 : READPIXELS_BUFFER_SIZE);
+            M3Gint numLinesInBuffer = bufSize/(width * 4);
+            M3Gint numLinesRead, line;
+            temp = m3gAllocTemp(M3G_INTERFACE(ctx), bufSize);
+
+            if (!temp) {
+                return; /* out of memory */
+            }
 
-        dst += (ctx->target.height - (yOffset + height)) * stride
-            + xOffset * m3gBytesPerPixel(format);
-        
-        for (row = 0; row < height; ++row) {
-            glReadPixels(xOffset, yOffset + height - row - 1,
-                         width, 1,
-                         GL_RGBA, GL_UNSIGNED_BYTE,
-                         temp);
-            m3gConvertPixels(M3G_RGBA8, temp, format, dst, width);
-            dst += stride;
+            dst += (ctx->target.height - (yOffset + height)) * stride
+                + xOffset * m3gBytesPerPixel(format);
+
+            for (row = 0; row < height; row += numLinesRead) {
+                line = numLinesRead = (row + numLinesInBuffer > height) ? (height - row) : numLinesInBuffer;
+
+                glReadPixels(xOffset, 
+                    yOffset + height - row - numLinesRead,
+                    width, numLinesRead, 
+                    GL_RGBA, GL_UNSIGNED_BYTE, 
+                    temp);
+
+                while (line-- > 0) {
+                    m3gConvertPixels(M3G_RGBA8, &temp[4*line*width], format, dst, width);
+                    dst += stride;
+                }
+            }
+            m3gFreeTemp(M3G_INTERFACE(ctx));
         }
-        m3gFreeTemp(M3G_INTERFACE(ctx));
 
         if (ctx->target.type == SURFACE_BITMAP) {
             m3gglReleaseNativeBitmap((M3GNativeBitmap) ctx->target.handle);
         }
-    }
+
+#undef READPIXELS_BUFFER_SIZE
+
+    } 
     else {
         /* Buffered rendering is not supported for window and pbuffer
          * targets */
@@ -1390,6 +1407,9 @@
                 ctx->target.surface = surface;
             }
         }
+        /* Synchronize with native rendering in case we're 
+           rendering to a native bitmap (or window) target */
+        eglWaitNative(EGL_CORE_NATIVE_ENGINE);
 
         /* Update the current acceleration status */
         
--- a/printingservices/printerdriversupport/inc/pdrtext.h	Tue May 04 14:48:00 2010 +0100
+++ b/printingservices/printerdriversupport/inc/pdrtext.h	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-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"
@@ -34,6 +34,8 @@
 class CInfoFont;
 class CTypefaceFonts;
 class TTextFormat;
+class CPdrControl;
+class CFbsFont;
 
 
 class CPdrResources : public CBase
--- a/windowing/windowserver/Anim/MINANIM.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/Anim/MINANIM.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-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"
@@ -11,7 +11,6 @@
 // Contributors:
 //
 // Description:
-// MBMANIM.CPP
 // Template for writing Anim DLL's
 // 
 //
@@ -39,16 +38,14 @@
         {
     case EMinAnimWindow:
 	    return new(ELeave) CMinWindowAnim();
+	    
     case EMinAnimHandwriting:
 	    return new(ELeave) CMinHandAnim();
-    default:;       //To stop a warning
+	    
+    default:         
+        User::Leave(KErrArgument);
         }
-	}
-
-
-/*CMinWindowAnim*/
-
-	iAnimator->Animate();
+    return NULL;    // dummy return to prevent compiler error
 	}
 
 
@@ -96,12 +93,6 @@
 void CAnimateMbm::Redraw()
 	{
 	iGc->BitBlt(TPoint(),iBitmap);
-	/*if (1>0)
-		{
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetBrushColor(TRgb::Gray16(iIndex));
-		iGc->DrawRect(TRect(5,5,300,300));
-		}*/
 	}
 
 void CAnimateMbm::Command(TInt aOpcode,TAny *aParams)
@@ -126,7 +117,6 @@
 	case EMbmOpSetFileName:
 		iName=*STATIC_CAST(TBuf<32>*,aParams);
 		iIndex=0;
-		//User::LeaveIfError(LoadBitmap());
 		break;
 	default:
 		iFunctions->Panic();
@@ -139,10 +129,5 @@
 
 TInt CAnimateMbm::CommandReplyL(TInt /*aOpcode*/,TAny* /*aParams*/)
 	{
-	/*switch (aOpcode)
-		{
-		default:
-			iFunctions->Panic();
-		}*/
 	return KErrNone;
 	}
--- a/windowing/windowserver/SERVER/w32cmd.h	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/SERVER/w32cmd.h	Tue May 04 16:06:01 2010 +0100
@@ -978,21 +978,31 @@
 	};
 struct TWsClCmdRegisterEffect
     {
-    inline TWsClCmdRegisterEffect(TInt aAction, TUint aAppUid, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize);
+    inline TWsClCmdRegisterEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TUint aAppUid, TBitFlags aFlags);
     TInt tfxAction;
-    TUint tfxAppUid;
+    TInt tfxPurpose;
     TInt tfxDirStrSize;
     TInt tfxPhase1StrSize;
     TInt tfxPhase2StrSize;
+    TUint tfxAppUid;
+    TBitFlags tfxFlags;
+    };
+struct TWsClCmdUnRegisterEffect
+    {
+    inline TWsClCmdUnRegisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid);
+    TInt tfxAction;
+    TInt tfxPurpose;
+    TUint tfxAppUid;
     };
 struct TWsClCmdOverrideEffect
     {
-    inline TWsClCmdOverrideEffect(TBool aOneShot, TInt aAction, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize);
-    TBool tfxOneShot;
+    inline TWsClCmdOverrideEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TBitFlags aFlags);
     TInt tfxAction;
+    TInt tfxPurpose;
     TInt tfxDirStrSize;
     TInt tfxPhase1StrSize;
     TInt tfxPhase2StrSize;
+    TBitFlags tfxFlags;
     };
 typedef TRequestStatus *RqStatPtr;
 union TWsClCmdUnion
@@ -1047,6 +1057,7 @@
 	const TWsClCmdCreateDrawableSource* CreateDrawableSource;
 	const TWsClCmdSendEffectCommand* SendEffectCommand;
 	const TWsClCmdRegisterEffect* RegisterEffect;
+	const TWsClCmdUnRegisterEffect* UnRegisterEffect; 
 	const TWsClCmdOverrideEffect* OverrideEffect;
 	};
 
@@ -2271,11 +2282,14 @@
 inline TWsClCmdSendEffectCommand::TWsClCmdSendEffectCommand(TInt aTfxCmd,TInt aTfxCmdDataLength, TInt aWinHandle) :
     tfxCmd(aTfxCmd), tfxCmdDataLength(aTfxCmdDataLength), windowHandle(aWinHandle)
 	{}
-inline TWsClCmdRegisterEffect::TWsClCmdRegisterEffect(TInt aAction, TUint aAppUid, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize) :
-	tfxAction(aAction), tfxAppUid(aAppUid), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize)
+inline TWsClCmdRegisterEffect::TWsClCmdRegisterEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TUint aAppUid, TBitFlags aFlags) :
+	tfxAction(aAction), tfxPurpose(aPurpose), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize), tfxAppUid(aAppUid), tfxFlags(aFlags) 
 	{}
-inline TWsClCmdOverrideEffect::TWsClCmdOverrideEffect(TBool aOneShot, TInt aAction, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize) :
-	tfxOneShot(aOneShot), tfxAction(aAction), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize)
+inline TWsClCmdUnRegisterEffect::TWsClCmdUnRegisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid) :
+	tfxAction(aAction), tfxPurpose(aPurpose), tfxAppUid(aAppUid)
+	{}
+inline TWsClCmdOverrideEffect::TWsClCmdOverrideEffect(TInt aAction, TInt aPurpose, TInt aDirStrSize, TInt aPhase1StrSize, TInt aPhase2StrSize, TBitFlags aFlags) :
+	tfxAction(aAction), tfxPurpose(aPurpose), tfxDirStrSize(aDirStrSize), tfxPhase1StrSize(aPhase1StrSize), tfxPhase2StrSize(aPhase2StrSize), tfxFlags(aFlags)
 	{}
 inline TWsWinCmdAddKeyRect::TWsWinCmdAddKeyRect(const TRect &aRect,TInt aScanCode, TBool aActivatedByPointerSwitchOn) :
 	rect(aRect), scanCode(aScanCode), activatedByPointerSwitchOn(aActivatedByPointerSwitchOn)
--- a/windowing/windowserver/bwins/WS322U.DEF	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/bwins/WS322U.DEF	Tue May 04 16:06:01 2010 +0100
@@ -578,9 +578,9 @@
 	?SetPurpose@RWindowBase@@QAEXH@Z @ 577 NONAME ; void RWindowBase::SetPurpose(int)
 	?SendEffectCommand@RWindowBase@@QAEXHABVTDesC8@@@Z @ 578 NONAME ; void RWindowBase::SendEffectCommand(int, class TDesC8 const &)
 	?SendEffectCommand@RWsSession@@QAEXHABVTDesC8@@@Z @ 579 NONAME ; void RWsSession::SendEffectCommand(int, class TDesC8 const &)
-	?RegisterEffect@RWsSession@@QAEXHABV?$TBuf@$0BAA@@@00I@Z @ 580 NONAME ; void RWsSession::RegisterEffect(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int)
-	?OverrideEffects@RWindowBase@@QAEXHHABV?$TBuf@$0BAA@@@00@Z @ 581 NONAME ; void RWindowBase::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
-	?OverrideEffects@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00@Z @ 582 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
-	?UnregisterEffect@RWsSession@@QAEXH@Z @ 583 NONAME ; void RWsSession::UnregisterEffect(int)
+	?RegisterEffect@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00IV?$TBitFlagsT@K@@@Z @ 580 NONAME ; void RWsSession::RegisterEffect(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int, class TBitFlagsT<unsigned long>)
+	?OverrideEffects@RWindowBase@@QAEXHABV?$TBuf@$0BAA@@@00V?$TBitFlagsT@K@@@Z @ 581 NONAME ; void RWindowBase::OverrideEffects(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
+	?OverrideEffects@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00V?$TBitFlagsT@K@@@Z @ 582 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
+	?UnregisterEffect@RWsSession@@QAEXHHI@Z @ 583 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int)
 	?UnregisterAllEffects@RWsSession@@QAEXXZ @ 584 NONAME ; void RWsSession::UnregisterAllEffects(void)
 
--- a/windowing/windowserver/bwins/ws32switchu.def	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/bwins/ws32switchu.def	Tue May 04 16:06:01 2010 +0100
@@ -578,9 +578,9 @@
 	call_vector_577 @ 577 NONAME ; void RWindowBase::SetPurpose(int)
 	call_vector_578 @ 578 NONAME ; void RWindowBase::SendEffectCommand(int, class TDesC8 const &)
 	call_vector_579 @ 579 NONAME ; void RWsSession::SendEffectCommand(int, class TDesC8 const &)
-	call_vector_580 @ 580 NONAME ; void RWsSession::RegisterEffect(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int)
-	call_vector_581 @ 581 NONAME ; void RWindowBase::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
-	call_vector_582 @ 582 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
-	call_vector_583 @ 583 NONAME ; void RWsSession::UnregisterEffect(int)
+	call_vector_580 @ 580 NONAME ; void RWsSession::RegisterEffect(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int, class TBitFlagsT<unsigned long>)
+	call_vector_581 @ 581 NONAME ; void RWindowBase::OverrideEffects(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
+	call_vector_582 @ 582 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
+	call_vector_583 @ 583 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int)
 	call_vector_584 @ 584 NONAME ; void RWsSession::UnregisterAllEffects(void)
 
--- a/windowing/windowserver/eabi/WS322U.DEF	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/eabi/WS322U.DEF	Tue May 04 16:06:01 2010 +0100
@@ -652,9 +652,9 @@
 	_ZN10RWsSession17SendEffectCommandEiRK6TDesC8 @ 651 NONAME
 	_ZN11RWindowBase10SetPurposeEi @ 652 NONAME
 	_ZN11RWindowBase17SendEffectCommandEiRK6TDesC8 @ 653 NONAME
-	_ZN10RWsSession14RegisterEffectEiRK4TBufILi256EES3_S3_j @ 654 NONAME
-	_ZN10RWsSession15OverrideEffectsEiiRK4TBufILi256EES3_S3_ @ 655 NONAME
-	_ZN10RWsSession16UnregisterEffectEi @ 656 NONAME
+	_ZN10RWsSession14RegisterEffectEiiRK4TBufILi256EES3_S3_j10TBitFlagsTImE @ 654 NONAME
+	_ZN10RWsSession15OverrideEffectsEiiRK4TBufILi256EES3_S3_10TBitFlagsTImE @ 655 NONAME
+	_ZN10RWsSession16UnregisterEffectEiij @ 656 NONAME
 	_ZN10RWsSession20UnregisterAllEffectsEv @ 657 NONAME
-	_ZN11RWindowBase15OverrideEffectsEiiRK4TBufILi256EES3_S3_ @ 658 NONAME
+	_ZN11RWindowBase15OverrideEffectsEiRK4TBufILi256EES3_S3_10TBitFlagsTImE @ 658 NONAME
 
--- a/windowing/windowserver/econs/D_EXC.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/econs/D_EXC.CPP	Tue May 04 16:06:01 2010 +0100
@@ -104,8 +104,6 @@
 	}
 
 _LIT(KFormatStackInfo,"Stack %08x-%08x (? %d?), sp=%08x\r");
-//_LIT(KGrabStack,"Capture stack data");
-//_LIT(KNoStack,"Don't risk it");
 
 HBufC8* GrabStack(const TDesC& /*aLine1*/, TThreadId aId, TUint aSp, TInt& aStackBase, TInt& aStackSize)
 	{
@@ -148,18 +146,7 @@
 
 	TBuf<0x100> line2;
 	line2.Format(KFormatStackInfo, aStackBase, aStackBase+aStackSize-1, aStackSize, aSp);
-    //Don't ask the user just do it for WSERV
-	/*RNotifier ask;
-	if (ask.Connect() != KErrNone)
-		return 0;
-	TRequestStatus status;
-	TInt buttonval=1;
-	ask.Notify(aLine1,line2,KGrabStack,KNoStack,buttonval,status);
-	User::WaitForRequest(status);
-	ask.Close();
-	if (status.Int()!=KErrNone || buttonval != 0)
-		return 0;*/
-
+    
 	// OK - let stack grabbing commence
 	HBufC8* stackbuf = HBufC8::New(aStackSize);
 	if (stackbuf==0)
@@ -193,9 +180,9 @@
 	TBuf<0x100> line2;
 	SDebugInfo info;
 	struct SRegisterInfo reginfo;
-	TUint pc;
+	TUint pc = 0;
 	TUint regs[16];
-	const TDll* faultDll;
+	const TDll* faultDll = NULL;
 
 	_LIT(KInfo1, "D_EXC started");
 	User::InfoPrint(KInfo1);
@@ -204,7 +191,7 @@
 //	FOREVER
 	for (TInt rep=0; rep<2; rep++)	// die after two exceptions
 		{
-		TInt err;
+		TInt err = KErrNone;
 		// wait for any thread to panic...
 
 
@@ -240,7 +227,7 @@
 		// assume that it's KERN-EXEC 3 and try to use the 
 		// full RDebug support to locate the faulting instruction
 
-		HBufC8* stack=0;
+		HBufC8* stack = NULL;
 		TInt stackbase=0;
 		TInt stacksize=0;
 
@@ -257,14 +244,15 @@
 				{
 				RDebug::GetRegister(info.iId,reginfo.iNumberOfPcRegister, pc);
 				for (int i=0; i<16; i++)
+				    {
 					RDebug::GetRegister(info.iId, i, regs[i]);
+				    }
 				}
 
 			TDllList::FindDlls();
 
 			stack=GrabStack(line1, info.iId, regs[KStackPointerReg], stackbase, stacksize);
 
-			//RDebug::KillThread(info.iId);
 			RDebug::Close();
 			}
 
@@ -275,28 +263,37 @@
 		_LIT(KFormatOther,	"pc=%08x, iCodeAddr=%08x\r");
 		_LIT(KFormatError,	"(Unable to determine pc)\r");
 
+
 		if ((pc&3) == 0)
 			{
 			if (pc >= 0x20000000 && pc < 0x30000000)
+			    {
 				line2.Format(KFormatEXE, pc, pc-0x20000000+0x400010);
-			else
-			if (pc >= 0x50000000 && pc < 0x60000000)
-				line2.Format(KFormatROM, pc);
+			    }
+			else if (pc >= 0x50000000 && pc < 0x60000000)
+				{
+                line2.Format(KFormatROM, pc);
+				}
+			else if (TDllList::Match(pc, faultDll)==KErrNone)
+			    {
+				line2.Format(KFormatDll, pc, &faultDll->iName, pc-(faultDll->iBase)+0x10000010);
+			    }
 			else
-			if (TDllList::Match(pc, faultDll)==KErrNone)
-				line2.Format(KFormatDll, pc, &faultDll->iName, pc-(faultDll->iBase)+0x10000010);
-
-			else
+			    {
 				line2.Format(KFormatOther, pc, info.iCodeAddr);
-
+			    }
 			}
 		else
+		    {
 			line2.Copy(KFormatError);
-
+		    }
+		
 		RFs fs;
 		err = fs.Connect();
 		if (err!=KErrNone)
+		    {
 			break;
+		    }
 
 		_LIT(KFormatFilename,"d:\\d_exc_%d.txt");
 		_LIT(KFormatStackname,"d:\\d_exc_%d.stk");
@@ -309,7 +306,10 @@
 		RFile file;
 		err=file.Replace(fs, name, EFileWrite+EFileShareAny+EFileStreamText);
 		if (err!=KErrNone)
-			break;
+		    {
+            fs.Close();
+            break;
+		    }
 
 		TFileText textfile;
 		textfile.Set(file);
--- a/windowing/windowserver/group/openwfc/BLD.INF	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/group/openwfc/BLD.INF	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-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"
@@ -34,6 +34,7 @@
 ../../inc/sizemode.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(sizemode.h)
 ../../inc/pointerevent.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(pointerevent.h)
 ../../inc/advancedpointerevent.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(advancedpointerevent.h)
+../../inc/advancedpointerevent.inl SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(advancedpointerevent.inl)
 ../../inc/textcursor.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(textcursor.h)
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
 #ifdef SYMBIAN_OLD_EXPORT_LOCATION
@@ -77,6 +78,7 @@
 ../../inc/Graphics/wsdisplaypolicy.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wsdisplaypolicy.h)
 ../../inc/Graphics/openwfc/wselement.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wselement.h)
 ../../inc/Graphics/openwfc/wsscene.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wsscene.h)
+../../inc/Graphics/wscontentreadyforcomposition.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wscontentreadyforcomposition.h)
 
 //RemoteGc exports for partners
 ../../inc/RemoteGc.h		SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/remotegc.h)
--- a/windowing/windowserver/inc/Graphics/openwfc/WSGRAPHICDRAWERINTERFACE.H	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/inc/Graphics/openwfc/WSGRAPHICDRAWERINTERFACE.H	Tue May 04 16:06:01 2010 +0100
@@ -417,7 +417,7 @@
 	KMWsWindowTree = 35,				// Object Extension to be used by render stages for recovery of MWsWindowTree
 	KMWsScene = 36,                     // CWsRenderStage Object Extension will yield an MWsScene
 	                                    //      MWsScene::CreateSceneElement will yield a MWsElement
-
+	KMWsContentReadyForComposition = 37,// CWsRenderStage Object Extension will optionally yield an MWsContentReadyForComposition
 	};
 
 class TSurfaceConfiguration;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/inc/Graphics/wscontentreadyforcomposition.h	Tue May 04 16:06:01 2010 +0100
@@ -0,0 +1,48 @@
+// 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:
+// 
+//
+
+/**
+ @file
+ @publishedPartner
+ @released
+*/
+
+#ifndef __WSCONTENTREADYFORCOMPOSITION_H__
+#define __WSCONTENTREADYFORCOMPOSITION_H__
+
+
+#include <e32std.h>
+#include <graphics/surface.h>
+#include <graphics/wsgraphicdrawerinterface.h>
+
+
+/**
+MWsContentReadyForComposition is an interface used to wrap the underlying
+compositor extension, MContentReadyForComposition, into the window server.
+See contentreadyforcomposition.h for deatils of the API.
+*/
+class MWsContentReadyForComposition : public MWsObjectProvider
+    {
+public:
+    DECLARE_WS_TYPE_ID(KMWsContentReadyForComposition)
+
+public:
+    virtual void NotifyContentReady(const TSurfaceId& aSurface, TUint64 aContentUpdate, TRequestStatus& aNotifyReady) = 0;
+    virtual void NotifyContentReadyCancel(const TSurfaceId& aSurface) = 0;
+    };
+
+
+#endif //__WSCONTENTREADYFORCOMPOSITION_H__
--- a/windowing/windowserver/inc/W32STD.H	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/inc/W32STD.H	Tue May 04 16:06:01 2010 +0100
@@ -32,6 +32,7 @@
 #include <pointerevent.h>
 #include <advancedpointerevent.h>
 #include <sizemode.h>
+#include <babitflags.h>
 
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
 #include <graphics/windowserverconstants.h>
@@ -1532,10 +1533,10 @@
 	IMPORT_C void SendEffectCommand(TInt aTfxCmd, const TDesC8& aTfxCmdData=KNullDesC8);
 
 // Registering/Unregistering of TFX effect, to allow animations to be associated with each transition
-	IMPORT_C void RegisterEffect(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TUint aAppUid = NULL);
-	IMPORT_C void UnregisterEffect(TInt aAction);
+	IMPORT_C void RegisterEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid=0, TBitFlags aFlags=0);
+	IMPORT_C void UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid=0);
 	IMPORT_C void UnregisterAllEffects();
-	IMPORT_C void OverrideEffects(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2);
+	IMPORT_C void OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
 	
 // functions not exported, used by CWsGraphic
 	void GraphicMessageReady(TRequestStatus *aStat);
@@ -1726,7 +1727,7 @@
 	IMPORT_C void EnableAdvancedPointers();
 	IMPORT_C void SetPurpose(TInt aPurpose);
 	IMPORT_C void SendEffectCommand(TInt aTfxCmd, const TDesC8& aTfxCmdData=KNullDesC8);
-	IMPORT_C void OverrideEffects(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2);
+	IMPORT_C void OverrideEffects(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
 protected:
 	TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
 	};
--- a/windowing/windowserver/inc/advancedpointerevent.h	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/inc/advancedpointerevent.h	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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"
@@ -16,6 +16,17 @@
 #ifndef ADVANCEDPOINTEREVENT_H
 #define ADVANCEDPOINTEREVENT_H
 
+#ifndef __E32STD_H__
+#include <e32std.h>
+#endif
+#ifndef __E32KEYS_H__
+#include <e32keys.h>
+#endif
+#ifndef POINTEREVENT_H
+#include <pointerevent.h>
+#endif
+
+
 /** Subclass of TPointerEvent created in order to maintain binary compatibility while
 extending TPointerEvent with new data:
 (1) pointer number of the pointer whose state change is described by the event,
@@ -140,4 +151,7 @@
 	{
 	return (iModifiers&EModifierAdvancedPointerEvent ? static_cast<const TAdvancedPointerEvent*>(this) : NULL);	
 	}
+
+#include "advancedpointerevent.inl"
+
 #endif /* ADVANCEDPOINTEREVENT_H */
--- a/windowing/windowserver/inc/advancedpointerevent.inl	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/inc/advancedpointerevent.inl	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -18,7 +18,6 @@
 #ifndef ADVANCEDPOINTEREVENT_INL_
 #define ADVANCEDPOINTEREVENT_INL_
 
-#include <w32std.h>
 
 /**	Does basic initialisation of a TAdvancedPointerEvent
 	@internalTechnology */
--- a/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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"
@@ -1888,24 +1888,24 @@
     Write(&params,sizeof(params),aTfxCmdData.Ptr(),aTfxCmdData.Size(),EWsWinOpSendEffectCommand);
     }
 
-EXPORT_C void RWindowBase::OverrideEffects(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2)
+EXPORT_C void RWindowBase::OverrideEffects(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
 /**
 Overides the default animation for current window's transition effect by sent animation description.
 Please refer RWsSession::RegisterEffect() comments for more information on animation description.
 
-@param aOneShot A flag to see if the specified override should be applied once or on an ongoing basis
 @param aAction The particular transition to set the animation for.
 @param aResourceDir The name of the directory that contains the animation description files.
-@param aFilenamePhase1 The file containing the description of the animation for the first phase(Phase1) of the transition.
-					   Specify KNullDesC for no Phase1 effect.
-@param aFilenamePhase2 The file containing the description of the animation for the second phase(Phase2) of the transition.
-					   Specify KNullDesC for no Phase2 effect.
+@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
+						 Specify KNullDesC for no outgoing phase effect.
+@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
+						 Specify KNullDesC for no incoming phase effect.
+@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
 
 @publishedPartner
 */
 	{
 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
-	tfxEffect.OverrideTFXEffect(aOneShot, aAction, aResourceDir, aFilenamePhase1, aFilenamePhase2, RTFXEffect::ETFXWindow);
+	tfxEffect.OverrideTFXEffect(RTFXEffect::ETFXWindow, aAction, 0, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aFlags);
 	}
 //////////////////////////// RDrawableWindow ////////////////////////////////
 
--- a/windowing/windowserver/nga/CLIENT/RWS.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/CLIENT/RWS.CPP	Tue May 04 16:06:01 2010 +0100
@@ -2309,9 +2309,11 @@
 	}
 	
 EXPORT_C void RWsSession::ClearAllRedrawStores()
-/** Clear the redraw store for all windows in the system
-By default Windows will recorded the drawing commands used during a redraw and use them latter if the window needs to be redrawn.
-Calling this function will cause all these stores to be thrown away redraw will then be sent to all window, visible windows will recieve them first.
+/** Clear the redraw store for all windows in the system.
+By default Windows will record the drawing commands used during a redraw and re-use them later if the window needs to be redrawn.
+Calling this function will cause all these server-side stores to be thrown away, redraw requests will then be sent to all client-side windows. Visible windows will receive them first.
+
+In most cases you should be using RWindow::ClearRedrawStore instead of this function. 
 
 This function always causes a flush of the window server buffer.*/
 	{
@@ -2489,6 +2491,9 @@
  TFX Render Stage will accept only TFX application specific commands and data.
 @param aTfxCmd TFX Render Stage command.
 @param aTfxCmdData Structure related to the specified value of aTfxCmd, the default value is KNullDesC8.
+
+@capability WriteDeviceData Only if aTfxCmd has value ETfxCmdEnableAllTransitions or ETfxCmdDisableAllTransitions
+
 @publishedPartner
 */
 	{
@@ -2497,7 +2502,7 @@
 	Write(&params,sizeof(params),aTfxCmdData.Ptr(),aTfxCmdData.Size(),EWsClOpSendEffectCommand);
 	}
 
-EXPORT_C void RWsSession::RegisterEffect(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TUint aAppUid)
+EXPORT_C void RWsSession::RegisterEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid, TBitFlags aFlags)
 /**
 Sets a specific animation for a particular transition effect.
 
@@ -2506,62 +2511,77 @@
 An animation is specified by a filename and directory; the file will contain a description of the animation 
 for that transition.  In fact each transition can have two animations associated with it, for example 
 an App shut down could have one animation with the old application disappearing and then another animation 
-for the App Launcher (or home screen) appearing.  In this API these are referred to as “Phase1” and “Phase2”.
+for the App Launcher (or home screen) appearing.
 
 Animation can be applied to all App's Transition effect or to a specfic App by providing its AppUid.
 
 @param aAction Particular transition to register the animation for.
+@param aPurpose The purpose of the window.
 @param aResourceDir The name of the directory that contains the animation description files.
-@param aFilenamePhase1 The file containing the description of the animation for the first phase(Phase1) of the transition. 
-					   Specify KNullDesC for no Phase1 effect.
-@param aFilenamePhase2 The file containing the description of the animation for the second phase(Phase2) of the transition. 
-					   Specify KNullDesC for no Phase2 effect.
+@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
+						 Specify KNullDesC for no outgoing phase effect.
+@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
+						 Specify KNullDesC for no incoming phase effect.
 @param aAppUid The Application UID this effect applies to. Set to zero to specify that all apps will use default effect.
+@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
+
+@capability WriteDeviceData This API does nothing if the client does not possess required Capability
 
 @publishedPartner
 */
 	{
 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
-	tfxEffect.RegisterTFXEffect(aAction, aResourceDir, aFilenamePhase1, aFilenamePhase2, aAppUid);
+	tfxEffect.RegisterTFXEffect(aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aAppUid, aFlags);
 	}
 
-EXPORT_C void RWsSession::UnregisterEffect(TInt aAction)
+EXPORT_C void RWsSession::UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid)
 /**
-Unregister already set animation for a particular transition effect.
+Unregister already set animation for a particular transition effect
 
 @param aAction Particular transition to unregister the animation for.
+@param aPurpose The purpose of the window.
+@param aAppUid The Application UID this effect applies to. Set to 0 to specify the default effect will be unregistered.
+
+@capability WriteDeviceData This API does nothing if the client does not possess required Capability
+
 @publishedPartner
 */
 	{
-	WriteInt(aAction, EWsClOpUnregisterTFXEffect);
+	TWsClCmdUnRegisterEffect unregisterEffect(aAction, aPurpose, aAppUid);
+	Write(&unregisterEffect, sizeof(unregisterEffect), EWsClOpUnregisterTFXEffect);
 	}
 
 EXPORT_C void RWsSession::UnregisterAllEffects()
 /**
 Unregister animation for all transition effects.
 
+@capability WriteDeviceData This API does nothing if the client does not possess required Capability
+
 @publishedPartner
 */
 	{
 	Write(EWsClOpUnregisterAllTFXEffect);
 	}
 	
-EXPORT_C void RWsSession::OverrideEffects(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2)
+EXPORT_C void RWsSession::OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
 /**
 Overides the default animation for given app's transition effect by sent animation description.
 Please refer RWsSession::RegisterEffect() comments for more information on animation description.
 
-@param aOneShot A flag to see if the specified override should be applied once or on an ongoing basis
 @param aAction The particular transition to set the animation for.
+@param aPurpose This override only effects the window/layers owned by the application that have the specified purpose.
 @param aResourceDir The name of the directory that contains the animation description files.
-@param aFilenamePhase1 The file containing the description of the animation for the first phase(Phase1) of the transition.
-					   Specify KNullDesC for no Phase1 effect.
-@param aFilenamePhase2 The file containing the description of the animation for the second phase(Phase2) of the transition.
-					   Specify KNullDesC for no Phase2 effect.
+@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
+						 Specify KNullDesC for no outgoing phase effect.
+@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
+						 Specify KNullDesC for no incoming phase effect.
+@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
+
+@capability WriteDeviceData This API does nothing if the client does not possess required Capability
 
 @publishedPartner
 */
 	{
 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
-	tfxEffect.OverrideTFXEffect(aOneShot, aAction, aResourceDir, aFilenamePhase1, aFilenamePhase2, RTFXEffect::ETFXSession);
+	tfxEffect.OverrideTFXEffect(RTFXEffect::ETFXSession, aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aFlags);
 	}
--- a/windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/CLIENT/advancedpointerevent.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -17,7 +17,7 @@
 //
 
 #include "W32STD.H"
-#include "advancedpointerevent.inl"
+
 
 EXPORT_C TInt TAdvancedPointerEvent::DoGetPointerNumber() const
 /** Gets the pointer number for the event
--- a/windowing/windowserver/nga/CLIENT/rtfxeffect.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/CLIENT/rtfxeffect.cpp	Tue May 04 16:06:01 2010 +0100
@@ -39,19 +39,19 @@
 and stores them in member variables
 
 @param aResourceDir directory name of animation description file
-@param aFilenamePhase1 File name of first phase animation of  TFX
-@param aFilenamePhase2 File name of second phase animation of  TFX
+@param aFilenameOutgoing File name of Outgoing phase of TFX
+@param aFilenameIncoming File name of Incoming phase of TFX
 */
 void RTFXEffect::CheckFileNameAndSetSizes(const TFileName& aResourceDir, 
-		const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2)
+		const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming)
 	{
 	__ASSERT_ALWAYS(aResourceDir.Length() <= KMaxFileName, Panic(EW32PanicStringTooLong));
-	__ASSERT_ALWAYS(aFilenamePhase1.Length() <= KMaxFileName, Panic(EW32PanicStringTooLong));
-	__ASSERT_ALWAYS(aFilenamePhase2.Length() <= KMaxFileName, Panic(EW32PanicStringTooLong));
+	__ASSERT_ALWAYS(aFilenameOutgoing.Length() <= KMaxFileName, Panic(EW32PanicStringTooLong));
+	__ASSERT_ALWAYS(aFilenameIncoming.Length() <= KMaxFileName, Panic(EW32PanicStringTooLong));
 	
 	iDirPathSizePaded = PaddedValue(aResourceDir.Size());
-	iFileName1SizePaded = PaddedValue(aFilenamePhase1.Size());
-	iFileName2SizePaded = PaddedValue(aFilenamePhase2.Size());
+	iFileName1SizePaded = PaddedValue(aFilenameOutgoing.Size());
+	iFileName2SizePaded = PaddedValue(aFilenameIncoming.Size());
 	
 	iCombSizePaded = iDirPathSizePaded + iFileName1SizePaded + iFileName2SizePaded;
 	}
@@ -63,20 +63,20 @@
 for more details.
 
 @param aResourceDir directory name of animation description file
-@param aFilenamePhase1 File name of first phase animation of  TFX
-@param aFilenamePhase2 File name of second phase animation of  TFX
+@param aFilenameOutgoing File name of Outgoing phase of TFX
+@param aFilenameIncoming File name of Incoming phase of TFX
 */
-void RTFXEffect::AppendFileNameData(const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2)
+void RTFXEffect::AppendFileNameData(const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming)
 	{
 	AppendData(aResourceDir.Ptr(), aResourceDir.Size(), EFalse);
-    AppendData(aFilenamePhase1.Ptr(), aFilenamePhase1.Size(), EFalse);
-    AppendData(aFilenamePhase2.Ptr(), aFilenamePhase2.Size(), ETrue);
+    AppendData(aFilenameOutgoing.Ptr(), aFilenameOutgoing.Size(), EFalse);
+    AppendData(aFilenameIncoming.Ptr(), aFilenameIncoming.Size(), ETrue);
 	}
 
 /**
 Writes file names using IPC args along with data related to TWsClCmdRegisterEffect
-First phase animation file name is sent in seocnd slot of IPC to server
-Second phase animation file name is sent in third slot of IPC to server
+Out going phase animation file name is sent in second slot of IPC to server
+In coming phase animation file name is sent in third slot of IPC to server
 Data related to TWsClCmdRegisterEffect and folder name are sent in the normal wserv buffer
 
 @param aForRegister an object of TWsClCmdRegisterEffect filled with data related to RegisterTFXEffect
@@ -84,16 +84,16 @@
 @param aForOverride an object of TWsClCmdOverrideEffect filled with data related to OverrideTFXEffect
 					If non Empty then this function is called for Overide effect					 
 @param aResourceDir directory name of animation description file
-@param aFilenamePhase1 File name of first phase animation of  TFX
-@param aFilenamePhase2 File name of second phase animation of  TFX
+@param aFilenameOutgoing File name of Outgoing phase of TFX
+@param aFilenameIncoming File name of Incoming phase of TFX
 @param aCalledFrom value from TFXEffect enum reprseting whether called from RWsSession or RWindowbase 	
 */
 void RTFXEffect::WriteDataUsingIPC(TWsClCmdRegisterEffect* aForRegister, TWsClCmdOverrideEffect* aForOverride, 
-		const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TFXEffect aCalledFrom)
+		const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TFXEffect aCalledFrom)
 	{
 	TIpcArgs ipcArgsDesc;
-	ipcArgsDesc.Set(1, &aFilenamePhase1);
-	ipcArgsDesc.Set(2, &aFilenamePhase2);
+	ipcArgsDesc.Set(1, &aFilenameOutgoing);
+	ipcArgsDesc.Set(2, &aFilenameIncoming);
 	// If called for RegisterTFXEffect
 	if (aForRegister)
 		{
@@ -136,30 +136,32 @@
  And at server side get one string from buffer and other 2 from IPC
 
 @param aAction Particular transition to register the animation for.
+@param aPurpose The purpose of the window.
 @param aResourceDir The name of the directory that contains the animation description files.
-@param aFilenamePhase1 The file containing the description of the animation for the first phase(Phase1) of the transition. 
-					   Specify KNullDesC for no Phase1 effect.
-@param aFilenamePhase2 The file containing the description of the animation for the second phase(Phase2) of the transition. 
-					   Specify KNullDesC for no Phase2 effect.
+@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
+						 Specify KNullDesC for no outgoing phase effect.
+@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
+						 Specify KNullDesC for no incoming phase effect.
 @param aAppUid The Application UID this effect applies to. Set to zero to specify that all apps will use default effect.
+@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
 */
-void RTFXEffect::RegisterTFXEffect(TInt aAction, const TFileName& aResourceDir, 
-		const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TUint aAppUid)
+void RTFXEffect::RegisterTFXEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, 
+		const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid, TBitFlags aFlags)
 	{
-	CheckFileNameAndSetSizes(aResourceDir, aFilenamePhase1, aFilenamePhase2);
+	CheckFileNameAndSetSizes(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
 	if (CheckCombinedSizeWithCurrentBuffer(sizeof(TWsClCmdRegisterEffect)))
 		{
-		TWsClCmdRegisterEffect params(aAction, aAppUid, aResourceDir.Size(), aFilenamePhase1.Size(), aFilenamePhase2.Size());
+		TWsClCmdRegisterEffect params(aAction, aPurpose, aResourceDir.Size(), aFilenameOutgoing.Size(), aFilenameIncoming.Size(), aAppUid, aFlags);
 		// Here we just pass the length of combined strings so that it checks and does flush if needed.
 		// Then AppendData actually adds the data to buffer at the end
 		Write(&params, sizeof(params), iCombSizePaded, EWsClOpRegisterTFXEffectBuf);
 		if (iCombSizePaded > 0)
-			AppendFileNameData(aResourceDir, aFilenamePhase1, aFilenamePhase2);
+			AppendFileNameData(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
 		}
 	else
 		{
-		TWsClCmdRegisterEffect params(aAction, aAppUid, aResourceDir.Size(), 0, 0);
-		WriteDataUsingIPC(&params, NULL, aResourceDir, aFilenamePhase1, aFilenamePhase2, ETFXSession);
+		TWsClCmdRegisterEffect params(aAction, aPurpose, aResourceDir.Size(), 0, 0, aAppUid, aFlags);
+		WriteDataUsingIPC(&params, NULL, aResourceDir, aFilenameOutgoing, aFilenameIncoming, ETFXSession);
 		}
 	}
 
@@ -167,28 +169,29 @@
 Checks the length of sent variables and does as explained in
 RTFXEffect::RegisterTFXEffect() API description
 
-@param aOneShot A flag to see if the specified override should be applied once or on an ongoing basis
 @param aAction The particular transition to set the animation for.
+@param aPurpose This override only effects the window/layers owned by the application that have the specified purpose.
 @param aResourceDir The name of the directory that contains the animation description files.
-@param aFilenamePhase1 The file containing the description of the animation for the first phase(Phase1) of the transition.
-					   Specify KNullDesC for no Phase1 effect.
-@param aFilenamePhase2 The file containing the description of the animation for the second phase(Phase2) of the transition.
-					   Specify KNullDesC for no Phase2 effect.
+@param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
+						 Specify KNullDesC for no outgoing phase effect.
+@param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
+						 Specify KNullDesC for no incoming phase effect.
+@param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
 */
-void RTFXEffect::OverrideTFXEffect(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, 
-		const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TFXEffect aCalledFrom)
+void RTFXEffect::OverrideTFXEffect(TFXEffect aCalledFrom, TInt aAction, TInt aPurpose, const TFileName& aResourceDir, 
+		const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
 	{
-	CheckFileNameAndSetSizes(aResourceDir, aFilenamePhase1, aFilenamePhase2);
+	CheckFileNameAndSetSizes(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
 	if (CheckCombinedSizeWithCurrentBuffer(sizeof(TWsClCmdOverrideEffect)))
 		{
-		TWsClCmdOverrideEffect params(aOneShot, aAction, aResourceDir.Size(), aFilenamePhase1.Size(), aFilenamePhase2.Size());
+		TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), aFilenameOutgoing.Size(), aFilenameIncoming.Size(), aFlags);
 		Write(&params, sizeof(params), iCombSizePaded, (aCalledFrom == ETFXSession ? EWsClOpOverrideEffectBuf : EWsWinOpOverrideEffectBuf));
 		if (iCombSizePaded > 0)
-			AppendFileNameData(aResourceDir, aFilenamePhase1, aFilenamePhase2);
+			AppendFileNameData(aResourceDir, aFilenameOutgoing, aFilenameIncoming);
 		}
 	else
 		{
-		TWsClCmdOverrideEffect params(aOneShot, aAction, aResourceDir.Size(), 0, 0);
-		WriteDataUsingIPC(NULL, &params, aResourceDir, aFilenamePhase1, aFilenamePhase2, aCalledFrom);
+		TWsClCmdOverrideEffect params(aAction, aPurpose, aResourceDir.Size(), 0, 0, aFlags);
+		WriteDataUsingIPC(NULL, &params, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aCalledFrom);
 		}
 	}
--- a/windowing/windowserver/nga/CLIENT/rtfxeffect.h	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/CLIENT/rtfxeffect.h	Tue May 04 16:06:01 2010 +0100
@@ -45,12 +45,11 @@
 		ETFXWindow
 		};
 	RTFXEffect(TInt aHandle, RWsBuffer* aBuffer);
-	void CheckFileNameAndSetSizes(const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2);
-	void RegisterTFXEffect(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TUint aAppUid);
-	void OverrideTFXEffect(TBool aOneShot, TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TFXEffect aCalledFor);
-	void AppendFileNameData(const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2);
-	void WriteDataUsingIPC(TWsClCmdRegisterEffect* aForRegister, TWsClCmdOverrideEffect* aForOverride, 
-		const TFileName& aResourceDir, const TFileName& aFilenamePhase1, const TFileName& aFilenamePhase2, TFXEffect aCalledFrom);
+	void CheckFileNameAndSetSizes(const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming);
+	void RegisterTFXEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid=0, TBitFlags aFlags=0);
+	void OverrideTFXEffect(TFXEffect aCalledFrom, TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
+	void AppendFileNameData(const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming);
+	void WriteDataUsingIPC(TWsClCmdRegisterEffect* aForRegister, TWsClCmdOverrideEffect* aForOverride, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TFXEffect aCalledFrom);
 	TBool CheckCombinedSizeWithCurrentBuffer(TInt aSize) const;
 	
 private:
--- a/windowing/windowserver/nga/SERVER/advancedpointereventhelper.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/SERVER/advancedpointereventhelper.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -16,7 +16,7 @@
 //
 
 #include "advancedpointereventhelper.h"
-#include "advancedpointerevent.inl"
+
 
 void TAdvancedPointerEventHelper::InitAdvancedPointerEvent(TWsEvent& aEvent, TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, TUint8 aPointerNumber)
 	{
--- a/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP	Tue May 04 16:06:01 2010 +0100
@@ -51,7 +51,6 @@
 CWsClient* CWsClient::iCurrentClient;
 CWsObject* CWsClient::iDestObj;
 const TUint8* CWsClient::iNextCmd;
-CIdle* CWsClient::iMoreCommands=NULL;
 
 TUint CWsClient::iConnectionId = CDebugLogBase::EDummyConnectionId+1;
 CArrayFixFlat<CWsClient::TWsCursorArrayItem>* CWsClient::iSystemPointerCursors = NULL;
@@ -569,8 +568,6 @@
 
 	if (iInternalFlags&(EFinishedProcessingCommands|EPanicClientAsSoonAsPossible))
 		CompleteMessage(iClientMessage,iReply);	// (finish)
-	else
-		iMoreCommands->Start(TCallBack(CWsClient::DoContinueDeferredServiceOfCommandBuf,this));	// (call #3.1.1)
 	
 	iCurrentClient=NULL;
 #if defined(_DEBUG)
@@ -578,13 +575,6 @@
 #endif
 	}
 
-TInt CWsClient::DoContinueDeferredServiceOfCommandBuf(TAny* aClient)	// (step #3.1.1)
-	{
-	static_cast<CWsClient*>(aClient)->DoServiceCommandBuf();	// (call #3.1)
-	return KErrNone;
-	}
-
-
 void CWsClient::ExecuteAsyncClientCommandL(TInt aOpcode, const RMessage2& aMessage)	// (step #3.2)
 	{
 	switch(aOpcode)
@@ -1992,7 +1982,6 @@
 
 void CWsClient::InitStaticsL()
 	{
-	iMoreCommands=CIdle::NewL(EClientBufferPriority);
 	}
 
 void CWsClient::DeleteStatics()
@@ -2007,8 +1996,6 @@
 		iTextCursorArray = NULL;
 		}
 
-	delete iMoreCommands;
-	iMoreCommands=NULL;
 	// coverity[extend_simple_error] 
 	}
 		
--- a/windowing/windowserver/nga/SERVER/openwfc/CLIENT.H	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/SERVER/openwfc/CLIENT.H	Tue May 04 16:06:01 2010 +0100
@@ -186,7 +186,6 @@
 	// Service client commands by dispatching them to the object associated with the op code
 	void DoServiceL(const RMessage2& aMessage, TBool& aCompleteRequest);
 	void DoServiceCommandBuf();
-	static TInt DoContinueDeferredServiceOfCommandBuf(TAny* aClient);
 	void DispatchCommandsInBufL();
 	void CompleteMessage(const RMessage2& aMessage,TInt aReason);
 	
@@ -302,7 +301,6 @@
 	static TBuf8<EClientBufferMaxSize> iCmdBuf; // Buffer contain a block of client commands
 	static CWsObject* iDestObj;			// Current object client command is for
 	static const TUint8* iNextCmd;		// Pointer in buffer to the next command to be processed
-	static CIdle* iMoreCommands;		// Active object responsible for executing more client commands
 
 	static TInt iDefaultSystemPointerCursorIndex;		// Negative when there isn't one
 	static CWsPointerCursor* iDefaultSystemPointerCursor;
--- a/windowing/windowserver/nga/SERVER/openwfc/server.h	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nga/SERVER/openwfc/server.h	Tue May 04 16:06:01 2010 +0100
@@ -51,7 +51,6 @@
 	EHeartBeatPriority=1000,
 	EKeyRepeatPriority=1980,
 	EPointerRepeatPriority=1980,// Same as for key repeats
-	EClientBufferPriority=1990,	// Priority of idle object that completes the client buffer
 	EEventPriority=2000,
 	EComposeCompletePriority=2500,		// Triggers further composition if necessary
 	EWsShellLogonPriority=3000,	// Log on to the shell dying
--- a/windowing/windowserver/nonnga/CLIENT/RWINDOW.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nonnga/CLIENT/RWINDOW.CPP	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-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"
@@ -1698,7 +1698,7 @@
 
 /** Dummy implementation in order to preserve compatibility with WSERV NGA.
     @internalComponent */
-EXPORT_C void RWindowBase::OverrideEffects(TBool /*aOneShot*/, TInt /*aAction*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenamePhase1*/, const TFileName& /*aFilenamePhase2*/)
+EXPORT_C void RWindowBase::OverrideEffects(TInt /*aAction*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenameOutgoing*/, const TFileName& /*aFilenameIncoming*/, TBitFlags /*aFlags*/)
     {
 	ASSERT(0);
     }
--- a/windowing/windowserver/nonnga/CLIENT/RWS.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/nonnga/CLIENT/RWS.CPP	Tue May 04 16:06:01 2010 +0100
@@ -2395,14 +2395,14 @@
 	ASSERT(0);
 	}
 
-EXPORT_C void RWsSession::RegisterEffect(TInt /*aAction*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenamePhase1*/, const TFileName& /*aFilenamePhase2*/, TUint /*aAppUid*/)
+EXPORT_C void RWsSession::RegisterEffect(TInt /*aAction*/, TInt /*aPurpose*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenameOutgoing*/, const TFileName& /*aFilenameIncoming*/, TUint /*aAppUid*/, TBitFlags /*aFlags*/)
 /** Dummy implementation in order to preserve compatibility with WSERV NGA.
 	@internalComponent */
 	{
 	ASSERT(0);
 	}
 
-EXPORT_C void RWsSession::UnregisterEffect(TInt /*aAction*/)
+EXPORT_C void RWsSession::UnregisterEffect(TInt /*aAction*/, TInt /*aPurpose*/, TUint /*aAppUid*/)
 /** Dummy implementation in order to preserve compatibility with WSERV NGA.
 	@internalComponent */
 	{
@@ -2416,7 +2416,7 @@
 	ASSERT(0);
 	}
 
-EXPORT_C void RWsSession::OverrideEffects(TBool /*aOneShot*/, TInt /*aAction*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenamePhase1*/, const TFileName& /*aFilenamePhase2*/)
+EXPORT_C void RWsSession::OverrideEffects(TInt /*aAction*/, TInt /*aPurpose*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenameOutgoing*/, const TFileName& /*aFilenameIncoming*/, TBitFlags /*aFlags*/)
 	/** Dummy implementation in order to preserve compatibility with WSERV NGA.
 	@internalComponent */
 	{
--- a/windowing/windowserver/tauto/TDirectA.CPP	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/tauto/TDirectA.CPP	Tue May 04 16:06:01 2010 +0100
@@ -274,7 +274,21 @@
 	 		}
 		}
 	TheClient->Flush();
-	iTimer=CPeriodic::NewL(0);
+	if (iId == 4)
+	    {
+        // This clause is needed to prevent sub-test 9 from taking an 
+        // exceedingly large amount of time. The CColorAnimation with iId 4 is 
+        // the one which controls when the test stops. This raise in 
+        // priority compared to the other CColorAnimations, allows it's 
+        // callbacks to get through when otherwise they would take much longer
+        // due to the volume of callbacks generated by the other
+        // CColorAnimations
+        iTimer=CPeriodic::NewL(1);
+	    }
+	else
+	    {
+        iTimer=CPeriodic::NewL(0);
+	    }
 	}
 
 TPoint CColorAnimation::AbsoluteWindowPosition(TInt aWindowId/*=0*/)
--- a/windowing/windowserver/tauto/tmultiptrevent.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/tauto/tmultiptrevent.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -133,22 +133,15 @@
 		goto End;
 		}
 	// This code is for running successive anim test code 
-	if (wsEvent.Type()==EEventPointer && wsEvent.Pointer()->iType == TPointerEvent::ESwitchOn)
-		{
+	if (wsEvent.Type()==EEventPointer && wsEvent.Pointer()->iType==TPointerEvent::ESwitchOn)
 		goto End;
-		}
-	
 	// if this is called accidentally
-	TInt count=iEventBuffer.Count();
-	if (count==0 && wsType==EEventFocusGained)
-		{
+	if (iEventBuffer.Count()==0 && wsType==EEventFocusGained)
 		goto End;
-		}
 
 	iEventBuffer.Remove(&expectedEvent);
+	iEventCount++;
 
-	iEventCount++;
-	
 	if (wsEvent.Type() == EEventPointerBufferReady)
 		{
 		GetMoveBufferAndCompareL();
@@ -158,14 +151,15 @@
 		logText.Format(KEventHandle, wsEvent.Handle(), expectedEvent.Handle());
 		iTest->LOG_MESSAGE(logText);
 #endif
-#if defined(TESTMULTIPOINTER)		
+#if defined(TESTMULTIPOINTER)
 		TESTXL(wsEvent.Handle(), ==, expectedEvent.Handle(), &wsEvent, &expectedEvent);
 #endif
 		goto End;
 		}
-	
+
 	// Test wsEvent and expected event have same handle, position and type.
-#if defined(FAILLOG)	
+#if defined(FAILLOG)
+	{
 	TLogMessageText logText;
 	_LIT(KEventCountCheck, "Checking event number = %d");
 	logText.Format(KEventCountCheck, iEventCount);
@@ -173,8 +167,9 @@
 	_LIT(KEventType, "Actual Event type from Wserv = %d Expected Event Type = %d ");
 	logText.Format(KEventType, wsEvent.Type(), expectedEvent.Type());
 	iTest->LOG_MESSAGE(logText);
+	}
 #endif
-		
+
 #if defined(TESTMULTIPOINTER)
 	TESTXL(wsEvent.Type(), ==, expectedEvent.Type(), &wsEvent, &expectedEvent);
 #endif
@@ -182,29 +177,30 @@
 	if (wsType == EEventPointerEnter || wsType == EEventPointerExit)
 		{
 #if defined(FAILLOG)
+		TLogMessageText logText;
 		_LIT(KPointerNumber, "Actual PointerNumber for Enter/Exit event from Wserv = %d Expected PointerNumber for Enter/Exit event = %d ");
 		logText.Format(KPointerNumber, *wsEvent.Int(), *expectedEvent.Int());
 		iTest->LOG_MESSAGE(logText);
 #endif
-#if defined(TESTMULTIPOINTER)		
+#if defined(TESTMULTIPOINTER)
 		TESTXL(*wsEvent.Int(), ==, *expectedEvent.Int(), &wsEvent, &expectedEvent);
 #endif
 		}
-		
-    TAdvancedPointerEvent *expectedPointerEvent = expectedEvent.Pointer();
-    TAdvancedPointerEvent *actualPointerEvent = wsEvent.Pointer();
 
-    // Test only if it is a Pointer event  
-	if (wsType == EEventPointer)
+	// Test only if it is a Pointer event
+	if (wsType==EEventPointer)
 		{
+		TAdvancedPointerEvent* expectedPointerEvent=expectedEvent.Pointer();
+		TAdvancedPointerEvent* actualPointerEvent=wsEvent.Pointer();
 #if defined(FAILLOG)
+		TLogMessageText logText;
 		_LIT(KEventHandle, "Actual Window Handle from Wserv = %d Expected Window Handle = %d ");
 		logText.Format(KEventHandle, wsEvent.Handle(), expectedEvent.Handle());
 		iTest->LOG_MESSAGE(logText);
 #endif
-#if defined(TESTMULTIPOINTER)		
+#if defined(TESTMULTIPOINTER)
 		TESTXL(wsEvent.Handle(), ==, expectedEvent.Handle(), &wsEvent, &expectedEvent);
-#endif		
+#endif
 #if defined(FAILLOG)
 		_LIT(KPointerType, "Actual PointerType from Wserv = %d Expected PointerType = %d ");
 		logText.Format(KPointerType, actualPointerEvent->iType, expectedPointerEvent->iType);
--- a/windowing/windowserver/tdynamicres/src/t_wsdynamicreswinbase.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/tdynamicres/src/t_wsdynamicreswinbase.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -828,25 +828,26 @@
 	if (aRect.iTl.iX<=0 || aRect.iTl.iY<=0)
 		return ETrue;	//can't perform the test against the outside of the screen
 	//quantise the expectation based on the current mode.
-	switch (iScreenDevice->DisplayMode())
-	{
+	TDisplayMode displayMode=iScreenDevice->DisplayMode();
+	switch (displayMode)
+		{
 	case EColor4K:
 		aInnerColor=aInnerColor.Color4K(aInnerColor.Color4K());
 		aOuterColor=aOuterColor.Color4K(aOuterColor.Color4K());
-	break;
+		break;
 	case EColor64K:
 		aInnerColor=aInnerColor.Color64K(aInnerColor.Color64K());
 		aOuterColor=aOuterColor.Color64K(aOuterColor.Color64K());
-	break;
+		break;
 	case EColor16M:
 	case EColor16MU:
 	case EColor16MA:
 	case EColor16MAP:
 		break;
 	default:
-		ASSERT_TRUE(!"Can't quantise color for this display mode!");
-	
-	}
+		ASSERT_EQUALS(EColor16MA,displayMode);		//Can't quantise color for this display mode!
+		}
+
 	RArray<CountColour> innerColors;
 	innerColors.AppendL(aInnerColor);
 	RArray<CountColour> outerColors;
--- a/windowing/windowserver/tdynamicres/src/wsdynamicresbasic.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/tdynamicres/src/wsdynamicresbasic.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -274,7 +274,7 @@
 	if (resolutionList1[goodRes].iPixelSize==TSize())
 		{
 		goodRes++;
-		ASSERT_TRUE(resolutions>goodRes && "First res was blank, and no more to choose!");
+		ASSERT_TRUE(resolutions>goodRes);		//First res was blank, and no more to choose!
 		}
 	config.SetResolution(resolutionList1[goodRes].iPixelSize);
 	error=interface->SetConfiguration(config);
--- a/windowing/windowserver/wins_switching/ws32_stubs.h	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserver/wins_switching/ws32_stubs.h	Tue May 04 16:06:01 2010 +0100
@@ -5234,7 +5234,7 @@
 __declspec(naked)
 void call_vector_580 ()
 	{
-	// ; void RWsSession::RegisterEffect(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int)
+	// ; void RWsSession::RegisterEffect(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, unsigned int, class TBitFlagsT<unsigned long>)
 	_asm mov eax, 580
 	_asm jmp common_dispatch
 	}
@@ -5243,7 +5243,7 @@
 __declspec(naked)
 void call_vector_581 ()
 	{
-	// ; void RWindowBase::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
+	// ; void RWindowBase::OverrideEffects(int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
 	_asm mov eax, 581
 	_asm jmp common_dispatch
 	}
@@ -5252,7 +5252,7 @@
 __declspec(naked)
 void call_vector_582 ()
 	{
-	// ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &)
+	// ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
 	_asm mov eax, 582
 	_asm jmp common_dispatch
 	}
@@ -5261,7 +5261,7 @@
 __declspec(naked)
 void call_vector_583 ()
 	{
-	// ; void RWsSession::UnregisterEffect(int)
+	// ; void RWsSession::UnregisterEffect(int, int, unsigned int)
 	_asm mov eax, 583
 	_asm jmp common_dispatch
 	}
--- a/windowing/windowserverplugins/group/graphics_wserv_std_plugins.mrp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserverplugins/group/graphics_wserv_std_plugins.mrp	Tue May 04 16:06:01 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# 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"
--- a/windowing/windowserverplugins/openwfc/group/graphics_wserv_std_plugins.mrp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserverplugins/openwfc/group/graphics_wserv_std_plugins.mrp	Tue May 04 16:06:01 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# 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"
--- a/windowing/windowserverplugins/openwfc/src/openwfcwrapper.cpp	Tue May 04 14:48:00 2010 +0100
+++ b/windowing/windowserverplugins/openwfc/src/openwfcwrapper.cpp	Tue May 04 16:06:01 2010 +0100
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-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"
@@ -340,10 +340,7 @@
 	    {	    
 	    CElementWrapper* element=static_cast<CElementWrapper*>(aElement);
 	    RemoveElementFromSceneList(element);
-	    if (!(element->UpdateFlags()&CElementWrapper::EUpdate_SceneCommited))
-	          {
-	             delete element;
-	          }
+	    delete element;
 	    }
 	}