michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- 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 michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MOZILLA_GFX_GLMANAGER_H michael@0: #define MOZILLA_GFX_GLMANAGER_H michael@0: michael@0: #include "mozilla/gfx/Types.h" // for SurfaceFormat michael@0: #include "OGLShaderProgram.h" michael@0: michael@0: namespace mozilla { michael@0: namespace gl { michael@0: class GLContext; michael@0: } michael@0: michael@0: namespace layers { michael@0: michael@0: class LayerManagerComposite; michael@0: michael@0: /** michael@0: * Minimal interface to allow widgets to draw using OpenGL. Abstracts michael@0: * CompositorOGL. Call CreateGLManager with a LayerManagerComposite michael@0: * backed by a CompositorOGL. michael@0: */ michael@0: class GLManager michael@0: { michael@0: public: michael@0: static GLManager* CreateGLManager(LayerManagerComposite* aManager); michael@0: michael@0: virtual ~GLManager() {} michael@0: michael@0: virtual gl::GLContext* gl() const = 0; michael@0: virtual ShaderProgramOGL* GetProgram(GLenum aTarget, gfx::SurfaceFormat aFormat) = 0; michael@0: virtual const gfx::Matrix4x4& GetProjMatrix() const = 0; michael@0: virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) = 0; michael@0: }; michael@0: michael@0: } michael@0: } michael@0: #endif