blob: 26d68cdf989561bf25016bfae5f4eaa043c30d05 [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001#include "include/private/dvr/graphics/egl_image.h"
2
3#include <hardware/gralloc.h>
4
5#include <memory>
6
7#include <private/dvr/native_buffer.h>
8
9namespace android {
10namespace dvr {
11
12EGLImageKHR CreateEglImage(EGLDisplay dpy, int width, int height, int format,
13 int usage) {
14 auto image = std::make_shared<IonBuffer>(width, height, format, usage);
15
16 return eglCreateImageKHR(
17 dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID,
18 static_cast<ANativeWindowBuffer*>(new NativeBuffer(image)), nullptr);
19}
20
21} // namespace dvr
22} // namespace android