Public Types | Public Member Functions

mozilla::layers::LayerManagerOGL Class Reference

This is the LayerManager used for OpenGL 2.1. More...

#include <LayerManagerOGL.h>

Inheritance diagram for mozilla::layers::LayerManagerOGL:
Collaboration diagram for mozilla::layers::LayerManagerOGL:

List of all members.

Public Types

enum  InitMode { InitModeNone, InitModeClear, InitModeCopy }
 

Controls how to initialize the texture / FBO created by CreateFBOWithTexture.

More...

Public Member Functions

 LayerManagerOGL (nsIWidget *aWidget)
virtual ~LayerManagerOGL ()
void CleanupResources ()
void Destroy ()
 Release layers and resources held by this layer manager, and mark it as destroyed.
PRBool Initialize ()
 Initializes the layer manager with a given GLContext.
PRBool Initialize (nsRefPtr< GLContext > aContext)
void SetClippingRegion (const nsIntRegion &aClippingRegion)
 Sets the clipping region for this layer manager.
void BeginTransaction ()
 LayerManager implementation.
void BeginTransactionWithTarget (gfxContext *aTarget)
 Start a new transaction.
void EndConstruction ()
virtual void EndTransaction (DrawThebesLayerCallback aCallback, void *aCallbackData)
 Finish the construction phase of the transaction, perform the drawing phase, and end the transaction.
virtual void SetRoot (Layer *aLayer)
 CONSTRUCTION PHASE ONLY Set the root layer.
virtual already_AddRefed
< ThebesLayer
CreateThebesLayer ()
 CONSTRUCTION PHASE ONLY Create a ThebesLayer for this manager's layer tree.
virtual already_AddRefed
< ContainerLayer
CreateContainerLayer ()
 CONSTRUCTION PHASE ONLY Create a ContainerLayer for this manager's layer tree.
virtual already_AddRefed
< ImageLayer
CreateImageLayer ()
 CONSTRUCTION PHASE ONLY Create an ImageLayer for this manager's layer tree.
virtual already_AddRefed
< ColorLayer
CreateColorLayer ()
 CONSTRUCTION PHASE ONLY Create a ColorLayer for this manager's layer tree.
virtual already_AddRefed
< CanvasLayer
CreateCanvasLayer ()
 CONSTRUCTION PHASE ONLY Create a CanvasLayer for this manager's layer tree.
virtual already_AddRefed
< ImageContainer
CreateImageContainer ()
 Can be called anytime.
virtual already_AddRefed
< ShadowThebesLayer
CreateShadowThebesLayer ()
virtual already_AddRefed
< ShadowContainerLayer
CreateShadowContainerLayer ()
virtual already_AddRefed
< ShadowImageLayer
CreateShadowImageLayer ()
virtual already_AddRefed
< ShadowColorLayer
CreateShadowColorLayer ()
virtual already_AddRefed
< ShadowCanvasLayer
CreateShadowCanvasLayer ()
virtual LayersBackend GetBackendType ()
 Type of layer manager his is.
virtual void GetBackendName (nsAString &name)
 Return the name of the layer manager's backend.
void ForgetImageContainer (ImageContainer *aContainer)
 Image Container management.
void RememberImageContainer (ImageContainer *aContainer)
void MakeCurrent (PRBool aForce=0)
 Helper methods.
ColorTextureLayerProgramGetColorTextureLayerProgram (ProgramType type)
ColorTextureLayerProgramGetRGBALayerProgram ()
ColorTextureLayerProgramGetBGRALayerProgram ()
ColorTextureLayerProgramGetRGBXLayerProgram ()
ColorTextureLayerProgramGetBGRXLayerProgram ()
ColorTextureLayerProgramGetBasicLayerProgram (PRBool aOpaque, PRBool aIsRGB)
ColorTextureLayerProgramGetRGBARectLayerProgram ()
SolidColorLayerProgramGetColorLayerProgram ()
YCbCrTextureLayerProgramGetYCbCrLayerProgram ()
ComponentAlphaTextureLayerProgramGetComponentAlphaPass1LayerProgram ()
ComponentAlphaTextureLayerProgramGetComponentAlphaPass2LayerProgram ()
CopyProgramGetCopy2DProgram ()
CopyProgramGetCopy2DRectProgram ()
ColorTextureLayerProgramGetFBOLayerProgram ()
GLContextgl () const
DrawThebesLayerCallback GetThebesLayerCallback () const
void * GetThebesLayerCallbackData () const
GLContextglForResources () const
void CallThebesLayerDrawCallback (ThebesLayer *aLayer, gfxContext *aContext, const nsIntRegion &aRegionToDraw)
GLenum FBOTextureTarget ()
void CreateFBOWithTexture (const nsIntRect &aRect, InitMode aInit, GLuint *aFBO, GLuint *aTexture)
GLuint QuadVBO ()
GLintptr QuadVBOVertexOffset ()
GLintptr QuadVBOTexCoordOffset ()
GLintptr QuadVBOFlippedTexCoordOffset ()
void BindQuadVBO ()
void QuadVBOVerticesAttrib (GLuint aAttribIndex)
void QuadVBOTexCoordsAttrib (GLuint aAttribIndex)
void QuadVBOFlippedTexCoordsAttrib (GLuint aAttribIndex)
void BindAndDrawQuad (GLuint aVertAttribIndex, GLuint aTexCoordAttribIndex, bool aFlipped=false)
void BindAndDrawQuad (LayerProgram *aProg, bool aFlipped=false)
const nsIntSizeGetWigetSize ()
void SetupPipeline (int aWidth, int aHeight)
 Setup the viewport and projection matrix for rendering to a window of the given dimensions.

