Mir
null_platform.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
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 2 or 3,
6  * as published by the Free Software Foundation.
7  *
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.
12  *
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/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_NULL_PLATFORM_H_
20 #define MIR_TEST_DOUBLES_NULL_PLATFORM_H_
21 
22 #include "mir/graphics/platform.h"
23 #include "mir/graphics/platform_ipc_package.h"
24 #include "mir/graphics/graphic_buffer_allocator.h"
27 
28 namespace mir
29 {
30 namespace test
31 {
32 namespace doubles
33 {
34 class NullPlatform : public graphics::Platform
35 {
36  public:
38  {
39  return nullptr;
40  }
41 
43  std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
44  std::shared_ptr<graphics::GLConfig> const&) override
45  {
46  return mir::make_module_ptr<NullDisplay>();
47  }
48 
49  graphics::NativeDisplayPlatform* native_display_platform() override
50  {
51  return nullptr;
52  }
53 
55  {
56  return mir::make_module_ptr<NullPlatformIpcOperations>();
57  }
58 
59  graphics::NativeRenderingPlatform* native_rendering_platform() override
60  {
61  return nullptr;
62  }
63 
64  std::vector<ExtensionDescription> extensions() const override
65  {
66  return {};
67  }
68 };
69 }
70 }
71 } // namespace mir
72 
73 #endif // MIR_TEST_DOUBLES_NULL_PLATFORM_
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: blob.h:26
std::vector< ExtensionDescription > extensions() const override
Definition: null_platform.h:64
mir::UniqueModulePtr< graphics::GraphicBufferAllocator > create_buffer_allocator() override
Definition: null_platform.h:37
graphics::NativeDisplayPlatform * native_display_platform() override
Definition: null_platform.h:49
std::unique_ptr< T, ModuleDeleter< T > > UniqueModulePtr
Use UniqueModulePtr to ensure that your loadable libray outlives instances created within it...
Definition: module_deleter.h:83
mir::UniqueModulePtr< graphics::Display > create_display(std::shared_ptr< graphics::DisplayConfigurationPolicy > const &, std::shared_ptr< graphics::GLConfig > const &) override
Definition: null_platform.h:42
Definition: null_platform.h:34
graphics::NativeRenderingPlatform * native_rendering_platform() override
Definition: null_platform.h:59
mir::UniqueModulePtr< graphics::PlatformIpcOperations > make_ipc_operations() const override
Definition: null_platform.h:54

Copyright © 2012-2018 Canonical Ltd.
Generated on Thu Mar 15 13:06:27 UTC 2018