windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp
changeset 187 9f66f99ee56f
parent 0 5d03bc08d59c
--- a/windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp	Fri Sep 24 16:14:28 2010 +0300
@@ -18,6 +18,7 @@
 #include "panic.h"
 #include <graphics/wsdisplaycontrol.h>
 #include "displaypolicy.h"
+#include <graphics/sgutils.h>
 #include "utils.h"
 
 #if defined(__WINS__) && defined(_DEBUG)
@@ -154,7 +155,18 @@
 	if (iniFile->FindVar(iNextScreenDevice->ScreenNumber(), KFlickerBufferMode, flickerBufferModeName))
 		displayMode = ParseDisplayMode(flickerBufferModeName);
 	if (displayMode == ENone)
-		displayMode = iNextScreenDevice->DisplayMode();
+		{
+		// Display render stage MWsScreenDevice::DisplayMode now reports the supported screendriver display mode in 32bpp. 
+		// It is necessary in order to maintain BC with 3rd party apps and DSA framework.
+		// The reported display mode may be different from the actual UI surface pixel format, so flicker buffer
+	    // must not rely on DisplayMode() to determine pixel format for its rendering target.
+		//
+		MWsUiBuffer* uiBuf = aNextStage->ObjectInterface<MWsUiBuffer>();
+		if (uiBuf)
+			{
+			displayMode = SgUtils::PixelFormatToDisplayMode(uiBuf->PixelFormat());
+			}
+		}
 	STD_ASSERT_DEBUG(displayMode!=ENone, EPluginPanicNoDisplayModeFound);
 	
 	const TUint32 usage = ESgUsageDirectGdiTarget | ESgUsageWindowGcSource;