Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 1 | #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 | |
| 9 | namespace android { |
| 10 | namespace dvr { |
| 11 | |
| 12 | EGLImageKHR 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 |