/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
GfxDriverInfo::GfxDriverInfo(const GfxDriverInfo& aOrig)
: mOperatingSystem(aOrig.mOperatingSystem),
mOperatingSystemVersion(aOrig.mOperatingSystemVersion),
mScreen(aOrig.mScreen),
mBattery(aOrig.mBattery),
mWindowProtocol(aOrig.mWindowProtocol),
mAdapterVendor(aOrig.mAdapterVendor),
mDriverVendor(aOrig.mDriverVendor),
mFeature(aOrig.mFeature),
mFeatureStatus(aOrig.mFeatureStatus),
mComparisonOp(aOrig.mComparisonOp),
mDriverVersion(aOrig.mDriverVersion),
mDriverVersionMax(aOrig.mDriverVersionMax),
mSuggestedVersion(aOrig.mSuggestedVersion),
mRuleId(aOrig.mRuleId),
mGpu2(aOrig.mGpu2) { // If we're managing the lifetime of the device family, we have to make a // copy of the original's device family. if (aOrig.mDeleteDevices && aOrig.mDevices) {
GfxDeviceFamily* devices = new GfxDeviceFamily;
*devices = *aOrig.mDevices;
mDevices = devices;
} else {
mDevices = aOrig.mDevices;
}
mDeleteDevices = aOrig.mDeleteDevices;
}
GfxDriverInfo::~GfxDriverInfo() { if (mDeleteDevices) { delete mDevices;
}
}
for (constauto& range : mRanges) { if (deviceId >= range.mBegin && deviceId <= range.mEnd) { return NS_OK;
}
}
return NS_ERROR_NOT_AVAILABLE;
}
// Macros for appending a device to the DeviceFamily. #define APPEND_DEVICE(device) APPEND_DEVICE2(#device) #define APPEND_DEVICE2(device) \
deviceFamily->Append(NS_LITERAL_STRING_FROM_CSTRING(device)) #define APPEND_RANGE(start, end) deviceFamily->AppendRange(start, end)
const GfxDeviceFamily* GfxDriverInfo::GetDeviceFamily(DeviceFamily id) { if (id >= DeviceFamily::Max) {
MOZ_ASSERT_UNREACHABLE("DeviceFamily id is out of range"); return nullptr;
}
// All of these have no specific device ID filtering. switch (id) { case DeviceFamily::All: case DeviceFamily::IntelAll: case DeviceFamily::NvidiaAll: case DeviceFamily::AtiAll: case DeviceFamily::MicrosoftAll: case DeviceFamily::ParallelsAll: case DeviceFamily::QualcommAll: case DeviceFamily::AppleAll: case DeviceFamily::AmazonAll: return nullptr; default: break;
}
// If it already exists, we must have processed it once, so return it now. auto idx = static_cast<size_t>(id); if (sDeviceFamilies[idx]) { return sDeviceFamilies[idx];
}
sDeviceFamilies[idx] = new GfxDeviceFamily;
GfxDeviceFamily* deviceFamily = sDeviceFamilies[idx];
// gen5 (ironlake)
APPEND_DEVICE(0x0042);
APPEND_DEVICE(0x0046); break; // This should never happen, but we get a warning if we don't handle this. case DeviceFamily::Max: case DeviceFamily::All: case DeviceFamily::IntelAll: case DeviceFamily::NvidiaAll: case DeviceFamily::AtiAll: case DeviceFamily::MicrosoftAll: case DeviceFamily::ParallelsAll: case DeviceFamily::QualcommAll: case DeviceFamily::AppleAll: case DeviceFamily::AmazonAll:
NS_WARNING("Invalid DeviceFamily id"); break;
}
return deviceFamily;
}
const nsAString& GfxDriverInfo::GetWindowProtocol(WindowProtocol id) { if (id >= WindowProtocol::Max) {
MOZ_ASSERT_UNREACHABLE("WindowProtocol id is out of range");
id = WindowProtocol::All;
}
auto idx = static_cast<size_t>(id); if (sWindowProtocol[idx]) { return *sWindowProtocol[idx];
}
sWindowProtocol[idx] = new nsString();
switch (id) { case WindowProtocol::Max: // Suppress a warning. #define GFXINFO_WINDOW_PROTOCOL(id, name) \ case WindowProtocol::id: \
sWindowProtocol[idx]->Assign(u##name##_ns); \ break; #include"mozilla/widget/GfxInfoWindowProtocolDefs.h" #undef GFXINFO_WINDOW_PROTOCOL
}
return *sWindowProtocol[idx];
}
const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceFamily id) { if (id >= DeviceFamily::Max) {
MOZ_ASSERT_UNREACHABLE("DeviceVendor id is out of range");
id = DeviceFamily::All;
}
DeviceVendor vendor = DeviceVendor::All; switch (id) { case DeviceFamily::IntelAll: case DeviceFamily::IntelGMA500: case DeviceFamily::IntelGMA900: case DeviceFamily::IntelGMA950: case DeviceFamily::IntelGMA3150: case DeviceFamily::IntelGMAX3000: case DeviceFamily::IntelGMAX4500HD: case DeviceFamily::IntelHDGraphicsToIvyBridge: case DeviceFamily::IntelHDGraphicsToSandyBridge: case DeviceFamily::IntelHaswell: case DeviceFamily::IntelSandyBridge: case DeviceFamily::IntelGen7Baytrail: case DeviceFamily::IntelSkylake: case DeviceFamily::IntelKabyLake: case DeviceFamily::IntelHD520: case DeviceFamily::IntelMobileHDGraphics: case DeviceFamily::IntelMeteorLake: case DeviceFamily::IntelArrowlake: case DeviceFamily::IntelGen12: case DeviceFamily::IntelWebRenderBlocked: case DeviceFamily::Bug1116812: case DeviceFamily::Bug1155608: case DeviceFamily::Bug1207665:
vendor = DeviceVendor::Intel; break; case DeviceFamily::NvidiaAll: case DeviceFamily::NvidiaBlockD3D9Layers: case DeviceFamily::NvidiaWebRenderBlocked: case DeviceFamily::Geforce7300GT: case DeviceFamily::Nvidia310M: case DeviceFamily::Nvidia8800GTS: case DeviceFamily::NvidiaPascal: case DeviceFamily::Bug1137716:
vendor = DeviceVendor::NVIDIA; break; case DeviceFamily::AtiAll: case DeviceFamily::RadeonBlockZeroVideoCopy: case DeviceFamily::RadeonCaicos: case DeviceFamily::RadeonX1000: case DeviceFamily::Bug1447141: case DeviceFamily::AmdR600:
vendor = DeviceVendor::ATI; break; case DeviceFamily::MicrosoftAll:
vendor = DeviceVendor::Microsoft; break; case DeviceFamily::ParallelsAll:
vendor = DeviceVendor::Parallels; break; case DeviceFamily::AppleAll:
vendor = DeviceVendor::Apple; break; case DeviceFamily::AmazonAll:
vendor = DeviceVendor::Amazon; break; case DeviceFamily::QualcommAll: // Choose an arbitrary Qualcomm PCI VENdor ID for now. // TODO: This should be "QCOM" when Windows device ID parsing is reworked.
vendor = DeviceVendor::Qualcomm; break; case DeviceFamily::All: case DeviceFamily::Max: break;
}
return GetDeviceVendor(vendor);
}
const nsAString& GfxDriverInfo::GetDeviceVendor(DeviceVendor id) { if (id >= DeviceVendor::Max) {
MOZ_ASSERT_UNREACHABLE("DeviceVendor id is out of range");
id = DeviceVendor::All;
}
auto idx = static_cast<size_t>(id); if (sDeviceVendors[idx]) { return *sDeviceVendors[idx];
}
sDeviceVendors[idx] = new nsString();
switch (id) { case DeviceVendor::Max: // Suppress a warning. #define GFXINFO_DEVICE_VENDOR(id, name) \ case DeviceVendor::id: \
sDeviceVendors[idx]->Assign(u##name##_ns); \ break; #include"mozilla/widget/GfxInfoDeviceVendorDefs.h" #undef GFXINFO_DEVICE_VENDOR
}
return *sDeviceVendors[idx];
}
const nsAString& GfxDriverInfo::GetDriverVendor(DriverVendor id) { if (id >= DriverVendor::Max) {
MOZ_ASSERT_UNREACHABLE("DriverVendor id is out of range");
id = DriverVendor::All;
}
auto idx = static_cast<size_t>(id); if (sDriverVendors[idx]) { return *sDriverVendors[idx];
}
sDriverVendors[idx] = new nsString();
switch (id) { case DriverVendor::Max: // Suppress a warning. #define GFXINFO_DRIVER_VENDOR(id, name) \ case DriverVendor::id: \
sDriverVendors[idx]->Assign(u##name##_ns); \ break; #include"mozilla/widget/GfxInfoDriverVendorDefs.h" #undef GFXINFO_DRIVER_VENDOR
}
return *sDriverVendors[idx];
}
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.