webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp
changeset 11 c8a366e56285
parent 5 10e98eab6f85
child 27 6297cdf66332
--- a/webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp	Thu Aug 27 07:44:59 2009 +0300
+++ b/webengine/osswebengine/WebCore/platform/symbian/bitmap/MaskedBitmap.cpp	Thu Sep 24 12:53:48 2009 +0300
@@ -23,8 +23,6 @@
 #include <bitstd.h>
 #include <bitdev.h>
 
-// CONSTANTS
-static const TInt KCompressRatioThreshold = 16;
 
 // ======================== STATIC FACTORY FUNCTIONS ===========================
 #define GET_PIX_GRAY2(buf, x, y, w)     (((TUint32*)((TUint8*)buf + y*w))[x>>5] & (1<<(x&0x1f)))
@@ -626,16 +624,15 @@
     return ETrue;
     }
 
-void CMaskedBitmap::CompressIfNeeded( TInt aRawSize )
+void CMaskedBitmap::CompressInBackground( )
     {
-    // check if the image is highly compressed
-    TSize sz = iBitmap->SizeInPixels();
-    if( KCompressRatioThreshold * aRawSize < sz.iWidth * sz.iHeight )
-        {
-        iBitmap->Compress();
-        if( HasMask() )
-            iMask->Compress();
-        }
+    
+		if ( iBitmap && iBitmap->Handle() ) 
+			iBitmap->CompressInBackground();
+		
+        if ( iMask && iMask->Handle() )
+            iMask->CompressInBackground();
+        
     }
 
 CMaskedBitmap* CMaskedBitmap::ScaleImageToSize( TSize newSize )