class SgDriver |
Set of static functions in the Graphics Resource API.
Public Member Functions | |
---|---|
IMPORT_C void | AllocMarkEnd ( TInt ) |
IMPORT_C void | AllocMarkStart () |
IMPORT_C void | Close () |
IMPORT_C TInt | Open () |
IMPORT_C TInt | ResourceCount () |
IMPORT_C void | SetAllocFail ( RAllocator::TAllocFail , TInt ) |
IMPORT_C void | Close | ( | ) | [static] |
Closes the Graphics Resource driver in the context of the calling process.
This function must be called by a process when finished using the Graphics Resource API. It decrements the process-local open count and, when the count becomes zero, it carries out termination tasks needed to release the internal resources allocated for the calling process.
Each call to Close() must correspond to a prior successful call to Open() . Note that, in a multi-threaded process, it is not generally safe to call Close() regardless of whether the corresponding call to Open() succeeded or failed, since too many calls to Close() from a thread could have an unexpected effect on all the other threads in the process. The following example demonstrates how to open and close the Graphics Resource driver safely from a worker thread.
// Open Graphics Resource driver TBool isDriverOpen = EFalse; if (SgDriver::Open() == KErrNone) { isDriverOpen = ETrue; } // Do some work in this thread DoThreadWork(); // Close Graphics Resource driver if (isDriverOpen) { SgDriver::Close(); }
IMPORT_C TInt | Open | ( | ) | [static] |
Opens the Graphics Resource driver in the context of the calling process.
This function must be called by any process using the Graphics Resource API before any other function in the API. When finished the process should call Close() . If Open() has already been called from the same process then calling it again just increments a process-local open count. Each successful call to Open() must be balanced by a corresponding call to Close() later on.
Note that, in a multi-threaded process, it is not necessary for each thread to call this function. A possible strategy is therefore for the main thread to call SgDriver::Open() at the beginning and SgDriver::Close() at the end, while the rest of the threads do not call either of these but simply use the Graphics Resource API.
IMPORT_C void | SetAllocFail | ( | RAllocator::TAllocFail | aType, |
TInt | aRate | |||
) | [static] |
RAllocator::TAllocFail aType | |
TInt aRate |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.