Classes | Public Member Functions | Protected Member Functions | Protected Attributes

mozilla::layers::CanvasLayer Class Reference

A Layer for HTML Canvas elements. More...

#include <Layers.h>

Inheritance diagram for mozilla::layers::CanvasLayer:
Collaboration diagram for mozilla::layers::CanvasLayer:

List of all members.

Classes

struct  Data

Public Member Functions

virtual void Initialize (const Data &aData)=0
 CONSTRUCTION PHASE ONLY Initialize this CanvasLayer with the given data.
virtual void Updated (const nsIntRect &aRect)=0
 CONSTRUCTION PHASE ONLY Notify this CanvasLayer that the rectangle given by aRect has been updated, and any work that needs to be done to bring the contents from the Surface/GLContext to the Layer in preparation for compositing should be performed.
void SetFilter (gfxPattern::GraphicsFilter aFilter)
 CONSTRUCTION PHASE ONLY Set the filter used to resample this image (if necessary).
gfxPattern::GraphicsFilter GetFilter () const
virtual const char * Name () const
virtual LayerType GetType () const
virtual void ComputeEffectiveTransforms (const gfx3DMatrix &aTransformToSurface)

Protected Member Functions

 CanvasLayer (LayerManager *aManager, void *aImplData)
virtual nsACStringPrintInfo (nsACString &aTo, const char *aPrefix)

Protected Attributes

nsIntRect mBounds
 0, 0, canvaswidth, canvasheight
gfxPattern::GraphicsFilter mFilter

Detailed Description

A Layer for HTML Canvas elements.

It's backed by either a gfxASurface or a GLContext (for WebGL layers), and has some control for intelligent updating from the source if necessary (for example, if hardware compositing is not available, for reading from the GL buffer into an image surface that we can layer composite.)

After Initialize is called, the underlying canvas Surface/GLContext must not be modified during a layer transaction.


Constructor & Destructor Documentation

mozilla::layers::CanvasLayer::CanvasLayer ( LayerManager aManager,
void *  aImplData 
) [inline, protected]

Member Function Documentation

virtual void mozilla::layers::CanvasLayer::ComputeEffectiveTransforms ( const gfx3DMatrix aTransformToSurface  )  [inline, virtual]
Parameters:
aTransformToSurface the composition of the transforms from the parent layer (if any) to the destination pixel grid.

Computes mEffectiveTransform for this layer and all its descendants. mEffectiveTransform transforms this layer up to the destination pixel grid (whatever aTransformToSurface is relative to).

We promise that when this is called on a layer, all ancestor layers have already had ComputeEffectiveTransforms called.

Implements mozilla::layers::Layer.

gfxPattern::GraphicsFilter mozilla::layers::CanvasLayer::GetFilter (  )  const [inline]
virtual LayerType mozilla::layers::CanvasLayer::GetType (  )  const [inline, virtual]
virtual void mozilla::layers::CanvasLayer::Initialize ( const Data aData  )  [pure virtual]

CONSTRUCTION PHASE ONLY Initialize this CanvasLayer with the given data.

The data must have either mSurface or mGLContext initialized (but not both), as well as mSize.

This must only be called once.

virtual const char* mozilla::layers::CanvasLayer::Name (  )  const [inline, virtual]
virtual nsACString& mozilla::layers::CanvasLayer::PrintInfo ( nsACString aTo,
const char *  aPrefix 
) [protected, virtual]

Reimplemented from mozilla::layers::Layer.

void mozilla::layers::CanvasLayer::SetFilter ( gfxPattern::GraphicsFilter  aFilter  )  [inline]

CONSTRUCTION PHASE ONLY Set the filter used to resample this image (if necessary).

virtual void mozilla::layers::CanvasLayer::Updated ( const nsIntRect aRect  )  [pure virtual]

CONSTRUCTION PHASE ONLY Notify this CanvasLayer that the rectangle given by aRect has been updated, and any work that needs to be done to bring the contents from the Surface/GLContext to the Layer in preparation for compositing should be performed.


Member Data Documentation

0, 0, canvaswidth, canvasheight


The documentation for this class was generated from the following file: