~ubuntu-branches/ubuntu/wily/mir/wily-proposed

« back to all changes in this revision

Viewing changes to src/server/graphics/nested/nested_output.h

  • Committer: Package Import Robot
  • Author(s): CI Train Bot
  • Date: 2015-05-12 13:12:55 UTC
  • mto: This revision was merged to the branch mainline in revision 96.
  • Revision ID: package-import@ubuntu.com-20150512131255-y7z12i8n4pbvo70x
Tags: upstream-0.13.0+15.10.20150512
Import upstream version 0.13.0+15.10.20150512

Show diffs side-by-side

added added

removed removed

Lines of Context:
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: Alan Griffiths <alan@octopull.co.uk>
17
 
 */
18
 
 
19
 
#ifndef MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_
20
 
#define MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_
21
 
 
22
 
#include "nested_display.h"
23
 
 
24
 
namespace mir
25
 
{
26
 
namespace graphics
27
 
{
28
 
namespace nested
29
 
{
30
 
class HostSurface;
31
 
 
32
 
namespace detail
33
 
{
34
 
 
35
 
class NestedOutput : public DisplayBuffer
36
 
{
37
 
public:
38
 
    NestedOutput(
39
 
        EGLDisplayHandle const& egl_display,
40
 
        std::shared_ptr<HostSurface> const& host_surface,
41
 
        geometry::Rectangle const& area,
42
 
        std::shared_ptr<input::InputDispatcher> const& input_dispatcher,
43
 
        MirPixelFormat preferred_format);
44
 
 
45
 
    ~NestedOutput() noexcept;
46
 
 
47
 
    geometry::Rectangle view_area() const override;
48
 
    void make_current() override;
49
 
    void release_current() override;
50
 
    void gl_swap_buffers() override;
51
 
    void flip() override;
52
 
    MirOrientation orientation() const override;
53
 
    bool uses_alpha() const override;
54
 
 
55
 
    bool post_renderables_if_optimizable(RenderableList const& renderlist) override;
56
 
 
57
 
    NestedOutput(NestedOutput const&) = delete;
58
 
    NestedOutput operator=(NestedOutput const&) = delete;
59
 
private:
60
 
    bool const uses_alpha_;
61
 
    EGLDisplayHandle const& egl_display;
62
 
    std::shared_ptr<HostSurface> const host_surface;
63
 
    EGLConfig const egl_config;
64
 
    EGLContextStore const egl_context;
65
 
    geometry::Rectangle const area;
66
 
    std::shared_ptr<input::InputDispatcher> const dispatcher;
67
 
    EGLSurfaceHandle const egl_surface;
68
 
 
69
 
    static void event_thunk(MirSurface* surface, MirEvent const* event, void* context);
70
 
    void mir_event(MirEvent const& event);
71
 
};
72
 
}
73
 
}
74
 
}
75
 
}
76
 
 
77
 
#endif /* MIR_GRAPHICS_NESTED_DETAIL_NESTED_OUTPUT_H_ */