Detailed Description

This is the LayerManager used for OpenGL 2.1.

For now this will render on the main thread.


Member Enumeration Documentation

Controls how to initialize the texture / FBO created by CreateFBOWithTexture.

  • InitModeNone: No initialization, contents are undefined.
  • InitModeClear: Clears the FBO.
  • InitModeCopy: Copies the contents of the current glReadBuffer into the texture.
Enumerator:
InitModeNone 
InitModeClear 
InitModeCopy 

Constructor & Destructor Documentation

mozilla::layers::LayerManagerOGL::LayerManagerOGL ( nsIWidget *  aWidget  ) 
virtual mozilla::layers::LayerManagerOGL::~LayerManagerOGL (  )  [virtual]

Member Function Documentation

void mozilla::layers::LayerManagerOGL::BeginTransaction (  )  [virtual]

LayerManager implementation.

Implements mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::BeginTransactionWithTarget ( gfxContext aTarget  )  [virtual]

Start a new transaction.

Nested transactions are not allowed so there must be no transaction currently in progress. This transaction will render the contents of the layer tree to the given target context. The rendering will be complete when EndTransaction returns.

Implements mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::BindAndDrawQuad ( GLuint  aVertAttribIndex,
GLuint  aTexCoordAttribIndex,
bool  aFlipped = false 
) [inline]
void mozilla::layers::LayerManagerOGL::BindAndDrawQuad ( LayerProgram aProg,
bool  aFlipped = false 
) [inline]
void mozilla::layers::LayerManagerOGL::BindQuadVBO (  )  [inline]
void mozilla::layers::LayerManagerOGL::CallThebesLayerDrawCallback ( ThebesLayer aLayer,
gfxContext aContext,
const nsIntRegion aRegionToDraw 
) [inline]
void mozilla::layers::LayerManagerOGL::CleanupResources (  ) 
virtual already_AddRefed<CanvasLayer> mozilla::layers::LayerManagerOGL::CreateCanvasLayer (  )  [virtual]

CONSTRUCTION PHASE ONLY Create a CanvasLayer for this manager's layer tree.

Implements mozilla::layers::LayerManager.

virtual already_AddRefed<ColorLayer> mozilla::layers::LayerManagerOGL::CreateColorLayer (  )  [virtual]

CONSTRUCTION PHASE ONLY Create a ColorLayer for this manager's layer tree.

Implements mozilla::layers::LayerManager.

virtual already_AddRefed<ContainerLayer> mozilla::layers::LayerManagerOGL::CreateContainerLayer (  )  [virtual]

CONSTRUCTION PHASE ONLY Create a ContainerLayer for this manager's layer tree.

Implements mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::CreateFBOWithTexture ( const nsIntRect aRect,
InitMode  aInit,
GLuint aFBO,
GLuint aTexture 
)
virtual already_AddRefed<ImageContainer> mozilla::layers::LayerManagerOGL::CreateImageContainer (  )  [virtual]

Can be called anytime.

Implements mozilla::layers::LayerManager.

virtual already_AddRefed<ImageLayer> mozilla::layers::LayerManagerOGL::CreateImageLayer (  )  [virtual]

CONSTRUCTION PHASE ONLY Create an ImageLayer for this manager's layer tree.

Implements mozilla::layers::LayerManager.

virtual already_AddRefed<ShadowCanvasLayer> mozilla::layers::LayerManagerOGL::CreateShadowCanvasLayer (  )  [virtual]
virtual already_AddRefed<ShadowColorLayer> mozilla::layers::LayerManagerOGL::CreateShadowColorLayer (  )  [virtual]
virtual already_AddRefed<ShadowContainerLayer> mozilla::layers::LayerManagerOGL::CreateShadowContainerLayer (  )  [virtual]
virtual already_AddRefed<ShadowImageLayer> mozilla::layers::LayerManagerOGL::CreateShadowImageLayer (  )  [virtual]
virtual already_AddRefed<ShadowThebesLayer> mozilla::layers::LayerManagerOGL::CreateShadowThebesLayer (  )  [virtual]
virtual already_AddRefed<ThebesLayer> mozilla::layers::LayerManagerOGL::CreateThebesLayer (  )  [virtual]

CONSTRUCTION PHASE ONLY Create a ThebesLayer for this manager's layer tree.

Implements mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::Destroy (  )  [virtual]

Release layers and resources held by this layer manager, and mark it as destroyed.

Should do any cleanup necessary in preparation for its widget going away. After this call, only user data calls are valid on the layer manager.

