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