|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Graphics Resource - kernel extension internal functionality |
|
15 // |
|
16 |
|
17 #ifndef SGEXTENSIONIMPL_H |
|
18 #define SGEXTENSIONIMPL_H |
|
19 |
|
20 #include <sgresource/sgextension.h> |
|
21 |
|
22 NONSHARABLE_CLASS(DSgExtensionImpl): public DBase |
|
23 { |
|
24 public: |
|
25 TInt Construct(); |
|
26 TInt CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, DSgResource*& aResource); |
|
27 TInt FindAndOpenResource(TUint64 aId, DSgResource*& aResource); |
|
28 void DeleteResource(DSgResource* aResource); |
|
29 TInt GlobalResourceCount() const; |
|
30 TInt GlobalGraphicsMemoryUsed() const; |
|
31 private: |
|
32 DMutex* iMutex; |
|
33 TUint64 iLastResourceId; |
|
34 RPointerArray<DSgResource> iResources; |
|
35 }; |
|
36 |
|
37 NONSHARABLE_CLASS(DSgResourceImpl): public DSgResource |
|
38 { |
|
39 public: |
|
40 DSgResourceImpl(DSgExtensionImpl& aExtensionImpl, TUint64 aId, TUint32 aAttribs, |
|
41 const TDesC8& aMetaData, DChunk* aDataChunk, TInt aDataSize); |
|
42 // From DSgResource |
|
43 TInt Open(); |
|
44 void Close(); |
|
45 TUint64 Id() const; |
|
46 TUint32 Attributes() const; |
|
47 TInt GetMetaData(TDes8& aMetaData) const; |
|
48 DChunk* DataChunk() const; |
|
49 TInt DataSize() const; |
|
50 private: |
|
51 ~DSgResourceImpl(); |
|
52 private: |
|
53 DSgExtensionImpl& iExtensionImpl; |
|
54 TInt iRefCount; |
|
55 TUint64 iId; |
|
56 TUint32 iAttributes; |
|
57 TInt iMetaDataSize; |
|
58 DChunk* iDataChunk; |
|
59 TInt iDataSize; |
|
60 }; |
|
61 |
|
62 #endif // SGEXTENSIONIMPL_H |