Reimplemented from mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::EndConstruction (  ) 
virtual void mozilla::layers::LayerManagerOGL::EndTransaction ( DrawThebesLayerCallback  aCallback,
void *  aCallbackData 
) [virtual]

Finish the construction phase of the transaction, perform the drawing phase, and end the transaction.

During the drawing phase, all ThebesLayers in the tree are drawn in tree order, exactly once each, except for those layers where it is known that the visible region is empty.

Implements mozilla::layers::LayerManager.

GLenum mozilla::layers::LayerManagerOGL::FBOTextureTarget (  )  [inline]
void mozilla::layers::LayerManagerOGL::ForgetImageContainer ( ImageContainer aContainer  ) 

Image Container management.

virtual void mozilla::layers::LayerManagerOGL::GetBackendName ( nsAString aName  )  [inline, virtual]

Return the name of the layer manager's backend.

Implements mozilla::layers::LayerManager.

virtual LayersBackend mozilla::layers::LayerManagerOGL::GetBackendType (  )  [inline, virtual]

Type of layer manager his is.

This is to be used sparsely in order to avoid a lot of Layers backend specific code. It should be used only when Layers backend specific functionality is necessary.

Implements mozilla::layers::LayerManager.

ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetBasicLayerProgram ( PRBool  aOpaque,
PRBool  aIsRGB 
) [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetBGRALayerProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetBGRXLayerProgram (  )  [inline]
SolidColorLayerProgram* mozilla::layers::LayerManagerOGL::GetColorLayerProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetColorTextureLayerProgram ( ProgramType  type  )  [inline]
ComponentAlphaTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetComponentAlphaPass1LayerProgram (  )  [inline]
ComponentAlphaTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetComponentAlphaPass2LayerProgram (  )  [inline]
CopyProgram* mozilla::layers::LayerManagerOGL::GetCopy2DProgram (  )  [inline]
CopyProgram* mozilla::layers::LayerManagerOGL::GetCopy2DRectProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetFBOLayerProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetRGBALayerProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetRGBARectLayerProgram (  )  [inline]
ColorTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetRGBXLayerProgram (  )  [inline]
DrawThebesLayerCallback mozilla::layers::LayerManagerOGL::GetThebesLayerCallback (  )  const [inline]
void* mozilla::layers::LayerManagerOGL::GetThebesLayerCallbackData (  )  const [inline]
const nsIntSize& mozilla::layers::LayerManagerOGL::GetWigetSize (  )  [inline]
YCbCrTextureLayerProgram* mozilla::layers::LayerManagerOGL::GetYCbCrLayerProgram (  )  [inline]
GLContext* mozilla::layers::LayerManagerOGL::gl (  )  const [inline]
GLContext* mozilla::layers::LayerManagerOGL::glForResources (  )  const [inline]
PRBool mozilla::layers::LayerManagerOGL::Initialize ( nsRefPtr< GLContext aContext  ) 
PRBool mozilla::layers::LayerManagerOGL::Initialize (  )  [inline]

Initializes the layer manager with a given GLContext.

If aContext is null then the layer manager will try to create one for the associated widget.

Parameters:
aContext an existing GL context to use. Can be created with CreateContext()
Returns:
True is initialization was succesful, false when it was not.
void mozilla::layers::LayerManagerOGL::MakeCurrent ( PRBool  aForce = 0  )  [inline]

Helper methods.

GLuint mozilla::layers::LayerManagerOGL::QuadVBO (  )  [inline]
GLintptr mozilla::layers::LayerManagerOGL::QuadVBOFlippedTexCoordOffset (  )  [inline]
void mozilla::layers::LayerManagerOGL::QuadVBOFlippedTexCoordsAttrib ( GLuint  aAttribIndex  )  [inline]
GLintptr mozilla::layers::LayerManagerOGL::QuadVBOTexCoordOffset (  )  [inline]
void mozilla::layers::LayerManagerOGL::QuadVBOTexCoordsAttrib ( GLuint  aAttribIndex  )  [inline]
GLintptr mozilla::layers::LayerManagerOGL::QuadVBOVertexOffset (  )  [inline]
void mozilla::layers::LayerManagerOGL::QuadVBOVerticesAttrib ( GLuint  aAttribIndex  )  [inline]
void mozilla::layers::LayerManagerOGL::RememberImageContainer ( ImageContainer aContainer  ) 
void mozilla::layers::LayerManagerOGL::SetClippingRegion ( const nsIntRegion aClippingRegion  ) 

Sets the clipping region for this layer manager.

This is important on windows because using OGL we no longer have GDI's native clipping. Therefor widget must tell us what part of the screen is being invalidated, and we should clip to this.

Parameters:
aClippingRegion Region to clip to. Setting an empty region will disable clipping.
virtual void mozilla::layers::LayerManagerOGL::SetRoot ( Layer aLayer  )  [inline, virtual]

CONSTRUCTION PHASE ONLY Set the root layer.

Implements mozilla::layers::LayerManager.

void mozilla::layers::LayerManagerOGL::SetupPipeline ( int  aWidth,
int  aHeight 
)

Setup the viewport and projection matrix for rendering to a window of the given dimensions.


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