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 
36 class MirNativeWindow : public ANativeWindow
37 {
38 public:
39  explicit MirNativeWindow(std::shared_ptr<AndroidDriverInterpreter> const& interpreter);
40 
41  int query(int key, int* value) const;
42  int perform(int key, va_list args );
43  int dequeueBuffer(struct ANativeWindowBuffer** buffer, int* fence);
44  int dequeueBufferAndWait(struct ANativeWindowBuffer** buffer);
45  int queueBuffer(struct ANativeWindowBuffer* buffer, int fence);
46  int cancelBuffer(struct ANativeWindowBuffer* buffer, int fence);
47  int setSwapInterval(int interval);
48 private:
49  std::shared_ptr<AndroidDriverInterpreter> const driver_interpreter;
50  std::shared_ptr<SyncFileOps> const sync_ops;
51  std::vector<struct ANativeWindowBuffer*> cancelled_buffers;
52 };
53 
54 }
55 }
56 }
57 
58 #endif /* MIR_GRAPHICS_ANDROID_MIR_NATIVE_WINDOW_H_ */
All things Mir.
Definition: buffer_stream.h:37
int query(int key, int *value) const
Definition: mir_native_window.cpp:242
int cancelBuffer(struct ANativeWindowBuffer *buffer, int fence)
Definition: mir_native_window.cpp:227
int queueBuffer(struct ANativeWindowBuffer *buffer, int fence)
Definition: mir_native_window.cpp:215
Definition: mir_native_window.h:36
int dequeueBufferAndWait(struct ANativeWindowBuffer **buffer)
Definition: mir_native_window.cpp:193
int perform(int key, va_list args)
Definition: mir_native_window.cpp:254
MirNativeWindow(std::shared_ptr< AndroidDriverInterpreter > const &interpreter)
Definition: mir_native_window.cpp:128
Definition: android_input_receiver.h:32
int dequeueBuffer(struct ANativeWindowBuffer **buffer, int *fence)
Definition: mir_native_window.cpp:168
int setSwapInterval(int interval)
Definition: mir_native_window.cpp:149

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015