webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp
changeset 65 5bfc169077b2
parent 38 6297cdf66332
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp	Tue Feb 02 00:56:45 2010 +0200
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp	Fri Mar 19 09:52:28 2010 +0200
@@ -34,7 +34,6 @@
 // -----------------------------------------------------------------------------
 TInt BitmapUtil::CopyBitmap( const CFbsBitmap& aSource, CFbsBitmap& aDestination )
     {
-    // TODO - how to check if source or destination is null reference
     TSize size( aSource.SizeInPixels() );
     TDisplayMode displayMode( aSource.DisplayMode() );
     TInt err( aDestination.Create( size, displayMode ) );
@@ -55,7 +54,6 @@
 TInt BitmapUtil::CopyBitmapData( const CFbsBitmap& aSource, CFbsBitmap& aDestination,
                                    const TSize& aSize, const TDisplayMode& aDisplayMode )
     {
-    // TODO - how to check if source or destination is null reference
     HBufC8* scanLine = HBufC8::New( aSource.ScanLineLength( aSize.iWidth, aDisplayMode ) );
     if( scanLine )
         {
@@ -217,7 +215,7 @@
             }
         }
 
-    if( !err && maskHandle && iMask)
+    if( !err && maskHandle )
         {
         if( aDuplicate )
             {
@@ -249,7 +247,7 @@
 void CMaskedBitmap::Reset()
     {
     iBitmap->Reset();
-    if(iMask) iMask->Reset();
+    iMask->Reset();
     }
 
 
@@ -274,7 +272,7 @@
 // -----------------------------------------------------------------------------
 TBool CMaskedBitmap::HasMask() const
     {
-    return (iMask && iMask->Handle()!=0 );
+    return ( iMask->Handle() != 0 );
     }
 
 // -----------------------------------------------------------------------------
@@ -297,7 +295,7 @@
         }
     if( iBitmap->Handle() )
         {
-        if( HasMask() )
+        if( iMask->Handle() )
             {
             aContext.BitBltMasked( aPoint, iBitmap, s, iMask, iInvertMask );
             }
@@ -319,7 +317,7 @@
         }
     if( iBitmap->Handle() )
         {
-        if( HasMask() )
+        if( iMask->Handle() )
             {
 
             aContext.BitBltMasked( aPoint, iBitmap, aSource, iMask, iInvertMask );
@@ -344,7 +342,7 @@
     if( iBitmap->Handle() )
         {
         // ### FIXME DrawBitmapMasked is too buggy to use 2.8/week52, so no transparency with scaling
-        if( HasMask() )
+        if( iMask->Handle() )
             {
             aContext.DrawBitmapMasked( aTarget, iBitmap, s, iMask, iInvertMask );
             }
@@ -367,7 +365,7 @@
     if( iBitmap->Handle() )
         {
         // ### FIXME DrawBitmapMasked is too buggy to use 2.8/week52, so no transparency with scaling
-        if( HasMask() )
+        if( iMask->Handle() )
             {
             aContext.DrawBitmapMasked( aTarget, iBitmap, aSource, iMask, iInvertMask );
             }
@@ -443,8 +441,10 @@
 void CMaskedBitmap::Resize(TSize aSize)
     {
     iBitmap->Resize(aSize);
-    if (HasMask())
+    if (iMask)
+        {
         iMask->Resize(aSize);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -589,8 +589,10 @@
 
 TBool CMaskedBitmap::IsFullyTransparent()
     {
-    if (!HasMask())
+    if (!iMask || !iMask->Handle())
+        {
         return EFalse;
+        }
 
     if( iMask->DisplayMode() != EGray2 )
         {
@@ -628,7 +630,7 @@
 		if ( iBitmap && iBitmap->Handle() ) 
 			iBitmap->CompressInBackground();
 		
-        if ( HasMask() )
+        if ( iMask && iMask->Handle() )
             iMask->CompressInBackground();
         
     }