A Layer for HTML Canvas elements. More...
#include <Layers.h>
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 nsACString & | PrintInfo (nsACString &aTo, const char *aPrefix) |
Protected Attributes | |
nsIntRect | mBounds |
0, 0, canvaswidth, canvasheight | |
gfxPattern::GraphicsFilter | mFilter |
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.
mozilla::layers::CanvasLayer::CanvasLayer | ( | LayerManager * | aManager, | |
void * | aImplData | |||
) | [inline, protected] |
virtual void mozilla::layers::CanvasLayer::ComputeEffectiveTransforms | ( | const gfx3DMatrix & | aTransformToSurface | ) | [inline, virtual] |
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] |
Implements mozilla::layers::Layer.
Reimplemented in mozilla::layers::ShadowCanvasLayer.
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] |
Implements mozilla::layers::Layer.
Reimplemented in mozilla::layers::ShadowCanvasLayer.
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.
nsIntRect mozilla::layers::CanvasLayer::mBounds [protected] |
0, 0, canvaswidth, canvasheight