2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "system_egl.h"
15 #include <EGL/eglext.h>
16 #include <drm_fourcc.h>
18 #include "system_gl.h"
23 static const int MAX_NUM_PLANES
{3};
30 uint64_t modifier
{DRM_FORMAT_MOD_INVALID
};
40 std::array
<EglPlane
, MAX_NUM_PLANES
> planes
;
43 explicit CEGLImage(EGLDisplay display
);
45 CEGLImage(CEGLImage
const& other
) = delete;
46 CEGLImage
& operator=(CEGLImage
const& other
) = delete;
48 bool CreateImage(EglAttrs imageAttrs
);
49 void UploadImage(GLenum textureTarget
);
52 #if defined(EGL_EXT_image_dma_buf_import_modifiers)
53 bool SupportsFormatAndModifier(uint32_t format
, uint64_t modifier
);
56 bool SupportsFormat(uint32_t format
);
60 EGLDisplay m_display
{nullptr};
61 EGLImageKHR m_image
{nullptr};
63 PFNEGLCREATEIMAGEKHRPROC m_eglCreateImageKHR
{nullptr};
64 PFNEGLDESTROYIMAGEKHRPROC m_eglDestroyImageKHR
{nullptr};
65 PFNGLEGLIMAGETARGETTEXTURE2DOESPROC m_glEGLImageTargetTexture2DOES
{nullptr};