michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef GFX_TEXTUREPOOLOGL_H michael@0: #define GFX_TEXTUREPOOLOGL_H michael@0: michael@0: #include "GLContextTypes.h" // for GLContext, GLuint michael@0: michael@0: namespace mozilla { michael@0: namespace gl { michael@0: michael@0: // A texture pool for for the on-screen GLContext. The main purpose of this class michael@0: // is to provide the ability to easily allocate an on-screen texture from the michael@0: // content thread. The unfortunate nature of the SurfaceTexture API (see nsSurfaceTexture) michael@0: // necessitates this. michael@0: class TexturePoolOGL michael@0: { michael@0: public: michael@0: // Get a new texture from the pool. Will block michael@0: // and wait for one to be created if necessary michael@0: static GLuint AcquireTexture(); michael@0: michael@0: // Called by the active LayerManagerOGL to fill michael@0: // the pool michael@0: static void Fill(GLContext* aContext); michael@0: michael@0: // Initializes the pool, but does not fill it. Called by gfxPlatform init. michael@0: static void Init(); michael@0: michael@0: // Clears all internal data structures in preparation for shutdown michael@0: static void Shutdown(); michael@0: }; michael@0: michael@0: } // gl michael@0: } // mozilla michael@0: michael@0: #endif // GFX_TEXTUREPOOLOGL_H