1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/fbs/fontandbitmapserver/sfbs/BackGroundCompression.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,69 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "SERVER.H"
1.20 +
1.21 +
1.22 +NONSHARABLE_CLASS(CFbsBackgroundCompressionQueueElement): public CBase
1.23 +/**
1.24 +@internalComponent
1.25 +*/
1.26 + {
1.27 + friend class CFbsBackgroundCompression;
1.28 +private:
1.29 + CFbsBackgroundCompressionQueueElement(CBitmapObject* aSrcObj, TBitmapfileCompressionScheme aScheme);
1.30 + ~CFbsBackgroundCompressionQueueElement();
1.31 + void CompleteOutstandingRequestAndDestroy(TInt aReason);
1.32 + void CompleteOutstandingRequest(const CSession2* aSession);
1.33 +
1.34 +private:
1.35 + TDblQueLink iLink;
1.36 + CBitmapObject* iSourceObject;
1.37 + TBitmapfileCompressionScheme iCompressionScheme;
1.38 + RMessage2 iMessage;
1.39 + };
1.40 +
1.41 +NONSHARABLE_CLASS(CFbsBackgroundCompression): public CActive
1.42 +/**
1.43 +@internalComponent
1.44 +*/
1.45 + {
1.46 +public:
1.47 + static CFbsBackgroundCompression* NewL(CFbTop& aFbTop);
1.48 + ~CFbsBackgroundCompression();
1.49 + TInt AddToCompressionQueue(CBitmapObject* aSrcObj, TBitmapfileCompressionScheme aScheme, const RMessage2* aMessage);
1.50 + void RemoveFromCompressionQueue(CBitmapObject* aSrcObj);
1.51 + void CompleteOutstandingRequests(const CSession2* aSession);
1.52 + void CompressAll();
1.53 +
1.54 +private:
1.55 + CFbsBackgroundCompression(CFbTop& aFbTop);
1.56 + void ConstructL();
1.57 + TInt PrepareCompression();
1.58 + void FinalizeCompression(const TRequestStatus& aStatus);
1.59 + void RunL();
1.60 + void DoCancel();
1.61 + static TInt ThreadFunction(CFbsBackgroundCompression* aSelf);
1.62 +
1.63 +private:
1.64 + CFbTop& iFbTop;
1.65 + RThread iThread;
1.66 + TBool iThreadCreated;
1.67 + RSemaphore iThreadGo;
1.68 + RMutex iThreadMutex;
1.69 + TDblQue<CFbsBackgroundCompressionQueueElement> iCompressionQueue;
1.70 + CBitmapObject* volatile iBitmapObject;
1.71 + volatile TBitmapfileCompressionScheme iCompressionScheme;
1.72 + };