/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2006-2007 Rivo Laks SPDX-FileCopyrightText: 2010, 2011 Martin Gräßlin SPDX-FileCopyrightText: 2011 Philipp Knechtges SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "libkwineffects/glutils.h" #include "libkwineffects/kwinconfig.h" // KWIN_HAVE_OPENGL #include "libkwineffects/kwinglutils_export.h" #include #include #include #include #include namespace KWin { // forward declarations class GLVertexBuffer; class KWINGLUTILS_EXPORT GLTexturePrivate : public QSharedData { public: GLTexturePrivate(); virtual ~GLTexturePrivate(); void updateMatrix(); GLuint m_texture; GLenum m_target; GLenum m_internalFormat; GLenum m_filter; GLenum m_wrapMode; QSize m_size; QSizeF m_scale; // to un-normalize GL_TEXTURE_2D QMatrix4x4 m_matrix[2]; QMatrix4x4 m_textureToBufferMatrix; TextureTransforms m_textureToBufferTransform; bool m_canUseMipmaps; bool m_markedDirty; bool m_filterChanged; bool m_wrapModeChanged; bool m_owning; int m_mipLevels; int m_unnormalizeActive; // 0 - no, otherwise refcount int m_normalizeActive; // 0 - no, otherwise refcount std::unique_ptr m_vbo; QSizeF m_cachedSize; QRectF m_cachedSource; static void initStatic(); static bool s_supportsFramebufferObjects; static bool s_supportsARGB32; static bool s_supportsUnpack; static bool s_supportsTextureStorage; static bool s_supportsTextureSwizzle; static bool s_supportsTextureFormatRG; static bool s_supportsTexture16Bit; static GLuint s_fbo; private: friend void KWin::cleanupGL(); static void cleanup(); Q_DISABLE_COPY(GLTexturePrivate) }; } // namespace