2
* Copyright © 2013 Canonical Ltd.
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.
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.
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/>.
16
* Authored by: Kevin DuBois <kevin.dubois@canonical.com>
19
#include "android_display_allocator.h"
20
#include "android_display.h"
21
#include "android_framebuffer_window.h"
22
#include "gpu_android_display_buffer_factory.h"
23
#include "hwc_android_display_buffer_factory.h"
24
#include "hwc_device.h"
25
#include "fb_device.h"
27
namespace mg=mir::graphics;
28
namespace mga=mir::graphics::android;
30
std::shared_ptr<mga::AndroidDisplay> mga::AndroidDisplayAllocator::create_gpu_display(
31
std::shared_ptr<ANativeWindow> const& native_window,
32
std::shared_ptr<DisplaySupportProvider> const& display_provider,
33
std::shared_ptr<DisplayReport> const& display_report) const
35
auto window = std::make_shared<mga::AndroidFramebufferWindow>(native_window);
36
auto db_factory = std::make_shared<mga::GPUAndroidDisplayBufferFactory>();
37
return std::make_shared<AndroidDisplay>(window, db_factory, display_provider, display_report);
40
std::shared_ptr<mga::AndroidDisplay> mga::AndroidDisplayAllocator::create_hwc_display(
41
std::shared_ptr<HWCDevice> const& hwc_device,
42
std::shared_ptr<ANativeWindow> const& anw,
43
std::shared_ptr<DisplayReport> const& display_report) const
45
auto window = std::make_shared<mga::AndroidFramebufferWindow>(anw);
46
auto db_factory = std::make_shared<mga::HWCAndroidDisplayBufferFactory>(hwc_device);
47
return std::make_shared<AndroidDisplay>(window, db_factory, hwc_device, display_report);