~ci-train-bot/unity-system-compositor/unity-system-compositor-ubuntu-zesty-2649

« back to all changes in this revision

Viewing changes to spinner/miregl.cpp

  • Committer: Tarmac
  • Author(s): Cemil Azizoglu
  • Date: 2017-01-18 21:44:04 UTC
  • mfrom: (303.1.1 usc)
  • Revision ID: tarmac-20170118214404-wxnbct6aayhc608d
Address more deprecations that landed on lp:mir since yesterday.

Approved by Alexandros Frantzis, mir-ci-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
public:
26
26
    MirEglApp(MirConnection* const connection, MirPixelFormat pixel_format);
27
27
 
28
 
    EGLSurface create_surface(MirSurface* surface);
 
28
    EGLSurface create_surface(MirWindow* surface);
29
29
 
30
30
    void release_current();
31
31
 
62
62
{
63
63
MirWindow* create_surface(MirConnection* const connection, MirWindowParameters const& surfaceparm)
64
64
{
65
 
    auto const spec = mir_connection_create_spec_for_normal_surface(
 
65
    auto const spec = mir_create_normal_window_spec(
66
66
        connection,
67
67
        surfaceparm.width,
68
 
        surfaceparm.height,
69
 
        surfaceparm.pixel_format);
70
 
 
71
 
    mir_surface_spec_set_name(spec, surfaceparm.name);
72
 
    mir_surface_spec_set_buffer_usage(spec, surfaceparm.buffer_usage);
73
 
    mir_surface_spec_set_fullscreen_on_output(spec, surfaceparm.output_id);
74
 
 
75
 
    auto const surface = mir_surface_create_sync(spec);
76
 
    mir_surface_spec_release(spec);
77
 
 
78
 
    if (!mir_surface_is_valid(surface))
79
 
        throw std::runtime_error(std::string("Can't create a surface ") + mir_surface_get_error_message(surface));
 
68
        surfaceparm.height);
 
69
    mir_window_spec_set_pixel_format(spec, surfaceparm.pixel_format);
 
70
 
 
71
    mir_window_spec_set_name(spec, surfaceparm.name);
 
72
    mir_window_spec_set_buffer_usage(spec, surfaceparm.buffer_usage);
 
73
    mir_window_spec_set_fullscreen_on_output(spec, surfaceparm.output_id);
 
74
 
 
75
    auto const surface = mir_create_window_sync(spec);
 
76
    mir_window_spec_release(spec);
 
77
 
 
78
    if (!mir_window_is_valid(surface))
 
79
        throw std::runtime_error(std::string("Can't create a surface ") + mir_window_get_error_message(surface));
80
80
 
81
81
    if (surfaceparm.output_id != mir_display_output_id_invalid)
82
 
        mir_surface_set_state(surface, mir_surface_state_fullscreen);
 
82
        mir_window_set_state(surface, mir_window_state_fullscreen);
83
83
 
84
84
    return surface;
85
85
}
98
98
MirEglSurface::~MirEglSurface()
99
99
{
100
100
    mir_egl_app->destroy_surface(eglsurface);
101
 
    mir_surface_release_sync(surface);
 
101
    mir_window_release_sync(surface);
102
102
}
103
103
 
104
104
void MirEglSurface::egl_make_current()
181
181
    make_current(dummy_surface);
182
182
}
183
183
 
184
 
EGLSurface MirEglApp::create_surface(MirSurface* surface)
 
184
EGLSurface MirEglApp::create_surface(MirWindow* surface)
185
185
{
186
186
    auto const eglsurface = eglCreateWindowSurface(
187
187
        egldisplay,
188
188
        eglconfig,
189
 
        (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_surface_get_buffer_stream(surface)), NULL);
 
189
        (EGLNativeWindowType) mir_buffer_stream_get_egl_native_window(mir_window_get_buffer_stream(surface)), NULL);
190
190
 
191
191
    if (eglsurface == EGL_NO_SURFACE)
192
192
        throw std::runtime_error("eglCreateWindowSurface failed");