Revision: 201023 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 17:08:43 +0300
branchRCL_3
changeset 109 7f6e7753e018
parent 97 0e9202c0340c
child 112 5981337c8beb
child 149 e375a7921169
Revision: 201023 Kit: 2010125
graphicsdeviceinterface/screendriver/group/TScdvServer.mmp
graphicsdeviceinterface/screendriver/tsrc/TDirectScreenBitmap.cpp
graphicsdeviceinterface/screendriver/tsrc/scripts/scdvtest_t_DirectScreenBitmap.script
--- a/graphicsdeviceinterface/screendriver/group/TScdvServer.mmp	Wed Jun 09 11:06:44 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/group/TScdvServer.mmp	Mon Jun 21 17:08:43 2010 +0300
@@ -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"
@@ -61,6 +61,7 @@
 library     lookuptable.lib
 library		fbscli.lib
 library		ws32.lib
+library		bitgdi.lib
  
 LIBRARY	    	testexecuteutils.lib tgraphicsharness.lib
 LIBRARY	    	testexecutelogclient.lib
--- a/graphicsdeviceinterface/screendriver/tsrc/TDirectScreenBitmap.cpp	Wed Jun 09 11:06:44 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/tsrc/TDirectScreenBitmap.cpp	Mon Jun 21 17:08:43 2010 +0300
@@ -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"
@@ -126,6 +126,7 @@
     	{
         TRequestStatus requestStatus;
         iDSBitmap->EndUpdate(requestStatus);	
+        User::WaitForRequest(requestStatus);
     	}
     return ret;
 	}
@@ -138,6 +139,7 @@
     	{
         TRequestStatus requestStatus;
         iDSBitmap->EndUpdate(iRect,requestStatus);	
+        User::WaitForRequest(requestStatus);
     	}
     return ret;
 	}
@@ -286,7 +288,7 @@
 
 //A largely visual test to demonstrate regional refreshing of DirectScreenBitmaps and the correct display function
 //of the Emulator.
-class CTDirectScreenBitmap : public CTGraphicsBase
+class CTDirectScreenBitmap : public CTGraphicsBase, public MDirectScreenAccess
 	{
 	public:	
 		~CTDirectScreenBitmap();
@@ -300,6 +302,9 @@
  		void LogColourEvent(TInt aPreMulDestPixColor,TInt aNonPreMulDestPixColor,TInt aPreMulSrcPixelColor,TInt aNonPreMulSrcPixelColor,TReal aVal1,TReal aVal2,TReal aVal3,TRefByValue<const TDesC> aMsg,TBool aErr);
  		void TestContinuousRefreshingL();
  		void TestRefreshingTimeL();
+ 	
+ 	    void Restart(RDirectScreenAccess::TTerminationReasons aReason);
+ 	    void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
 	private:
 	    void TestRefreshingWindowsPerDisplayModeL(TDisplayMode aDisplayMode);
 		void TestContinuousRefreshingPerDisplayModeL(const TDisplayMode& aDisplayMode);
@@ -330,6 +335,12 @@
 	    TReal iMeasure ;
 	    TUint32 iTimeBefore;
 	    TUint32 iTimeAfter;
+	    RWsSession iSession;
+	    CWsScreenDevice* iScreenDevice;
+	    RWindow* iWin;
+	    RWindowGroup* iWinGroup;
+	    CDirectScreenAccess* iDSA;
+	    TInt iWindowHandle;
 
 	};
 
@@ -352,7 +363,7 @@
 	}; 
 
 CTDirectScreenBitmap::CTDirectScreenBitmap(CTestStep* aStep) :
-	CTGraphicsBase(aStep),iMeasure(0)
+	CTGraphicsBase(aStep),iMeasure(0), iSession()
 	{
 	}
 	
@@ -360,6 +371,18 @@
 	{
 	Close();
 	}
+
+void CTDirectScreenBitmap::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
+    {
+    iDSA->StartL();
+    CFbsBitGc* gc = iDSA->Gc();
+    RRegion* region = iDSA->DrawingRegion();
+    gc->SetClippingRegion(region);
+    }
+
+void CTDirectScreenBitmap::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
+    {
+    }
 	
 //Construct the DirectScreenBitmap and sub-rects for test of the refresh.	
 //Constructs a DirectScreenBitmap for EDoubleBuffer and EIncrementalUpdate
