From 00c95605198736f7685aac2f6d3f0f365fcd3a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 17 Nov 2016 13:28:34 +0100 Subject: [PATCH] [kwinglutils] Drop functions related to (nearest) power of two Summary: Not used anywhere in KWin and annotated that they should be removed. As we have an ABI break in 5.9 we can remove them now. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3398 --- libkwineffects/kwinglutils.cpp | 18 ------------------ libkwineffects/kwinglutils.h | 11 ----------- 2 files changed, 29 deletions(-) diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 1a5735a9bb..0442a0ee12 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -145,24 +145,6 @@ bool checkGLError(const char* txt) return hasError; } -// TODO: Drop for Plasma 6, no longer needed after OpenGL 2.0 -int nearestPowerOfTwo(int x) -{ - unsigned y = static_cast(x); - - // From Hank Warren's "Hacker's Delight", clp2() method. - // Works for up to 32-bit integers. - - y = y - 1; - y = y | (y >> 1); - y = y | (y >> 2); - y = y | (y >> 4); - y = y | (y >> 8); - y = y | (y >> 16); - - return static_cast(y + 1); -} - //**************************************** // GLShader //**************************************** diff --git a/libkwineffects/kwinglutils.h b/libkwineffects/kwinglutils.h index 27b2afb85f..fb45e3edcd 100644 --- a/libkwineffects/kwinglutils.h +++ b/libkwineffects/kwinglutils.h @@ -67,17 +67,6 @@ bool KWINGLUTILS_EXPORT hasGLExtension(const QByteArray &extension); // detect OpenGL error (add to various places in code to pinpoint the place) bool KWINGLUTILS_EXPORT checkGLError(const char* txt); -inline bool KWINGLUTILS_EXPORT isPowerOfTwo(int x) -{ - return ((x & (x - 1)) == 0); -} -/** - * @return power of two integer _greater or equal to_ x. - * E.g. nearestPowerOfTwo(513) = nearestPowerOfTwo(800) = 1024 - **/ -// TODO: Drop for Plasma 6, no longer needed after OpenGL 2.0 -int KWINGLUTILS_EXPORT nearestPowerOfTwo(int x); - QList KWINGLUTILS_EXPORT openGLExtensions(); class KWINGLUTILS_EXPORT GLShader