20 #ifndef MIR_GRAPHICS_ANDROID_BUFFER_H_
21 #define MIR_GRAPHICS_ANDROID_BUFFER_H_
27 #include <hardware/gralloc.h>
30 #include <condition_variable>
33 #define GL_GLEXT_PROTOTYPES
34 #define EGL_EGLEXT_PROTOTYPES
36 #include <EGL/eglext.h>
50 Buffer(gralloc_module_t
const* hw_module,
51 std::shared_ptr<NativeBuffer>
const& buffer_handle,
52 std::shared_ptr<EGLExtensions>
const& extensions);
63 void write(
unsigned char const* pixels,
size_t size)
override;
64 void read(std::function<
void(
unsigned char const*)>
const&)
override;
69 gralloc_module_t
const* hw_module;
71 typedef std::pair<EGLDisplay, EGLContext> DispContextPair;
72 std::map<DispContextPair,EGLImageKHR> egl_image_map;
74 std::mutex
mutable content_lock;
75 std::shared_ptr<NativeBuffer> native_buffer;
76 std::shared_ptr<EGLExtensions> egl_extensions;
All things Mir.
Definition: atomic_callback.h:25
Definition: texture_source.h:29
NativeBufferBase * native_buffer_base() override
Definition: buffer.cpp:195
MirPixelFormat pixel_format() const override
Definition: buffer.cpp:68
void gl_bind_to_texture() override
Definition: buffer.cpp:74
std::shared_ptr< NativeBuffer > native_buffer_handle() const override
Definition: buffer.cpp:122
~Buffer()
Definition: buffer.cpp:46
void read(std::function< void(unsigned char const *)> const &) override
Definition: buffer.cpp:171
geometry::Stride stride() const override
Definition: buffer.cpp:61
Definition: buffer_basic.h:29
Definition: android_input_receiver.h:36
geometry::Size size() const override
Definition: buffer.cpp:55
Definition: dimensions.h:36
void write(unsigned char const *pixels, size_t size) override
Definition: buffer.cpp:138