30
30
#include "mir/graphics/buffer_ipc_packer.h"
31
31
#include "mir/options/option.h"
33
#include "mir/graphics/native_platform.h"
34
33
#include "mir/graphics/null_display_report.h"
35
34
#include <boost/throw_exception.hpp>
36
35
#include <stdexcept>
100
99
packer->pack_stride(buffer->stride());
102
void mga::AndroidPlatform::initialize(int /*data_items*/, int const* /*data*/, int /*fd_items*/, int const* /*fd*/)
103
107
std::shared_ptr<mg::InternalClient> mga::AndroidPlatform::create_internal_client()
105
109
return std::make_shared<mga::InternalClient>();
110
114
return std::make_shared<mga::AndroidPlatform>(display_report);
115
// TODO: mg::NativePlatform is not needed. Remove interface and just use mga::AndroidPlatform
116
// It may well turn out that NativePlatform == Platform - but this keeps them separate for now
117
struct NativeAndroidPlatform : mg::NativePlatform
119
NativeAndroidPlatform()
120
: underlying_android_platform(std::make_shared<mga::AndroidPlatform>(std::make_shared<mg::NullDisplayReport>()))
125
void initialize(int /*data_items*/, int const* /*data*/, int /*fd_items*/, int const* /*fd*/) override
129
std::shared_ptr<mg::GraphicBufferAllocator> create_buffer_allocator(
130
std::shared_ptr<mg::BufferInitializer> const& init) override
132
return underlying_android_platform->create_buffer_allocator(init);
135
std::shared_ptr<mg::PlatformIPCPackage> get_ipc_package() override
137
return underlying_android_platform->get_ipc_package();
140
std::shared_ptr<mg::InternalClient> create_internal_client() override
142
return underlying_android_platform->create_internal_client();
145
void fill_ipc_package(std::shared_ptr<mg::BufferIPCPacker> const& packer,
146
std::shared_ptr<mg::Buffer> const& buf) const override
148
underlying_android_platform->fill_ipc_package(packer, buf);
152
std::shared_ptr<mg::Platform> underlying_android_platform;
156
extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform()
158
return std::make_shared<::NativeAndroidPlatform>();
117
extern "C" std::shared_ptr<mg::NativePlatform> create_native_platform(std::shared_ptr<mg::DisplayReport> const& display_report)
119
return std::make_shared<mga::AndroidPlatform>(display_report);