Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gbm_client_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by:
17  * Kevin DuBois <kevin.dubois@canonical.com>
18  */
19 
20 #ifndef MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_
21 #define MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_
22 
23 #include "../aging_buffer.h"
25 #include "mir/geometry/rectangle.h"
26 
27 #include <memory>
28 
29 namespace mir
30 {
31 namespace client
32 {
33 namespace gbm
34 {
35 
36 class DRMFDHandler;
37 
39 {
40 public:
41  GBMClientBuffer(std::shared_ptr<DRMFDHandler> const& drm_fd_handler,
42  std::shared_ptr<MirBufferPackage> const& buffer_package,
45 
46  virtual ~GBMClientBuffer() noexcept;
47 
48  std::shared_ptr<MemoryRegion> secure_for_cpu_write();
49  geometry::Size size() const;
50  geometry::Stride stride() const;
52  std::shared_ptr<MirNativeBuffer> native_buffer_handle() const;
53 
54  GBMClientBuffer(const GBMClientBuffer&) = delete;
55  GBMClientBuffer& operator=(const GBMClientBuffer&) = delete;
56 private:
57  const std::shared_ptr<DRMFDHandler> drm_fd_handler;
58  const std::shared_ptr<MirBufferPackage> creation_package;
59  const geometry::Rectangle rect;
60  const geometry::PixelFormat buffer_pf;
61 };
62 
63 }
64 }
65 }
66 #endif /* MIR_CLIENT_GBM_GBM_CLIENT_BUFFER_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013