summaryrefslogtreecommitdiff
path: root/vcl/inc/opengl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-27 15:46:27 +0100
committerJan Holesovsky <kendy@collabora.com>2014-12-02 15:47:37 +0100
commitea4394c57d43bf3eea797faccb52a89370b47300 (patch)
tree69a492fc54808b047fdfcda1cf84e69df4392bde /vcl/inc/opengl
parent914915ac6d23373500ee584edeaaabc00fdd6aea (diff)
port blacklist from mozilla code to LibreOffice, part2
Change-Id: Ia5810aa5f9e1e169b5f0217f6f176a253dc1439d
Diffstat (limited to 'vcl/inc/opengl')
-rw-r--r--vcl/inc/opengl/win/WinDeviceInfo.hxx66
1 files changed, 65 insertions, 1 deletions
diff --git a/vcl/inc/opengl/win/WinDeviceInfo.hxx b/vcl/inc/opengl/win/WinDeviceInfo.hxx
index db916870f704..2c478ee707ef 100644
--- a/vcl/inc/opengl/win/WinDeviceInfo.hxx
+++ b/vcl/inc/opengl/win/WinDeviceInfo.hxx
@@ -73,6 +73,67 @@ enum DeviceVendor {
DeviceVendorMax
};
+struct DriverInfo
+{
+ typedef std::vector<OUString> DeviceFamilyVector;
+
+ // If |ownDevices| is true, you are transferring ownership of the devices
+ // array, and it will be deleted when this GfxDriverInfo is destroyed.
+
+ DriverInfo(OperatingSystem os, const OUString& vendor, DeviceFamilyVector* devices,
+ VersionComparisonOp op,
+ uint64_t driverVersion, const char *suggestedVersion = nullptr,
+ bool ownDevices = false);
+
+ DriverInfo();
+ DriverInfo(const DriverInfo&);
+ ~DriverInfo();
+
+ OperatingSystem meOperatingSystem;
+ uint32_t mnOperatingSystemVersion;
+
+ OUString maAdapterVendor;
+
+ static DeviceFamilyVector* const allDevices;
+ DeviceFamilyVector* mpDevices;
+
+ // Whether the mDevices array should be deleted when this structure is
+ // deallocated. False by default.
+ bool mbDeleteDevices;
+
+ VersionComparisonOp meComparisonOp;
+
+ /* versions are assumed to be A.B.C.D packed as 0xAAAABBBBCCCCDDDD */
+ uint64_t mnDriverVersion;
+ uint64_t mnDriverVersionMax;
+ static uint64_t allDriverVersions;
+
+ static const DeviceFamilyVector* GetDeviceFamily(DeviceFamily id);
+ static DeviceFamilyVector* mpDeviceFamilies[DeviceFamilyMax];
+
+ OUString maModel, maHardware, maProduct, maManufacturer;
+};
+
+#define GFX_DRIVER_VERSION(a,b,c,d) \
+ ((uint64_t(a)<<48) | (uint64_t(b)<<32) | (uint64_t(c)<<16) | uint64_t(d))
+
+inline uint64_t V(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
+{
+ // We make sure every driver number is padded by 0s, this will allow us the
+ // easiest 'compare as if decimals' approach. See ParseDriverVersion for a
+ // more extensive explanation of this approach.
+ while (b > 0 && b < 1000) {
+ b *= 10;
+ }
+ while (c > 0 && c < 1000) {
+ c *= 10;
+ }
+ while (d > 0 && d < 1000) {
+ d *= 10;
+ }
+ return GFX_DRIVER_VERSION(a, b, c, d);
+}
+
}
class WinOpenGLDeviceInfo : public OpenGLDeviceInfo
@@ -107,12 +168,15 @@ private:
bool mbRDP;
void GetData();
- OUString GetDeviceVendor(wgl::DeviceVendor eVendor);
+ void FillBlacklist();
static OUString* mpDeviceVendors[wgl::DeviceVendorMax];
+ static std::vector<wgl::DriverInfo> maDriverInfo;
public:
WinOpenGLDeviceInfo();
+
+ static OUString GetDeviceVendor(wgl::DeviceVendor eVendor);
virtual ~WinOpenGLDeviceInfo();
virtual bool isDeviceBlocked();