Bug 556029: Add the ability to detect which layers backend is used. r=roc

This commit is contained in:
Bas Schouten 2010-03-30 20:58:37 +02:00
parent 667d7d4438
commit fc93216036
3 changed files with 15 additions and 0 deletions

View File

@ -109,6 +109,11 @@ class THEBES_API LayerManager {
THEBES_INLINE_DECL_REFCOUNTING(LayerManager)
public:
enum LayersBackend {
LAYERS_BASIC = 0,
LAYERS_OPENGL
};
virtual ~LayerManager() {}
/**
@ -162,6 +167,13 @@ public:
* Can be called anytime
*/
virtual already_AddRefed<ImageContainer> CreateImageContainer() = 0;
/**
* 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.
*/
virtual LayersBackend GetBackendType() = 0;
};
/**

View File

@ -87,6 +87,7 @@ public:
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
virtual already_AddRefed<ImageLayer> CreateImageLayer();
virtual already_AddRefed<ImageContainer> CreateImageContainer();
virtual LayersBackend GetBackendType() { return LAYERS_BASIC; }
#ifdef DEBUG
PRBool InConstruction() { return mPhase == PHASE_CONSTRUCTION; }

View File

@ -203,6 +203,8 @@ public:
virtual already_AddRefed<ImageContainer> CreateImageContainer();
virtual LayersBackend GetBackendType() { return LAYERS_OPENGL; }
/**
* Helper methods.
*/