Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglplatform.cpp
Show All 32 Lines | |||||
33 | 33 | | |||
34 | #include <iostream> | 34 | #include <iostream> | ||
35 | #include <iomanip> | 35 | #include <iomanip> | ||
36 | #include <ios> | 36 | #include <ios> | ||
37 | 37 | | |||
38 | namespace KWin | 38 | namespace KWin | ||
39 | { | 39 | { | ||
40 | 40 | | |||
41 | GLPlatform *GLPlatform::s_platform = 0; | 41 | GLPlatform *GLPlatform::s_platform = nullptr; | ||
42 | 42 | | |||
43 | static qint64 parseVersionString(const QByteArray &version) | 43 | static qint64 parseVersionString(const QByteArray &version) | ||
44 | { | 44 | { | ||
45 | // Skip any leading non digit | 45 | // Skip any leading non digit | ||
46 | int start = 0; | 46 | int start = 0; | ||
47 | while (start < version.length() && !QChar::fromLatin1(version[start]).isDigit()) | 47 | while (start < version.length() && !QChar::fromLatin1(version[start]).isDigit()) | ||
48 | start++; | 48 | start++; | ||
49 | 49 | | |||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Line(s) | 108 | { | |||
288 | 288 | | |||
289 | return UnknownRadeon; | 289 | return UnknownRadeon; | ||
290 | } | 290 | } | ||
291 | 291 | | |||
292 | static ChipClass detectNVidiaClass(const QString &chipset) | 292 | static ChipClass detectNVidiaClass(const QString &chipset) | ||
293 | { | 293 | { | ||
294 | QString name = extract(chipset, QStringLiteral("\\bNV[0-9,A-F]{2}\\b")); // NV followed by two hexadecimal digits | 294 | QString name = extract(chipset, QStringLiteral("\\bNV[0-9,A-F]{2}\\b")); // NV followed by two hexadecimal digits | ||
295 | if (!name.isEmpty()) { | 295 | if (!name.isEmpty()) { | ||
296 | const int id = chipset.midRef(2, -1).toInt(0, 16); // Strip the 'NV' from the id | 296 | const int id = chipset.midRef(2, -1).toInt(nullptr, 16); // Strip the 'NV' from the id | ||
297 | 297 | | |||
298 | switch(id & 0xf0) { | 298 | switch(id & 0xf0) { | ||
299 | case 0x00: | 299 | case 0x00: | ||
300 | case 0x10: | 300 | case 0x10: | ||
301 | return NV10; | 301 | return NV10; | ||
302 | 302 | | |||
303 | case 0x20: | 303 | case 0x20: | ||
304 | return NV20; | 304 | return NV20; | ||
▲ Show 20 Lines • Show All 937 Lines • Show Last 20 Lines |