os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgdeviceimpl.h
First public contribution.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Graphics Resource - logical device driver internal functionality
17 #ifndef SGDEVICEIMPL_H
18 #define SGDEVICEIMPL_H
20 #include <kernel/kernel.h>
21 #include <sgresource/sgdevice.h>
23 enum TSgDevicePanicReason
25 ESgPanicMetaDataSizeTooBig = 1,
26 ESgPanicDataSizeNegative = 2
29 void Panic(TSgDevicePanicReason aReason);
31 class DSgDevice: public DLogicalDevice
34 // From DLogicalDevice
36 void GetCaps(TDes8& aDes) const;
37 TInt Create(DLogicalChannelBase*& aChannel);
42 class DSgChannel: public DLogicalChannelBase
46 // From DLogicalChannelBase
47 TInt DoCreate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVersion);
48 TInt Request(TInt aFunction, TAny* a1, TAny* a2);
50 TInt CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, TUint64& aId);
51 TInt OpenResource(TUint64 aId);
52 TInt CloseResource(TUint64 aId);
53 TUint32 ResourceAttributes(TUint64 aId) const;
54 TInt GetResourceMetaData(TUint64 aId, TDes8& aMetaData) const;
55 TAny* ResourceDataAddress(TUint64 aId) const;
56 TInt ResourceDataSize(TUint64 aId) const;
57 TInt GlobalResourceCount() const;
58 TInt LocalGraphicsMemoryUsed() const;
59 TInt GlobalGraphicsMemoryUsed() const;
61 class TResourceListItem
64 TResourceListItem(DSgResource* aResource, TInt aChunkHandle);
66 DSgResource* iResource;
70 static TInt Compare(const TUint64* aId, const TResourceListItem& aResourceListItem);
71 static TInt Compare(const TResourceListItem& aResourceListItem1, const TResourceListItem& aResourceListItem2);
74 RArray<TResourceListItem> iResources;
77 #endif // SGDEVICEIMPL_H