2013-04-16 14:35:57 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_GLMANAGER_H
|
|
|
|
#define MOZILLA_GFX_GLMANAGER_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat
|
2013-11-26 14:15:17 -08:00
|
|
|
#include "OGLShaderProgram.h"
|
2013-04-16 14:35:57 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
class GLContext;
|
|
|
|
}
|
2013-08-11 16:17:23 -07:00
|
|
|
|
2013-04-16 14:35:57 -07:00
|
|
|
namespace layers {
|
|
|
|
|
2013-12-08 17:40:59 -08:00
|
|
|
class LayerManagerComposite;
|
2013-08-11 16:17:23 -07:00
|
|
|
|
2013-04-16 14:35:57 -07:00
|
|
|
/**
|
|
|
|
* Minimal interface to allow widgets to draw using OpenGL. Abstracts
|
2013-11-26 14:15:17 -08:00
|
|
|
* CompositorOGL. Call CreateGLManager with a LayerManagerComposite
|
|
|
|
* backed by a CompositorOGL.
|
2013-04-16 14:35:57 -07:00
|
|
|
*/
|
|
|
|
class GLManager
|
|
|
|
{
|
|
|
|
public:
|
2013-12-08 17:40:59 -08:00
|
|
|
static GLManager* CreateGLManager(LayerManagerComposite* aManager);
|
2013-04-16 14:35:57 -07:00
|
|
|
|
|
|
|
virtual ~GLManager() {}
|
|
|
|
|
|
|
|
virtual gl::GLContext* gl() const = 0;
|
2013-11-07 22:22:05 -08:00
|
|
|
virtual ShaderProgramOGL* GetProgram(GLenum aTarget, gfx::SurfaceFormat aFormat) = 0;
|
|
|
|
virtual const gfx::Matrix4x4& GetProjMatrix() const = 0;
|
2013-04-16 14:35:57 -07:00
|
|
|
virtual void BindAndDrawQuad(ShaderProgramOGL *aProg) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|