Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
src
server
graphics
offscreen
display_buffer.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2013 Canonical Ltd.
3
*
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.
7
*
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.
12
*
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/>.
15
*
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17
*/
18
19
#ifndef MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
20
#define MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_
21
22
#include "
mir/graphics/surfaceless_egl_context.h
"
23
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
"
28
29
#include <EGL/egl.h>
30
31
namespace
mir
32
{
33
namespace
graphics
34
{
35
namespace
offscreen
36
{
37
38
namespace
detail
39
{
40
41
class
GLFramebufferObject
42
{
43
public
:
44
GLFramebufferObject
(
geometry::Size
const
& size);
45
~GLFramebufferObject
();
46
void
bind
()
const
;
47
void
unbind
()
const
;
48
49
private
:
50
geometry::Size
const
size;
51
int
old_fbo;
52
int
old_viewport[4];
53
unsigned
int
color_renderbuffer;
54
unsigned
int
depth_renderbuffer;
55
unsigned
int
fbo;
56
};
57
58
}
59
60
class
DisplayBuffer
:
public
graphics::DisplayBuffer
,
61
public
graphics::NativeDisplayBuffer
,
62
public
renderer::gl::RenderTarget
63
{
64
public
:
65
DisplayBuffer
(
SurfacelessEGLContext
egl_context,
66
geometry::Rectangle
const
& area);
67
68
geometry::Rectangle
view_area()
const override
;
69
void
make_current
()
override
;
70
void
release_current()
override
;
71
void
swap_buffers()
override
;
72
73
MirOrientation
orientation()
const override
;
74
75
bool
post_renderables_if_optimizable(
RenderableList
const
& renderlist)
override
;
76
77
NativeDisplayBuffer
* native_display_buffer()
override
;
78
79
private
:
80
SurfacelessEGLContext
const
egl_context;
81
detail::GLFramebufferObject
const
fbo;
82
geometry::Rectangle
const
area;
83
};
84
85
}
86
}
87
}
88
89
#endif
/* MIR_GRAPHICS_OFFSCREEN_DISPLAY_BUFFER_H_ */
mir::geometry::Size
Definition:
size.h:30
surfaceless_egl_context.h
mir
All things Mir.
Definition:
atomic_callback.h:25
make_current
bool make_current(mrg::RenderTarget *render_target)
Definition:
server_example_adorning_compositor.cpp:39
mir::graphics::DisplayBuffer
Interface to an output framebuffer.
Definition:
display_buffer.h:47
mir::graphics::offscreen::detail::GLFramebufferObject::GLFramebufferObject
GLFramebufferObject(geometry::Size const &size)
mir::graphics::offscreen::detail::GLFramebufferObject::~GLFramebufferObject
~GLFramebufferObject()
display_buffer.h
mir::graphics::SurfacelessEGLContext
Definition:
surfaceless_egl_context.h:32
mir::graphics::offscreen::detail::GLFramebufferObject
Definition:
display_buffer.h:41
MirOrientation
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition:
common.h:164
mir::graphics::offscreen::detail::GLFramebufferObject::bind
void bind() const
rectangle.h
render_target.h
mir::graphics::NativeDisplayBuffer
Definition:
display_buffer.h:35
mir::graphics::offscreen::DisplayBuffer
Definition:
display_buffer.h:60
size.h
mir::renderer::gl::RenderTarget
Definition:
render_target.h:29
mir::graphics::offscreen::detail::GLFramebufferObject::unbind
void unbind() const
mir::graphics::RenderableList
std::vector< std::shared_ptr< Renderable > > RenderableList
Definition:
renderable.h:79
mir::geometry::Rectangle
Definition:
rectangle.h:33
Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016