20 #ifndef MIR_GRAPHICS_ANDROID_BUFFER_H_ 21 #define MIR_GRAPHICS_ANDROID_BUFFER_H_ 26 #include <hardware/gralloc.h> 29 #include <condition_variable> 32 #ifndef GL_GLEXT_PROTOTYPES 33 #define GL_GLEXT_PROTOTYPES 35 #define EGL_EGLEXT_PROTOTYPES 37 #include <EGL/eglext.h> 51 Buffer(gralloc_module_t
const* hw_module,
52 std::shared_ptr<NativeBuffer>
const& buffer_handle,
53 std::shared_ptr<EGLExtensions>
const& extensions);
68 void write(
unsigned char const* pixels,
size_t size)
override;
69 void read(std::function<
void(
unsigned char const*)>
const&)
override;
74 void bind(std::unique_lock<std::mutex>
const&);
76 gralloc_module_t
const* hw_module;
78 typedef std::pair<EGLDisplay, EGLContext> DispContextPair;
79 std::map<DispContextPair,EGLImageKHR> egl_image_map;
81 std::mutex
mutable content_lock;
82 std::shared_ptr<NativeBuffer> native_buffer;
83 std::shared_ptr<EGLExtensions> egl_extensions;
All things Mir.
Definition: atomic_callback.h:25
Definition: texture_source.h:31
void read(std::function< void(unsigned char const *)> const &) override
Definition: buffer.cpp:179
MirPixelFormat pixel_format() const override
Definition: buffer.cpp:68
~Buffer()
Definition: buffer.cpp:46
NativeBufferBase * native_buffer_base() override
Definition: buffer.cpp:203
geometry::Size size() const override
Definition: buffer.cpp:55
std::shared_ptr< NativeBuffer > native_buffer_handle() const override
Definition: buffer.cpp:130
geometry::Stride stride() const override
Definition: buffer.cpp:61
void secure_for_render() override
Definition: buffer.cpp:208
void write(unsigned char const *pixels, size_t size) override
Definition: buffer.cpp:146
void gl_bind_to_texture() override
Definition: buffer.cpp:74
Definition: buffer_basic.h:29
Definition: android_input_receiver.h:36
Definition: dimensions.h:36
void bind() override
Definition: buffer.cpp:81