~ken-vandine/platform-api/content_hub_apps

« back to all changes in this revision

Viewing changes to src/ubuntu/mirserver/window_mirserver.cpp

  • Committer: Tarmac
  • Author(s): Gerry Boland
  • Date: 2013-08-20 11:42:36 UTC
  • mfrom: (119.2.1 platform-api)
  • Revision ID: tarmac-20130820114236-yoyw3cg230ml8upp
Remove workaround to obtain Mir internal surface, as Mir added as_internal_surface method in revno 964.

Approved by Michał Sawicz, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
namespace uams = ubuntu::application::mir::server;
33
33
namespace uaum = ubuntu::application::ui::mir;
34
34
 
 
35
namespace mf = mir::frontend;
35
36
namespace mg = mir::graphics;
36
37
namespace msh = mir::shell;
37
38
namespace mircv = mir::input::receiver;
39
40
namespace
40
41
{
41
42
 
42
 
// TODO this ought to be provided by the library
43
 
class ForwardingInternalSurface : public mg::InternalSurface
44
 
{
45
 
public:
46
 
    ForwardingInternalSurface(std::shared_ptr<msh::Surface> const& surface) : surface(surface) {}
47
 
 
48
 
private:
49
 
    virtual std::shared_ptr<mg::Buffer> advance_client_buffer() { return surface->advance_client_buffer(); }
50
 
    virtual mir::geometry::Size size() const { return surface->size(); }
51
 
    virtual MirPixelFormat pixel_format() const { return static_cast<MirPixelFormat>(surface->pixel_format()); }
52
 
 
53
 
    std::shared_ptr<msh::Surface> const surface;
54
 
};
55
 
 
56
43
static void ua_ui_window_handle_event(UAUiWindowInputEventCb cb, void* ctx, MirEvent* mir_event)
57
44
{
58
45
    Event ubuntu_ev;
92
79
 
93
80
EGLNativeWindowType uams::Window::get_native_type()
94
81
{
95
 
    auto mir_surface = std::make_shared<ForwardingInternalSurface>(surface);
 
82
    auto mir_surface = mf::as_internal_surface(surface);
96
83
    return internal_client->egl_native_window(mir_surface);
97
84
}