Mir
mir_native_window.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: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_ANDROID_MIR_NATIVE_WINDOW_H_
20 #define MIR_GRAPHICS_ANDROID_MIR_NATIVE_WINDOW_H_
21 
22 #include <system/window.h>
23 #include <cstdarg>
24 #include <memory>
25 #include <vector>
26 
27 namespace mir
28 {
29 namespace graphics
30 {
31 namespace android
32 {
33 class AndroidDriverInterpreter;
34 class SyncFileOps;
35 class NativeWindowReport;
36 
37 class MirNativeWindow : public ANativeWindow
38 {
39 public:
40  explicit MirNativeWindow(
41  std::shared_ptr<AndroidDriverInterpreter> const& interpreter,
42  std::shared_ptr<NativeWindowReport> const& report);
43 
44  int query(int key, int* value) const;
45  int perform(int key, va_list args );
46  int dequeueBuffer(struct ANativeWindowBuffer** buffer, int* fence);
47  int dequeueBufferAndWait(struct ANativeWindowBuffer** buffer);
48  int queueBuffer(struct ANativeWindowBuffer* buffer, int fence);
49  int queueBufferDeprecated(struct ANativeWindowBuffer* buffer);
50  int cancelBuffer(struct ANativeWindowBuffer* buffer, int fence);
51  int cancelBufferDeprecated(struct ANativeWindowBuffer* buffer);
52  int setSwapInterval(int interval);
53 private:
54  std::shared_ptr<AndroidDriverInterpreter> const driver_interpreter;
55  std::shared_ptr<NativeWindowReport> const report;
56  std::shared_ptr<SyncFileOps> const sync_ops;
57  std::vector<struct ANativeWindowBuffer*> cancelled_buffers;
58 };
59 
60 }
61 }
62 }
63 
64 #endif /* MIR_GRAPHICS_ANDROID_MIR_NATIVE_WINDOW_H_ */
All things Mir.
Definition: atomic_callback.h:25
int queueBufferDeprecated(struct ANativeWindowBuffer *buffer)
Definition: mir_native_window.cpp:232
int query(int key, int *value) const
Definition: mir_native_window.cpp:274
int cancelBuffer(struct ANativeWindowBuffer *buffer, int fence)
Definition: mir_native_window.cpp:245
int queueBuffer(struct ANativeWindowBuffer *buffer, int fence)
Definition: mir_native_window.cpp:219
int cancelBufferDeprecated(struct ANativeWindowBuffer *buffer)
Definition: mir_native_window.cpp:261
Definition: mir_native_window.h:37
int dequeueBufferAndWait(struct ANativeWindowBuffer **buffer)
Definition: mir_native_window.cpp:196
MirNativeWindow(std::shared_ptr< AndroidDriverInterpreter > const &interpreter, std::shared_ptr< NativeWindowReport > const &report)
Definition: mir_native_window.cpp:131
int perform(int key, va_list args)
Definition: mir_native_window.cpp:287
Definition: android_input_receiver.h:36
int dequeueBuffer(struct ANativeWindowBuffer **buffer, int *fence)
Definition: mir_native_window.cpp:169
int setSwapInterval(int interval)
Definition: mir_native_window.cpp:156

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016