~mterry/mir/session-for-surface

« back to all changes in this revision

Viewing changes to src/server/graphics/android/android_display.h

  • Committer: Michael Terry
  • Date: 2013-07-18 17:24:31 UTC
  • mfrom: (832.1.32 trunk)
  • Revision ID: michael.terry@canonical.com-20130718172431-xtdoug2fp31asy06
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#define MIR_GRAPHICS_ANDROID_ANDROID_DISPLAY_H_
21
21
 
22
22
#include "mir/graphics/display.h"
23
 
#include "mir/graphics/display_buffer.h"
 
23
#include "mir/graphics/egl_resources.h"
24
24
#include "android_framebuffer_window.h"
25
25
 
26
26
#include <EGL/egl.h>
28
28
 
29
29
namespace mir
30
30
{
31
 
namespace geometry
32
 
{
33
 
class Rectangle;
34
 
}
35
31
namespace graphics
36
32
{
 
33
 
37
34
class DisplayReport;
 
35
class DisplayBuffer;
 
36
 
38
37
namespace android
39
38
{
40
39
 
41
 
class AndroidDisplay : public virtual Display, public virtual DisplayBuffer
 
40
class AndroidDisplayBufferFactory;
 
41
 
 
42
class AndroidDisplay : public Display
42
43
{
43
44
public:
44
45
    explicit AndroidDisplay(std::shared_ptr<AndroidFramebufferWindowQuery> const&,
 
46
                            std::shared_ptr<AndroidDisplayBufferFactory> const&,
45
47
                            std::shared_ptr<DisplayReport> const&);
46
48
    ~AndroidDisplay();
47
49
 
48
50
    geometry::Rectangle view_area() const;
49
 
    void post_update();
50
51
    void for_each_display_buffer(std::function<void(DisplayBuffer&)> const& f);
51
52
 
52
53
    std::shared_ptr<DisplayConfiguration> configuration();
64
65
    void pause();
65
66
    void resume();
66
67
 
67
 
    void make_current();
68
 
    void release_current();
69
 
 
70
68
    std::weak_ptr<Cursor> the_cursor();
71
69
    std::unique_ptr<graphics::GLContext> create_gl_context();
72
70
 
73
 
protected:
 
71
private:
 
72
    std::shared_ptr<AndroidFramebufferWindowQuery> const native_window;
74
73
    EGLDisplay egl_display;
75
 
    EGLSurface egl_surface;
76
 
private:
77
 
    std::shared_ptr<AndroidFramebufferWindowQuery> native_window;
78
74
    EGLConfig egl_config;
79
 
    EGLContext egl_context;
80
 
    EGLContext egl_context_shared;
81
 
    EGLSurface egl_surface_dummy;
 
75
    EGLContextStore const egl_context_shared;
 
76
    EGLSurfaceStore const egl_surface_dummy;
 
77
    std::unique_ptr<DisplayBuffer> display_buffer;
82
78
};
83
79
 
84
80
}