2020-08-03 01:22:19 +03:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2011-07-18 19:55:39 +04:00
|
|
|
|
2020-08-03 01:22:19 +03:00
|
|
|
SPDX-FileCopyrightText: 2006-2007 Rivo Laks <rivolaks@hot.ee>
|
|
|
|
SPDX-FileCopyrightText: 2010, 2011 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2011 Philipp Knechtges <philipp-dev@knechtges.com>
|
2020-08-03 01:10:35 +03:00
|
|
|
|
2020-08-03 01:22:19 +03:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2011-07-18 19:55:39 +04:00
|
|
|
|
|
|
|
#ifndef KWIN_GLTEXTURE_P_H
|
|
|
|
#define KWIN_GLTEXTURE_P_H
|
|
|
|
|
|
|
|
#include "kwinconfig.h" // KWIN_HAVE_OPENGL
|
2017-10-01 10:54:12 +03:00
|
|
|
#include "kwinglutils.h"
|
2013-12-03 13:43:57 +04:00
|
|
|
#include <kwinglutils_export.h>
|
2011-07-18 19:55:39 +04:00
|
|
|
|
2013-02-26 12:00:51 +04:00
|
|
|
#include <QSize>
|
|
|
|
#include <QSharedData>
|
2013-02-26 11:02:27 +04:00
|
|
|
#include <QImage>
|
2017-09-08 23:30:18 +03:00
|
|
|
#include <QMatrix4x4>
|
|
|
|
#include <epoxy/gl.h>
|
2011-07-18 19:55:39 +04:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2013-02-26 11:02:27 +04:00
|
|
|
// forward declarations
|
|
|
|
class GLVertexBuffer;
|
2011-07-18 19:55:39 +04:00
|
|
|
|
2013-12-03 13:43:57 +04:00
|
|
|
class KWINGLUTILS_EXPORT GLTexturePrivate
|
2011-07-18 19:55:39 +04:00
|
|
|
: public QSharedData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GLTexturePrivate();
|
|
|
|
virtual ~GLTexturePrivate();
|
|
|
|
|
2012-01-07 15:12:29 +04:00
|
|
|
virtual void onDamage();
|
2011-07-18 19:55:39 +04:00
|
|
|
|
2012-09-27 23:22:05 +04:00
|
|
|
void updateMatrix();
|
|
|
|
|
2011-07-18 19:55:39 +04:00
|
|
|
GLuint m_texture;
|
|
|
|
GLenum m_target;
|
2014-12-13 16:28:33 +03:00
|
|
|
GLenum m_internalFormat;
|
2011-07-18 19:55:39 +04:00
|
|
|
GLenum m_filter;
|
2012-01-07 15:12:29 +04:00
|
|
|
GLenum m_wrapMode;
|
2011-07-18 19:55:39 +04:00
|
|
|
QSize m_size;
|
|
|
|
QSizeF m_scale; // to un-normalize GL_TEXTURE_2D
|
2012-09-27 23:22:05 +04:00
|
|
|
QMatrix4x4 m_matrix[2];
|
|
|
|
bool m_yInverted; // texture is y-inverted
|
2011-07-18 19:55:39 +04:00
|
|
|
bool m_canUseMipmaps;
|
2012-01-07 15:12:29 +04:00
|
|
|
bool m_markedDirty;
|
|
|
|
bool m_filterChanged;
|
|
|
|
bool m_wrapModeChanged;
|
2014-12-10 22:31:53 +03:00
|
|
|
bool m_immutable;
|
2019-09-25 16:27:40 +03:00
|
|
|
bool m_foreign;
|
2014-12-10 22:26:23 +03:00
|
|
|
int m_mipLevels;
|
2011-07-18 19:55:39 +04:00
|
|
|
|
|
|
|
int m_unnormalizeActive; // 0 - no, otherwise refcount
|
|
|
|
int m_normalizeActive; // 0 - no, otherwise refcount
|
|
|
|
GLVertexBuffer* m_vbo;
|
|
|
|
QSize m_cachedSize;
|
|
|
|
|
|
|
|
static void initStatic();
|
|
|
|
|
2014-11-22 18:24:26 +03:00
|
|
|
static bool s_supportsFramebufferObjects;
|
2014-11-22 18:44:14 +03:00
|
|
|
static bool s_supportsARGB32;
|
2014-11-22 18:17:51 +03:00
|
|
|
static bool s_supportsUnpack;
|
2014-12-10 22:31:53 +03:00
|
|
|
static bool s_supportsTextureStorage;
|
2014-12-13 16:30:59 +03:00
|
|
|
static bool s_supportsTextureSwizzle;
|
2015-02-18 11:06:37 +03:00
|
|
|
static bool s_supportsTextureFormatRG;
|
2014-11-22 18:24:26 +03:00
|
|
|
static GLuint s_fbo;
|
2013-09-05 23:10:13 +04:00
|
|
|
static uint s_textureObjectCounter;
|
2011-07-18 19:55:39 +04:00
|
|
|
private:
|
2014-04-10 20:04:54 +04:00
|
|
|
friend void KWin::cleanupGL();
|
|
|
|
static void cleanup();
|
2011-07-18 19:55:39 +04:00
|
|
|
Q_DISABLE_COPY(GLTexturePrivate)
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2011-08-31 20:16:21 +04:00
|
|
|
#endif
|