9c1060fa1d91da21f41a3b46cac27afe09b0365d
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / graphics / gl_renderer_server.h
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
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, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #ifndef ANBOX_GRAPHICS_GL_RENDERER_SERVER_H_
19 #define ANBOX_GRAPHICS_GL_RENDERER_SERVER_H_
20
21 #include <memory>
22 #include <string>
23
24 class Renderer;
25
26 namespace anbox {
27 namespace input {
28 class Manager;
29 }  // namespace input
30 namespace wm {
31 class Manager;
32 }  // namespace wm
33 namespace graphics {
34 class LayerComposer;
35 class GLRendererServer {
36  public:
37   struct Config {
38     enum class Driver {
39       // Use the GL driver provided by the host operating system
40       Host,
41
42       // Use a builtin software based GL driver implementation without any support
43       // for hardware acceleration.
44       Software,
45     };
46     Driver driver;
47     bool single_window;
48   };
49
50   GLRendererServer(const Config &config, const std::shared_ptr<wm::Manager> &wm);
51   ~GLRendererServer();
52
53   std::shared_ptr<Renderer> renderer() const { return renderer_; }
54
55  private:
56   std::shared_ptr<Renderer> renderer_;
57   std::shared_ptr<wm::Manager> wm_;
58   std::shared_ptr<LayerComposer> composer_;
59 };
60
61 }  // namespace graphics
62 }  // namespace anbox
63
64 #endif