graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp
branchEGL_MERGE
changeset 86 841b49c57c50
parent 33 25f95128741d
child 163 bbf46f59e123
--- a/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Wed May 19 14:34:22 2010 +0100
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Tue Jun 01 15:04:40 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
@@ -277,7 +276,7 @@
 */
 EXPORT_C TDisplayMode CFbsDrawDevice::DisplayMode16M()
 	{
-	return EColor16MAP;
+	return EColor16MA;
 	}
 
 
@@ -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(ScreenNumber(), 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);	    
+		}
 	}
 
 /**