camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp
changeset 1 f5ec9446e5bf
parent 0 1ddebce53859
child 2 e8773a61782d
--- a/camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp	Thu Jan 07 16:18:56 2010 +0200
+++ b/camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp	Mon Jan 18 20:06:55 2010 +0200
@@ -236,20 +236,28 @@
       SetLocationIndicatorVisibility();
       }
 
-  TInt color;
-  TInt gray;
-  
-  TDisplayMode displaymode =
-      CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors( color, gray );
+  TBool dsaAlways = iController.IsDirectScreenVFSupported( ETrue ) && 
+                    iController.IsDirectScreenVFSupported( EFalse );
+                 
+  if ( !dsaAlways )
+      {
+      // If bitmap VF is not possible in this configuration, 
+      // offscreen bitmap is not needed
+      TInt color;
+      TInt gray;
   
-  // set up the offscreen bitmap
-  iOffScreenBitmap = new ( ELeave ) CFbsBitmap();
+      TDisplayMode displaymode =
+          CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors( color, gray );
+  
+      // set up the offscreen bitmap
+      iOffScreenBitmap = new ( ELeave ) CFbsBitmap();  
   
-  User::LeaveIfError( iOffScreenBitmap->Create( Rect().Size(), EColor16MU/*displaymode*/ ) );
+      User::LeaveIfError( iOffScreenBitmap->Create( Rect().Size(), EColor16MU/*displaymode*/ ) );
   
-  PRINT1( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL disp mode (%d)"), displaymode )
-  iBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap );
-  User::LeaveIfError( iBitmapDevice->CreateContext( iBitmapGc ) );
+      PRINT1( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL disp mode (%d)"), displaymode )
+      iBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap );
+      User::LeaveIfError( iBitmapDevice->CreateContext( iBitmapGc ) );
+      }
 
   iRect = ViewFinderFrameRect();
   // if using direct viewfinding pass Rect to control
@@ -435,8 +443,8 @@
         }
 
     CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
-
-    if ( appUi && appUi->CheckCourtesyKeyEventL( aKeyEvent, aType, ETrue ) == EKeyWasConsumed )
+	__ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer) );
+    if ( appUi->CheckCourtesyKeyEventL( aKeyEvent, aType, ETrue ) == EKeyWasConsumed )
         {
         PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL courtesy key") );
         return EKeyWasConsumed;
@@ -480,7 +488,7 @@
             && 0         == aKeyEvent.iRepeats )
         {
         TBool MSKCapture(EFalse);
-        if ( appUi && !appUi->IsToolBarVisible() && aKeyEvent.iScanCode == EStdKeyDevice3 )
+        if ( !appUi->IsToolBarVisible() && aKeyEvent.iScanCode == EStdKeyDevice3 )
             {
             MSKCapture = ETrue;
             }