@@ -377,6 +400,27 @@
 		{
 		iDirectScreenBitmap = CDirectScreenBitmap::NewL();
 		}
+	iSession.Connect();
+	iScreenDevice = new (ELeave) CWsScreenDevice(iSession);
+	iScreenDevice->Construct();
+	
+	iWinGroup = new (ELeave) RWindowGroup(iSession);
+	iWinGroup->Construct(++iWindowHandle, iScreenDevice);
+	iWin = new (ELeave) RWindow(iSession);
+	iWin->Construct(*iWinGroup, ++iWindowHandle);
+	iWin->SetExtent(TPoint(0,0), aScreenRect.Size());
+	iWin->SetPosition(aScreenRect.iTl);
+	iWin->Activate();
+	iWin->BeginRedraw();
+	iWin->EndRedraw();
+	iDSA = CDirectScreenAccess::NewL(iSession, *iScreenDevice, *iWin, *this);
+	iSession.Flush();
+	iDSA->StartL();
+	
+	CFbsBitGc* gc = iDSA->Gc();
+	RRegion* region = iDSA->DrawingRegion();
+	gc->SetClippingRegion(region);
+	
 	iSettings = aSettings;
 	TInt create=iDirectScreenBitmap->Create(aScreenRect, aSettings);
 	if (create==KErrNone)
@@ -412,6 +456,19 @@
 	iInterface = NULL;
 	delete iRendering;
 	iRendering = NULL;
+	if (iDSA)
+	    {
+        iDSA->Cancel();
+        delete iDSA;
+        iDSA = NULL;
+	    }
+    delete iWin;
+    iWin = NULL;
+    delete iScreenDevice;
+    iScreenDevice = NULL;
+    delete iWinGroup;
+    iWinGroup = NULL;
+    iSession.Close();
 	}
 
 
@@ -438,26 +495,26 @@
 		if (!(iSettings & CDirectScreenBitmap::EIncrementalUpdate))
 			{		
 			iInterface->EndDraw(iRequestStatus);	
-			User::After(WAIT_TIME);
+			User::WaitForRequest(iRequestStatus);
 			}
 		else
 			{		
-			iInterface->EndDraw(iTopLeft, iRequestStatus);	
-			User::After(WAIT_TIME);
+			iInterface->EndDraw(iTopLeft, iRequestStatus);
+            User::WaitForRequest(iRequestStatus);
 			iInterface->BeginDraw();
 			iInterface->EndDraw(iTopRight, iRequestStatus);	
-			User::After(WAIT_TIME);
+            User::WaitForRequest(iRequestStatus);
 			iInterface->BeginDraw();
-			iInterface->EndDraw(iBotLeft, iRequestStatus);	
-			User::After(WAIT_TIME);
+			iInterface->EndDraw(iBotLeft, iRequestStatus);
+            User::WaitForRequest(iRequestStatus);
 			iInterface->BeginDraw();
-			iInterface->EndDraw(iBotRight, iRequestStatus);	
-			User::After(WAIT_TIME);
+			iInterface->EndDraw(iBotRight, iRequestStatus);
+            User::WaitForRequest(iRequestStatus);
 			
 			iInterface->DrawColor(iMiddle,KRgbCyan);
 			iInterface->BeginDraw();
 			iInterface->EndDraw(iMiddle, iRequestStatus);
-			User::After(WAIT_TIME);
+            User::WaitForRequest(iRequestStatus);
 
 			}
 		__ASSERT_DEBUG(iInterface->ScreenClear(), User::Invariant());
--- a/graphicsdeviceinterface/screendriver/tsrc/scripts/scdvtest_t_DirectScreenBitmap.script	Wed Jun 09 11:06:44 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/tsrc/scripts/scdvtest_t_DirectScreenBitmap.script	Mon Jun 21 17:08:43 2010 +0300
@@ -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"
@@ -16,4 +16,4 @@
 PRINT Run TScdv Screen Driver test
 //
 LOAD_SUITE TScdvServer
-RUN_TEST_STEP 540 TScdvServer TDirectScreenBitmap
+RUN_TEST_STEP !Heap=0x400000 720 TScdvServer TDirectScreenBitmap