1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/layers/opengl/TexturePoolOGL.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef GFX_TEXTUREPOOLOGL_H 1.9 +#define GFX_TEXTUREPOOLOGL_H 1.10 + 1.11 +#include "GLContextTypes.h" // for GLContext, GLuint 1.12 + 1.13 +namespace mozilla { 1.14 +namespace gl { 1.15 + 1.16 +// A texture pool for for the on-screen GLContext. The main purpose of this class 1.17 +// is to provide the ability to easily allocate an on-screen texture from the 1.18 +// content thread. The unfortunate nature of the SurfaceTexture API (see nsSurfaceTexture) 1.19 +// necessitates this. 1.20 +class TexturePoolOGL 1.21 +{ 1.22 +public: 1.23 + // Get a new texture from the pool. Will block 1.24 + // and wait for one to be created if necessary 1.25 + static GLuint AcquireTexture(); 1.26 + 1.27 + // Called by the active LayerManagerOGL to fill 1.28 + // the pool 1.29 + static void Fill(GLContext* aContext); 1.30 + 1.31 + // Initializes the pool, but does not fill it. Called by gfxPlatform init. 1.32 + static void Init(); 1.33 + 1.34 + // Clears all internal data structures in preparation for shutdown 1.35 + static void Shutdown(); 1.36 +}; 1.37 + 1.38 +} // gl 1.39 +} // mozilla 1.40 + 1.41 +#endif // GFX_TEXTUREPOOLOGL_H