class RSurfaceManager |
RSurface Manager User API.
Public Member Functions | |
---|---|
RSurfaceManager() | |
IMPORT_C TInt | AddSurfaceHint(const TSurfaceId &, const THintPair &) |
IMPORT_C void | Close() |
IMPORT_C TInt | CloseSurface(const TSurfaceId &) |
IMPORT_C TInt | CreateSurface(const TSurfaceCreationAttributesBuf &, TSurfaceId &) |
IMPORT_C TInt | CreateSurface(const TSurfaceCreationAttributesBuf &, TSurfaceId &, const RChunk &) |
IMPORT_C TInt | GetBufferOffset(const TSurfaceId &, TInt, TInt &) |
IMPORT_C TInt | GetSurfaceHint(const TSurfaceId &, THintPair &) |
IMPORT_C TInt | GetSurfaceManagerAttrib(TSurfaceManagerAttrib, TInt &) |
IMPORT_C TInt | MapSurface(const TSurfaceId &, RChunk &) |
IMPORT_C TInt | Open() |
IMPORT_C TInt | OpenSurface(const TSurfaceId &) |
IMPORT_C TInt | SetSurfaceHint(const TSurfaceId &, const THintPair &) |
IMPORT_C TInt | SurfaceInfo(const TSurfaceId &, TInfoBuf &) |
IMPORT_C TInt | SynchronizeCache(const TSurfaceId &, TInt, TSyncOperation) |
Private Member Functions | |
---|---|
RSurfaceManagerDriver & | Driver() |
Public Member Enumerations | |
---|---|
enum | TCacheAttribute { ECached = 0, ENotCached = 1 } |
enum | TPageAlignment { EPageAligned = -1 } |
enum | TSurfaceManagerAttrib { EMaxNumberOfHints = 0x0 } |
enum | TSyncOperation { ESyncBeforeNonCPURead, ESyncBeforeNonCPUWrite, ESyncAfterNonCPUWrite } |
Public Member Type Definitions | |
---|---|
typedef | TPckgBuf< TSurfaceInfoV01 > TInfoBuf |
typedef | TPckgBuf< TSurfaceCreationAttributes > TSurfaceCreationAttributesBuf |
Private Attributes | |
---|---|
TInt32 | iDriverBuf |
IMPORT_C TInt | AddSurfaceHint | ( | const TSurfaceId & | aSurface, |
const THintPair & | aHint | |||
) |
Adds a new surface hint to the surface.
const TSurfaceId & aSurface | The surface identifier originally returned when the surface was created. |
const THintPair & aHint | The value of the hint pair to add. |
IMPORT_C void | Close | ( | ) |
Closes the connection to the Surface Manager.
Cleanup is performed by the Surface Manager when a client process exits or closes its last connection. It is not guaranteed that the resources held by the Surface Manager are going to be released synchronously.
IMPORT_C TInt | CloseSurface | ( | const TSurfaceId & | aSurfaceId | ) |
Closes the surface. Decrements the reference count for the surface for the calling process.
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
IMPORT_C TInt | CreateSurface | ( | const TSurfaceCreationAttributesBuf & | aReqs, |
TSurfaceId & | aSurfaceId | |||
) |
Creates a surface and returns its global unique identifier.
Depending on the implementation, this method will allocate the surface in a new shared chunk or in external memory. Surfaces created in external memory cannot be mapped (see TSurfaceInfoV01::iMappable for more information). If the creation succeeds, the surface will be opened with a reference count of 1 in the calling process.
The alignment is 1, 2, 4, 8, 16, 32, 64 or TPageAlignment::EPageAligned.
The offset to first buffer is correctly aligned.
The width and height are both greater than zero.
There is at least one buffer.
The calculated chunk size isn't so big that it will exceed a signed int.
The caching attribute is valid
If the offset between the start of one buffer and the next is specified (not zero), it must be correctly aligned and at least as big as the buffer size calculated from the height and stride.
A surface hint key of zero is allowed when creating a surface, it is ignored
The Surface Manager implementation will treat iStride, iOffsetToFirstBuffer, and iOffsetBetweenBuffers as minimum values as opposed to required values. The caller of this method must not rely on the passed values as it is not guaranteed that they remain the same after surface creation (SurfaceInfo() and GetBufferOffset() should be used instead).
If iOffsetBetweenBuffers is zero, the Surface Manager implementation will layout buffer at its own discretion. Although, a buffer's offset must remain constant during the surface's lifetime.
If iMappable is EFalse the surface won't be mappable, hence calls to MapSurface() will fail.
const TSurfaceCreationAttributesBuf & aReqs | Input parameter, specifies attributes of the surface required. |
TSurfaceId & aSurfaceId | Output parameter, the surface ID, set if the call succeeds. |
IMPORT_C TInt | CreateSurface | ( | const TSurfaceCreationAttributesBuf & | aReqs, |
TSurfaceId & | aSurfaceId, | |||
const RChunk & | aChunkHandle | |||
) |
Creates a surface in an existing shared chunk specified by the caller and returns its global unique identifier.
If the creation succeeds, the surface will be opened with a reference count of 1 in the calling process.
The alignment is 1, 2, 4, 8, 16, 32, 64 or TPageAlignment::EPageAligned.
The offset to first buffer is correctly aligned.
The width and height are both greater than zero.
There is at least one buffer.
The calculated chunk size isn't so big that it will exceed a signed int.
The caching attribute is valid
If the offset between the start of one buffer and the next is specified (not zero), it must be correctly aligned and at least as big as the buffer size calculated from the height and stride.
A surface hint key of zero is allowed when creating a surface, it is ignored
If iOffsetBetweenBuffers is zero, the Surface Manager implementation will layout buffer at its own discretion. Although, a buffer's offset must remain constant during the surface's lifetime.
The attributes iContiguous and iCacheAttribute are ignored for existing chunks.
Also, note that surface manager will not do any rounding for offset to first buffer and offset between buffers. It is up to the user, to give exact aligned values for this attributes, otherwise surface creation will fail.
If iMappable is EFalse the surface won't be mappable, hence calls to MapSurface() will fail.
const TSurfaceCreationAttributesBuf & aReqs | Input parameter, specifies attributes of the surface required. |
TSurfaceId & aSurfaceId | Output parameter, the surface ID, set if the call succeeds. |
const RChunk & aChunkHandle | Handle of the existing shared chunk. |
RSurfaceManagerDriver & | Driver | ( | ) | [private, inline] |
Get a reference of the implementation of the surface manager.
IMPORT_C TInt | GetBufferOffset | ( | const TSurfaceId & | aSurfaceId, |
TInt | aBuffer, | |||
TInt & | aOffset | |||
) |
Get the offset of the specified buffer from the base address of the underlying chunk.
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
TInt aBuffer | The buffer for which the offset is requested. Indexed from 0. |
TInt & aOffset | Output parameter set to the offset within the chunk. |
IMPORT_C TInt | GetSurfaceHint | ( | const TSurfaceId & | aSurfaceId, |
THintPair & | aHint | |||
) |
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
THintPair & aHint | The hint value for the requested hint pair key. |
IMPORT_C TInt | GetSurfaceManagerAttrib | ( | TSurfaceManagerAttrib | aAttrib, |
TInt & | aValue | |||
) |
Returns information specific to the Surface Manager implementation.
TSurfaceManagerAttrib aAttrib | Attribute to retrieve |
TInt & aValue | Output parameter set to the value for the specified attribute |
IMPORT_C TInt | MapSurface | ( | const TSurfaceId & | aSurfaceId, |
RChunk & | aHandle | |||
) |
Maps the surface into the current client process address space.
The actual memory will remain mapped into the calling process for as long as the RChunk handle aChunk is open.
Whether or not a surface is mappable is determined at creation time, see TSurfaceCreationAttributes::iMappable.
The address of the pixel data in buffer N is chunk.Base() + GetBufferOffset(N).
Surfaces created with existing shared chunks will get the same chunk handle.
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
RChunk & aHandle | Output parameter, handle to the implementation specific Shared Chunk. |
IMPORT_C TInt | Open | ( | ) |
Opens a connection to the Surface Manager.
The connection needs to be closed by calling Close() when it is no longer required.
IMPORT_C TInt | OpenSurface | ( | const TSurfaceId & | aSurfaceId | ) |
Opens a surface.
If the surface is already open in this process, this call increments the reference count for the surface for this process. If the surface hasn't been opened in this process, it opens the surface in this process and sets the reference count to 1 for this process.
const TSurfaceId & aSurfaceId | The surface id originally returned when the surface was created. |
IMPORT_C TInt | SetSurfaceHint | ( | const TSurfaceId & | aSurfaceId, |
const THintPair & | aHint | |||
) |
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
const THintPair & aHint | The value of the hint pair to set. |
IMPORT_C TInt | SurfaceInfo | ( | const TSurfaceId & | aSurfaceId, |
TInfoBuf & | aInfo | |||
) |
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
TInfoBuf & aInfo | TInfoBuf to receive the information about the surface. |
IMPORT_C TInt | SynchronizeCache | ( | const TSurfaceId & | aSurfaceId, |
TInt | aBuffer, | |||
TSyncOperation | aOperation | |||
) |
const TSurfaceId & aSurfaceId | The surface identifier originally returned when the surface was created. |
TInt aBuffer | The buffer number indexed from 0 within the surface whose memory region is to be flushed. |
TSyncOperation aOperation | Specifies the sync operation as before non CPU hardware reads or before non CPU hardware writes or after non CPU hardware writes between physical memory of the surface and the cache contents. |
ESyncBeforeNonCPURead |
Synchronize before non CPU hardware reads from the memory, i.e. if the buffer is cached and may have been written to by the CPU, this type of synchronisation should be used before a peripheral is used to read from the buffer's memory |
ESyncBeforeNonCPUWrite |
Synchronize before non CPU hardware writes to the memory, i.e. if the buffer is cached and may have been written to by the CPU, this type of synchronisation should be used before a peripheral is used to write to the buffer's memory |
ESyncAfterNonCPUWrite |
Synchronize after non CPU hardware writes to the memory, i.e. if the buffer is cached, this type of synchronisation should be used after a peripheral has been used to write to the buffer's memory |
typedef TPckgBuf< TSurfaceInfoV01 > | TInfoBuf |
Package buf used to pass information about a surface from the driver
typedef TPckgBuf< TSurfaceCreationAttributes > | TSurfaceCreationAttributesBuf |
Package buf used to pass the surface creation attributes to the device driver
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.