Commit 349618c2 authored by Martin Flöser's avatar Martin Flöser

Move bitCount from utils to GlxBackend

Only used in GlxBackend.

Differential Revision: https://phabricator.kde.org/D6784
parent da036098
......@@ -509,6 +509,22 @@ int GlxBackend::visualDepth(xcb_visualid_t visual) const
return m_visualDepthHash.value(visual);
}
static inline int bitCount(uint32_t mask)
{
#if defined(__GNUC__)
return __builtin_popcount(mask);
#else
int count = 0;
while (mask) {
count += (mask & 1);
mask >>= 1;
}
return count;
#endif
}
FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
{
auto it = m_fbconfigHash.constFind(visual);
......
......@@ -196,23 +196,6 @@ Qt::KeyboardModifiers KWIN_EXPORT x11ToQtKeyboardModifiers(int state);
void checkNonExistentClients();
static inline int bitCount(uint32_t mask)
{
#if defined(__GNUC__)
return __builtin_popcount(mask);
#else
int count = 0;
while (mask) {
count += (mask & 1);
mask >>= 1;
}
return count;
#endif
}
/**
* Separate the concept of an unet QPoint and 0,0
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment