2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
19
#ifndef MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
20
#define MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
22
#include "mir/graphics/surfaceless_egl_context.h"
24
#include "mir/graphics/display_buffer.h"
25
#include "mir/geometry/size.h"
26
#include "mir/geometry/rectangle.h"
27
#include "mir/renderer/gl/render_target.h"
41
class GLFramebufferObject
44
GLFramebufferObject(geometry::Size const& size);
45
~GLFramebufferObject();
50
geometry::Size const size;
53
unsigned int color_renderbuffer;
54
unsigned int depth_renderbuffer;
60
class DisplayBuffer : public graphics::DisplayBuffer,
61
public graphics::NativeDisplayBuffer,
62
public renderer::gl::RenderTarget
65
DisplayBuffer(SurfacelessEGLContext egl_context,
66
geometry::Rectangle const& area);
68
geometry::Rectangle view_area() const override;
69
void make_current() override;
71
void release_current() override;
72
void swap_buffers() override;
74
MirOrientation orientation() const override;
75
MirMirrorMode mirror_mode() const override;
77
bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
79
NativeDisplayBuffer* native_display_buffer() override;
82
SurfacelessEGLContext const egl_context;
83
detail::GLFramebufferObject const fbo;
84
geometry::Rectangle const area;
91
#endif /* MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_ */