Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ui/ozone/platform/drm/mojo/drm_ipc_init_helper.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/application/application_connection.h"
6 #include "mojo/public/cpp/application/interface_factory_impl.h"
7 #include "mojo/services/ozone_drm_gpu/public/interfaces/ozone_drm_gpu.mojom.h"
8 #include "mojo/services/ozone_drm_host/public/interfaces/ozone_drm_host.mojom.h"
9 #include "ui/ozone/platform/drm/mojo/drm_gpu_delegate.h"
10 #include "ui/ozone/platform/drm/mojo/drm_gpu_impl.h"
11 #include "ui/ozone/platform/drm/mojo/drm_host_delegate.h"
12 #include "ui/ozone/platform/drm/mojo/drm_host_impl.h"
13 #include "ui/ozone/public/ipc_init_helper_mojo.h"
14
15 namespace ui {
16
17 class InterfaceFactoryDrmHost
18 : public mojo::InterfaceFactory<mojo::OzoneDrmHost> {
19 // mojo::InterfaceFactory implementation.
20 void Create(mojo::ApplicationConnection* connection,
21 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) override;
22 };
23
24 class InterfaceFactoryDrmGpu
25 : public mojo::InterfaceFactory<mojo::OzoneDrmGpu> {
26 // mojo::InterfaceFactory<OzoneDrmGpu> implementation.
27 void Create(mojo::ApplicationConnection* connection,
28 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) override;
29 };
30
31 void InterfaceFactoryDrmHost::Create(
32 mojo::ApplicationConnection* connection,
33 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) {
34 new MojoDrmHostImpl(request.Pass());
35 }
36
37 void InterfaceFactoryDrmGpu::Create(
38 mojo::ApplicationConnection* connection,
39 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) {
40 new MojoDrmGpuImpl(request.Pass());
41 }
42
43 class DrmIpcInitHelperMojo : public IpcInitHelperMojo {
44 public:
45 DrmIpcInitHelperMojo();
46 ~DrmIpcInitHelperMojo();
47
48 void HostInitialize(mojo::ApplicationImpl* application) override;
49 bool HostConfigureIncomingConnection(
50 mojo::ApplicationConnection* connection) override;
51
52 void GpuInitialize(mojo::ApplicationImpl* application) override;
53 bool GpuConfigureIncomingConnection(
54 mojo::ApplicationConnection* connection) override;
55
56 private:
57 mojo::OzoneDrmHostPtr ozone_drm_host_;
58 mojo::OzoneDrmGpuPtr ozone_drm_gpu_;
59 };
60
61 DrmIpcInitHelperMojo::DrmIpcInitHelperMojo() {}
62
63 DrmIpcInitHelperMojo::~DrmIpcInitHelperMojo() {}
64
65 void DrmIpcInitHelperMojo::HostInitialize(mojo::ApplicationImpl* application) {
66 application->ConnectToService("mojo:native_viewport_service",
67 &ozone_drm_gpu_);
68 new MojoDrmHostDelegate(ozone_drm_gpu_.get());
69 }
70
71 void DrmIpcInitHelperMojo::GpuInitialize(mojo::ApplicationImpl* application) {
72 application->ConnectToService("mojo:native_viewport_service",
73 &ozone_drm_host_);
74 new MojoDrmGpuDelegate(ozone_drm_host_.get());
75 }
76
77 bool DrmIpcInitHelperMojo::HostConfigureIncomingConnection(
78 mojo::ApplicationConnection* connection) {
79 connection->AddService<mojo::OzoneDrmHost>(new InterfaceFactoryDrmHost());
80 return true;
81 }
82
83 bool DrmIpcInitHelperMojo::GpuConfigureIncomingConnection(
84 mojo::ApplicationConnection* connection) {
85 connection->AddService<mojo::OzoneDrmGpu>(new InterfaceFactoryDrmGpu());
86 return true;
87 }
88
89 // static
90 IpcInitHelperOzone* IpcInitHelperOzone::Create() {
91 return new DrmIpcInitHelperMojo();
92 }
93
94 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/mojo/drm_host_impl.cc ('k') | ui/ozone/platform/drm/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698