scrsaver/scrsaverplugins/ScreenSaverGifAnimPlugin/src/GifAnimationPluginControl.cpp
branchRCL_3
changeset 16 1f307dce3b5a
parent 11 4784a3bc2236
equal deleted inserted replaced
15:2e08ef6b6eda 16:1f307dce3b5a
    66                                              MPluginAdapter* aPluginAdapter )
    66                                              MPluginAdapter* aPluginAdapter )
    67     {
    67     {
    68     DBG_TRACE_FN_BEGIN;
    68     DBG_TRACE_FN_BEGIN;
    69 
    69 
    70     iPluginAdapter = aPluginAdapter;
    70     iPluginAdapter = aPluginAdapter;
       
    71     isViewerBitmapChangedL = EFalse;
    71     
    72     
    72     if ( aParentControl != NULL )
    73     if ( aParentControl != NULL )
    73         {
    74         {
    74         CreateWindowL( aParentControl );
    75         CreateWindowL( aParentControl );
    75         }
    76         }
   246     gc.SetBrushStyle( CGraphicsContext::ESolidBrush); 
   247     gc.SetBrushStyle( CGraphicsContext::ESolidBrush); 
   247     gc.DrawRect( rect );
   248     gc.DrawRect( rect );
   248         
   249         
   249     if ( iDrawingBitmap 
   250     if ( iDrawingBitmap 
   250       && iEngine 
   251       && iEngine 
   251       && iLastError == KErrNone ) // loading was successful
   252       && iLastError == KErrNone // loading was successful
       
   253       && isViewerBitmapChangedL ) // need to check whether first ViewerBitmapChangedL
       
   254                                   // has been called; 
   252         {
   255         {
   253         TSize screenSize( rect.Size() );
   256         TSize screenSize( rect.Size() );
   254         TPoint destinationPoint( 
   257         TPoint destinationPoint( 
   255                 ( screenSize.iWidth-iTargetNewSize.iWidth ) / 2, 
   258                 ( screenSize.iWidth-iTargetNewSize.iWidth ) / 2, 
   256                 ( screenSize.iHeight-iTargetNewSize.iHeight ) / 2 );
   259                 ( screenSize.iHeight-iTargetNewSize.iHeight ) / 2 );
   542                     graphicsMaskContext->DrawBitmap( iTargetSize, &iDrawingBitmap->Mask(), srcRect ); 
   545                     graphicsMaskContext->DrawBitmap( iTargetSize, &iDrawingBitmap->Mask(), srcRect ); 
   543                     CleanupStack::PopAndDestroy( 2 );//graphicsContext,bitmapDevice
   546                     CleanupStack::PopAndDestroy( 2 );//graphicsContext,bitmapDevice
   544                     }
   547                     }
   545                 }
   548                 }
   546             }
   549             }
   547             
   550         isViewerBitmapChangedL = ETrue;
   548         MakeVisible( ETrue );
   551         MakeVisible( ETrue );
   549         DrawNow();
   552         DrawNow();
   550         }
   553         }
   551     }
   554     }
   552 
   555