1fb9f6f13a
The main advantage of SPDX license identifiers over the traditional license headers is that it's more difficult to overlook inappropriate licenses for kwin, for example GPL 3. We also don't have to copy a lot of boilerplate text. In order to create this change, I ran licensedigger -r -c from the toplevel source directory.
33 lines
844 B
C++
33 lines
844 B
C++
/********************************************************************
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*********************************************************************/
|
|
|
|
#include "kwineglimagetexture.h"
|
|
|
|
using namespace KWin;
|
|
|
|
#include <QDebug>
|
|
#include <epoxy/egl.h>
|
|
|
|
EGLImageTexture::EGLImageTexture(EGLDisplay display, EGLImage image, int internalFormat, const QSize &size)
|
|
: GLTexture(internalFormat, size, 1, true)
|
|
, m_image(image)
|
|
, m_display(display)
|
|
{
|
|
if (m_image == EGL_NO_IMAGE_KHR) {
|
|
return;
|
|
}
|
|
|
|
bind();
|
|
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, m_image);
|
|
}
|
|
|
|
EGLImageTexture::~EGLImageTexture()
|
|
{
|
|
eglDestroyImageKHR(m_display, m_image);
|
|
}
|