RDirectGdiImageTarget Class Reference

class RDirectGdiImageTarget

RDirectGdiImageTarget is a handle to a DirectGDI adaptation-specific resource which abstracts the image-based rendering target. The main intention in creating this resource is to allow a global sharable image resource ( RSgImage ) to be used as a target of DirectGDI rendering. For example, in a DirectGDI adaptation where OpenVG is used to implement DirectGDI functionality, the creation of RDirectGdiImageTarget may be associated with the creation of an underlying EGL surface from the given RSgImage . This handle class and its DirectGDI adaptation-specific resource are non-sharable and local within the creating thread.

This class is part of a generic layer and will forward any request to the CDirectGdiDriver singleton for the calling thread.

CDirectGdiContext is activated on an RDirectGdiImageTarget . This causes all subsequent context drawing operations to to draw to the image resource referred to by the RDirectGdiImageTarget .

CDirectGdiContext

Constructor & Destructor Documentation

RDirectGdiImageTarget()

IMPORT_C RDirectGdiImageTarget ( )

Default constructor. Only for embedding instances of RDirectGdiImageTarget into other classes as data members. Before a RDirectGdiImageTarget can be used the other constructor must be called.

RDirectGdiImageTarget(CDirectGdiDriver &)

IMPORT_C RDirectGdiImageTarget ( CDirectGdiDriver & aDriver )

Constructor.

Pre-condition
CDirectGdiDriver object has been initialised from the calling thread.
Post-condition
This handle class has a pointer to the CDirectGdiDriver object for this thread, and is not associated with any DirectGDI adaptation specific resource.

Parameters

CDirectGdiDriver & aDriver The CDirectGdiDriver for this thread.

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Destroys the DirectGDI adaptation-specific resource associated with this handle. Calling this method on a handle that is not associated with any DirectGDI adaptation-specific resource will do nothing. Once Close() is called, this handle can be reused.

Pre-condition
The CDirectGdiDriver object for this handle has been set.
Post-condition
The DirectGDI specific resource associated with this handle will be destroyed (at any time preferred by the adaptation). This handle is no longer associated with a DirectGDI specific resource. The reference counter of the underlying image resource is decremented.

Create(const RSgImage &)

IMPORT_C TInt Create ( const RSgImage & aImage )

Creates a DirectGDI adaptation-specific resource from the given image resource so it can be used as a target of DirectGDI rendering.

Pre-condition
The CDirectGdiDriver object has been set. The image resource has been fully constructed and created with the correct usage that allows it to be used as a DirectGDI target.
Post-condition
The DirectGDI adaptation-specific resource that is bound to the given image resource is created and this handle is now associated with it. The reference counter on the image resource is incremented.

Parameters

const RSgImage & aImage The image resource.

Handle()

TInt Handle ( ) const [inline]

Accessor for a handle to the adaptation object.

Member Data Documentation

CDirectGdiDriver * iDriver

CDirectGdiDriver * iDriver [private]

TInt iHandle

TInt iHandle [private]