os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgextensionimpl.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgextensionimpl.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,62 @@
1.4 +// Copyright (c) 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 +// Graphics Resource - kernel extension internal functionality
1.18 +//
1.19 +
1.20 +#ifndef SGEXTENSIONIMPL_H
1.21 +#define SGEXTENSIONIMPL_H
1.22 +
1.23 +#include <sgresource/sgextension.h>
1.24 +
1.25 +NONSHARABLE_CLASS(DSgExtensionImpl): public DBase
1.26 + {
1.27 +public:
1.28 + TInt Construct();
1.29 + TInt CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, DSgResource*& aResource);
1.30 + TInt FindAndOpenResource(TUint64 aId, DSgResource*& aResource);
1.31 + void DeleteResource(DSgResource* aResource);
1.32 + TInt GlobalResourceCount() const;
1.33 + TInt GlobalGraphicsMemoryUsed() const;
1.34 +private:
1.35 + DMutex* iMutex;
1.36 + TUint64 iLastResourceId;
1.37 + RPointerArray<DSgResource> iResources;
1.38 + };
1.39 +
1.40 +NONSHARABLE_CLASS(DSgResourceImpl): public DSgResource
1.41 + {
1.42 +public:
1.43 + DSgResourceImpl(DSgExtensionImpl& aExtensionImpl, TUint64 aId, TUint32 aAttribs,
1.44 + const TDesC8& aMetaData, DChunk* aDataChunk, TInt aDataSize);
1.45 + // From DSgResource
1.46 + TInt Open();
1.47 + void Close();
1.48 + TUint64 Id() const;
1.49 + TUint32 Attributes() const;
1.50 + TInt GetMetaData(TDes8& aMetaData) const;
1.51 + DChunk* DataChunk() const;
1.52 + TInt DataSize() const;
1.53 +private:
1.54 + ~DSgResourceImpl();
1.55 +private:
1.56 + DSgExtensionImpl& iExtensionImpl;
1.57 + TInt iRefCount;
1.58 + TUint64 iId;
1.59 + TUint32 iAttributes;
1.60 + TInt iMetaDataSize;
1.61 + DChunk* iDataChunk;
1.62 + TInt iDataSize;
1.63 + };
1.64 +
1.65 +#endif // SGEXTENSIONIMPL_H