michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim: set ts=8 sts=4 et sw=4 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "EGLImageHelpers.h" michael@0: #include "GLContext.h" michael@0: #include "GLLibraryEGL.h" michael@0: michael@0: namespace mozilla michael@0: { michael@0: namespace layers { michael@0: michael@0: using namespace gl; michael@0: michael@0: EGLImage michael@0: EGLImageCreateFromNativeBuffer(GLContext* aGL, void* aBuffer) michael@0: { michael@0: EGLint attrs[] = { michael@0: LOCAL_EGL_IMAGE_PRESERVED, LOCAL_EGL_TRUE, michael@0: LOCAL_EGL_NONE, LOCAL_EGL_NONE michael@0: }; michael@0: michael@0: return sEGLLibrary.fCreateImage(sEGLLibrary.Display(), michael@0: EGL_NO_CONTEXT, michael@0: LOCAL_EGL_NATIVE_BUFFER_ANDROID, michael@0: aBuffer, attrs); michael@0: } michael@0: michael@0: void michael@0: EGLImageDestroy(GLContext* aGL, EGLImage aImage) michael@0: { michael@0: sEGLLibrary.fDestroyImage(sEGLLibrary.Display(), aImage); michael@0: } michael@0: michael@0: } // namespace layers michael@0: } // namespace mozilla