imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp
branchRCL_3
changeset 8 7403edfcf0fb
parent 7 2eb74cf6572e
child 9 dea39715fc05
--- a/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Fri Mar 12 15:43:57 2010 +0200
+++ b/imagehandlingutilities/thumbnailmanager/thumbnailserver/src/thumbnailscaletask.cpp	Mon Mar 15 12:41:55 2010 +0200
@@ -42,14 +42,14 @@
     aBitmap, const TSize& aOriginalSize, const TSize& aTargetSize, TBool aCrop,
     TDisplayMode aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
     const TThumbnailSize aThumbnailSize, const TInt64 aModified,
-    TBool aBitmapToPool, const TBool aEXIF)
+    TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId)
     {
     // We take ownership of aBitmap
     CleanupStack::PushL( aBitmap );
     CThumbnailScaleTask* self = new( ELeave )CThumbnailScaleTask( aProcessor,
         aServer, aFilename, aBitmap, aOriginalSize, aTargetSize, aCrop,
         aDisplayMode, aPriority, aTargetUri, aThumbnailSize, aModified,
-        aBitmapToPool, aEXIF);
+        aBitmapToPool, aEXIF, aRequestId);
     CleanupStack::Pop( aBitmap );
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -68,7 +68,7 @@
     const TSize& aOriginalSize, const TSize& aTargetSize, TBool aCrop,
     TDisplayMode aDisplayMode, TInt aPriority, const TDesC& aTargetUri,
     const TThumbnailSize aThumbnailSize, const TInt64 aModified,
-    TBool aBitmapToPool, const TBool aEXIF):
+    TBool aBitmapToPool, const TBool aEXIF, const TThumbnailServerRequestId aRequestId):
     CThumbnailTask( aProcessor, aPriority ), iServer( aServer ), iOwnBitmap( aBitmap ),
     iOriginalSize( aOriginalSize ), iTargetSize(aTargetSize), iTargetSizeTN( aTargetSize ), iCrop( aCrop ),
     iDisplayMode( aDisplayMode ), iFilename( aFilename ), iTargetUri( aTargetUri ),
@@ -76,6 +76,8 @@
     iBitmapToPool(aBitmapToPool), iEXIF(aEXIF)
     {
     TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::CThumbnailScaleTask()", this );
+    
+    iRequestId = aRequestId;
     }
 
 
@@ -150,6 +152,8 @@
         CalculateCropRectangle();
         }
     
+    TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - sizes calculated", this );
+    
 #ifdef _DEBUG
     aStart.UniversalTime();
 #endif
@@ -162,6 +166,8 @@
     
     if(bitmapSize.iHeight == iTargetSize.iHeight && bitmapSize.iWidth == iTargetSize.iWidth)
         {
+        TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - no need for scaling", this);
+    
         // copy bitmap 1:1
         User::LeaveIfError( iScaledBitmap->Create( bitmapSize, iBitmap->DisplayMode() ));
         CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iScaledBitmap);
@@ -172,7 +178,6 @@
         gc->BitBlt(TPoint(0, 0), iBitmap);
         CleanupStack::PopAndDestroy(2, device); // gc
         
-        TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - no need for scaling", this);
         TRAPD( err, StoreAndCompleteL());
         Complete( err );
         ResetMessageData();
@@ -180,11 +185,13 @@
     else
         {
         TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() - scaling", this);
+        
         User::LeaveIfError( iScaledBitmap->Create( iTargetSize, iBitmap->DisplayMode() ));
         iServer.ScaleBitmapL( iStatus, * iBitmap, * iScaledBitmap, iCropRectangle );
         SetActive();
-        }
-   
+        }  
+    
+    TN_DEBUG2( "CThumbnailScaleTask(0x%08x)::StartL() end", this );
     }