nsISVGRendererCanvas

IID:2e64a227-de4b-4a69-ab82-5dda1579e90f
Inherits From:nsISupports

\addtogroup renderer_interfaces Rendering Engine Interfaces One of a number of interfaces (all starting with nsISVGRenderer*) to be implemented by an SVG rendering engine. See nsISVGRenderer for more details.

This interface abstracts a rendering engine-native canvas object onto which path and glyph geometries can be painted.

A canvas object is instantiated by the backend for a given Mozilla-native rendering object with a call to nsISVGRenderer::createCanvas().


Constants

Set render mode (clipping or normal draw)
PRUint16 SVG_RENDER_MODE_NORMAL = 0
PRUint16 SVG_RENDER_MODE_CLIP = 1

Properties

PRUint16 renderMode


Methods

void clear ( nscolor color ) void compositeSurface ( nsISVGRendererSurface surface , PRUint32 x , PRUint32 y , float opacity ) void compositeSurfaceMatrix ( nsISVGRendererSurface surface , nsIDOMSVGMatrix canvasTM , float opacity ) void flush ( ) nsPresContext* getPresContext ( ) [noscript] nsIRenderingContext lockRenderingContext ( nsRectRef rect ) void popClip ( ) void popSurface ( ) void pushClip ( ) void pushSurface ( nsISVGRendererSurface surface ) void setClipRect ( nsIDOMSVGMatrix canvasTM , float x , float y , float width , float height ) void unlockRenderingContext ( )

void clear ( nscolor color )

Fill the canvas with the given color.

Arguments:
color: Fill color.

void compositeSurface ( nsISVGRendererSurface surface , PRUint32 x , PRUint32 y , float opacity )

Surface composition.

Arguments:
surface
x
y
opacity

void compositeSurfaceMatrix ( nsISVGRendererSurface surface , nsIDOMSVGMatrix canvasTM , float opacity )

Arguments:
surface
canvasTM
opacity

void flush ( )

Ensure that all renderings on the canvas have been flushed to the Mozilla-native rendering context.


nsPresContext* getPresContext ( )


nsIRenderingContext lockRenderingContext ( nsRectRef rect )

Lock a portion of the canvas and obtain a rendering context onto which Mozilla can paint non-svg content. This is needed for (partial) foreignObject support.

LockRenderingContext() calls are paired with unlockRenderingContext() calls.

Arguments:
rect: Area to be locked.
Returns:
Mozilla-native rendering context for the locked area.

void popClip ( )


void popSurface ( )


void pushClip ( )

Push/Pop clip path.


void pushSurface ( nsISVGRendererSurface surface )

Push/Pop surface as primary drawing surface.

Arguments:
surface

void setClipRect ( nsIDOMSVGMatrix canvasTM , float x , float y , float width , float height )

Set rectangular clip region.

Arguments:
canvasTM
x
y
width
height

void unlockRenderingContext ( )

Unlock the canvas portion locked with a previous call to lockRenderingContext().


References

This interface is passed as an argument to the following methods:

nsISVGRendererGlyphGeometry.render, nsISVGRendererPathGeometry.render

This interface is returned from the following methods:

nsISVGRenderer.createCanvas

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com