2013-04-16 21:35:57 +00: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 23:17:23 +00:00
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat
|
2013-11-26 22:15:17 +00:00
|
|
|
#include "OGLShaderProgram.h"
|
2013-04-16 21:35:57 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
class GLContext;
|
|
|
|
}
|
2013-08-11 23:17:23 +00:00
|
|
|
|
2013-04-16 21:35:57 +00:00
|
|
|
namespace layers {
|
|
|
|
|
2013-12-09 01:40:59 +00:00
|
|
|
class LayerManagerComposite;
|
2013-08-11 23:17:23 +00:00
|
|
|
|
2013-04-16 21:35:57 +00:00
|
|
|
/**
|
|
|
|
* Minimal interface to allow widgets to draw using OpenGL. Abstracts
|
2013-11-26 22:15:17 +00:00
|
|
|
* CompositorOGL. Call CreateGLManager with a LayerManagerComposite
|
|
|
|
* backed by a CompositorOGL.
|
2013-04-16 21:35:57 +00:00
|
|
|
*/
|
|
|
|
class GLManager
|
|
|
|
{
|
|
|
|
public:
|
2013-12-09 01:40:59 +00:00
|
|
|
static GLManager* CreateGLManager(LayerManagerComposite* aManager);
|
2013-04-16 21:35:57 +00:00
|
|
|
|
|
|
|
virtual ~GLManager() {}
|
|
|
|
|
|
|
|
virtual gl::GLContext* gl() const = 0;
|
2013-11-08 06:22:05 +00:00
|
|
|
virtual ShaderProgramOGL* GetProgram(GLenum aTarget, gfx::SurfaceFormat aFormat) = 0;
|
|
|
|
virtual const gfx::Matrix4x4& GetProjMatrix() const = 0;
|
2014-05-22 10:29:54 +00:00
|
|
|
virtual void BindAndDrawQuad(ShaderProgramOGL *aProg, const gfx::Rect& aLayerRect,
|
|
|
|
const gfx::Rect& aTextureRect) = 0;
|
2013-04-16 21:35:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|