Files
palemoon27/widget/GfxInfoX11.cpp
T
roytam1 795ba7b999 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1222092. Don't let sFocusedIMEWidget keep an nsIWidget alive during shutdown. r=masayuki (f604e32bda)
- Bug 1186795 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in widget/ with iterators. r=roc. (65077bd952)
- Bug 1186795 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in widget/ with iterators. r=roc. (b468993d9a)
- Bug 1186795 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in widget/ with iterators. r=roc. (29946ed0ce)
- Bug 1217251 - Add APZThreadUtils::RunDelayedTaskOnCurrentThread(). r=kats (0a89e92202)
- Bug 1223946 - Part 1: Clean up and support needed for converting WidgetWheelEvent to ScrollWheelInput. r=kats (faf54e7920)
- Bug 1223946 - Part 2: Ensure wheel event from nsDOMWindowUtil is dispatched on correct thread. r=kats (571d591345)
- Bug 1210912 - fix widget leak in LookupRegisteredPluginWindow; r=roc (f224933634)
- Bug 1188225 - Implement ChromeProcessController::HandleDoubleTap. r=botond (ffc65ffec1)
- Bug 1221371 - Remove unnecessary explicit copies of nsTArray. r=billm (3178318eb5)
- Bug 1218991 - Save initial zoom constraints to be used once compositor is created r=kats (4017bdc17d)
- Bug 1217818 - Add some more logging to more easily diagnose issues. r=botond (2a1480e209)
- Bug 1219898 - Remove use of gPreventMouseEvents in APZ event state-tracking code. r=botond (d6877aaedf)
- Bug 1211612 - Add DragInputBlock for async scrollbars. r=kats (6bfbcccead)
- Bug 1225007 (part 1, attempt 3) - Use LayoutDevicePixel more in Cocoa widget code. r=kats. (e4078ce0ad)
- Bug 1225007 (part 2, attempt 3) - Use LayoutDevicePixel more in Cocoa widget code. r=kats. (0db998bf01)
- Bug 1214662 - Fix compile error for enabling APZES_LOG. r=botond (c316ba99cd)
- Bug 1223296 - Clear element activation if a contextmenu is displayed. r=botond (e362ffcf8d)
- Bug 1217818 - Minor refactoring to reuse a function. r=botond (c0c29e2b90)
- Bug 1217818 - Ignore injected touchstart events for the purposes of prevent-default notifications back to APZ. r=botond (b740525b61)
- Bug 1223296 - Turn HandlePanStart into a more generic function that can be called from other places. r=botond (d10991094a)
- Bug 1223296 - Fire the MozMouseHittest event even if the C++ APZ is enabled. r=rbarker,botond (cdd7523a3b)
- Bug 1184890 part.1 SelectionChangeDataBase and TextChangeDataBase should have a flag which indicates whether the change occurred during composition or not r=smaug (e10f782acb)
- Bug 1184890 part.2 IMContextWrapper shouldn't commit composition when a selection change notification occurred before starting current composition r=m_kato (8f377bfc36)
- Bug 1184890 part.3 TSFTextStore shouldn't commit composition when a selection change notification occurred before starting current composition r=m_kato (b55102256e)
- Bug 1216177 - Remove the remaining nsRefPtr forward declarations; r=froydnj (a3674552c3)
- Bug 1225571 - Move the code to update the SPCSPS from repaint request handling to when the resolution is updated in the presShell. r=botond (a7d1909ed5)
- bug 1181823 - convert test_ev_certs.js, test_keysize_ev.js, and test_validity.js to generate certificates at build time r=Cykesiopka r=mgoodwin (19a2678625)
- Bug 1189166 - Cleanup some PSM test generation files post Bug 1181823. r=dkeeler (fad638b365)
- Bug 1170388 - Removed an outdated workaround for old clang versions in the static analysis plugin. r=mystor (0c8e0229e7)
- Bug 1208814 - Part 1: Add an analysis to prevent default copy constructors from being called on refcounted objects, r=ehsan (6a8605808e)
- Bug 1208814 - Part 2: Don't use the default copy constructor in nsNavHistoryQuery::Clone(), r=ehsan (6de5b8a04c)
- Bug 1201314 - Make most of std:: non-memmovable for static analysis purposes. r=mystor r=ehsan (3a50302fb6)
- fix refptr (70035b7976)
- Bug 1223966: Don't claim we support NSTextInput interface. r=masayuki (ab702c6718)
- Bug 431620 - Remove unused function GetToggledKeyState [r=roc] (0c7140855c)
- bug 1203312 - convert tlsserver to generate certificates at build time r=Cykesiopka,mgoodwin (ada3c01c00)
- Bug 1194419 - Remove signature algorithm duplicate use in serial number determination in pycert. r=keeler (37c2fbe839)
- Bug 1210180 - Force the view to update when we recycle a Vibrancy view. r=mstange (33490daf1f)
- Bug 1142393 - Make menus look correct when 'Reduce transparency' is set. r=smichaud (0d8a1b9b7f)
- Bug 1119106 - Add an explanatory comment. r=smichaud (1e44196dad)
- Bug 1119106 - Increase the maximum focus ring width on 10.10 to 7 pixels. r=smichaud (1af85f99e8)
- Bug 1119106 - Give these enums better names. r=smichaud (65886bdab6)
- Bug 1153579 - Fix -Wsign-compare warnings in nsNativeThemeCocoa.mm about int and size_t. r=mstange (d682b281df)
- some crash reporter stuff (3157fa0f2d)
- bug 726483 remove unnecessary DispatchResized() parameters r=roc (02051fd152)
- Bug 1208829 - Make FromUnknownRegion() actually work, and add ToUnknownRegion(). r=mstange (5a087ad3aa)
- Bug 1180564: Don't implement NSTextInput any more, just NSTextInputClient. r=masayuki (7611a0d77c)
- Bug 1180564: insertNewline should use TextInputHandler::InsertText() instead of using insertText of NSTextInput protocol r=masayuki (dc11c738b9)
- Bug 1124408 - Report cocoa view focus correctly when sheets are exposed. r=masayuki,smichaud (34a6a32d8b)
- Bug 1138678 - Ignore NOTIFY_IME_OF_BLUR when establishing secure input mode. r=masayuki (4d7b10e8a2)
- Bug 1148196 - Crashes at -[ChildView keyDown:] related to secure input. r=masayuki (0cbd54b9cf)
- Bug 1211352 part.1 IMEContentObserver should be created when a plugin has focus r=smaug (4500259e6f)
- Bug 1211352 part.2 PuppetWidget shouldn't send notifications which are not wanted by the parent process r=m_kato (2557aa51b2)
- Bug 1007063 - Show virtual (on-screen) keyboard in Windows 8 and higher when text fields are focused if physical keyboards are not present. r=jimm r=masayuki r=m_kato (9d2c1e62d0)
- Bug 1211352 part.3 nsIWidget::GetIMEupdatePreference() for each platform should not request any notifications while a plugin has focus r=m_kato (1aa357bc9d)
- Bug 1211352 part.4 PuppetWidget::GetIMEUpdatePreference() should request only position change notifications while a plugin has focus r=m_kato (470fb900d6)
- Bug 1211352 part.5 PuppetWidget should cache only the focused editor rect information while a plugin has focus r=m_kato (73e7521d3c)
- Bug 1223366 - Update event.buttons on GDK_BUTTON_RELEASE [r=karlt] (107c793c5a)
- bug 726483 keep an extra reference to the window r=roc (4e6756939f)
- Bug 1186745 part 1 - Add LeakRefPtr for pointer leaking by default. r=froydnj (b7260528df)
- Bug 1186745 part 2 - Move nsThreadSyncDispatch class to its own header file. r=froydnj (f408ef41da)
- Bug 1186745 part 3 - Make nsThreadSyncDispatch leak the sync task by default when Run() is not called. r=froydnj (17092e33ab)
- Bug 1186745 part 4 - Make TracedRunnable accept an already_AddRefed instead of a raw pointer. r=froydnj (8e59e1d0c9)
- Bug 1186745 part 5 - Make nsThread::Dispatch() always leak the event if it fails. r=froydnj (220b91529a)
- Bug 1186745 part 6 - Fix event leak when using NS_DispatchToCurrentThread. r=froydnj (55a4177f2e)
- some crashreporter stuff (a5a59bd6ac)
- bug 726483 avoid DispatchResized() during size-allocate r=roc (08ae527f93)
- Bug 1212733, cache dnd window state instead of using gtk_window_get_type_hint, r=karlt (c9ee119926)
- Bug 1131978 - Acknowledge GDK's scale factor in scale calculation. r=karlt (7280d547b8)
- bug 1180008 provide gtk_window_get_window_type for old GTK versions r=glandium (3f7f17ac69)
- Bug 1174374 - gdk_cursor_new() is deprecated in 3.16. Use gdk_cursor_new_for_display(). r=karlt (90e2e738f7)
2023-01-23 10:59:59 +08:00

551 lines
17 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: sw=2 ts=8 et :
*/
/* 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/. */
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <sys/utsname.h>
#include "nsCRTGlue.h"
#include "prenv.h"
#include "GfxInfoX11.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#include "nsICrashReporter.h"
#endif
namespace mozilla {
namespace widget {
#ifdef DEBUG
NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
#endif
// these global variables will be set when firing the glxtest process
int glxtest_pipe = -1;
pid_t glxtest_pid = 0;
nsresult
GfxInfo::Init()
{
mGLMajorVersion = 0;
mMajorVersion = 0;
mMinorVersion = 0;
mRevisionVersion = 0;
mIsMesa = false;
mIsNVIDIA = false;
mIsFGLRX = false;
mIsNouveau = false;
mIsIntel = false;
mIsOldSwrast = false;
mIsLlvmpipe = false;
mHasTextureFromPixmap = false;
return GfxInfoBase::Init();
}
void
GfxInfo::GetData()
{
// to understand this function, see bug 639842. We retrieve the OpenGL driver information in a
// separate process to protect against bad drivers.
// if glxtest_pipe == -1, that means that we already read the information
if (glxtest_pipe == -1)
return;
enum { buf_size = 1024 };
char buf[buf_size];
ssize_t bytesread = read(glxtest_pipe,
&buf,
buf_size-1); // -1 because we'll append a zero
close(glxtest_pipe);
glxtest_pipe = -1;
// bytesread < 0 would mean that the above read() call failed.
// This should never happen. If it did, the outcome would be to blacklist anyway.
if (bytesread < 0)
bytesread = 0;
// let buf be a zero-terminated string
buf[bytesread] = 0;
// Wait for the glxtest process to finish. This serves 2 purposes:
// * avoid having a zombie glxtest process laying around
// * get the glxtest process status info.
int glxtest_status = 0;
bool wait_for_glxtest_process = true;
bool waiting_for_glxtest_process_failed = false;
int waitpid_errno = 0;
while(wait_for_glxtest_process) {
wait_for_glxtest_process = false;
if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) {
waitpid_errno = errno;
if (waitpid_errno == EINTR) {
wait_for_glxtest_process = true;
} else {
// Bug 718629
// ECHILD happens when the glxtest process got reaped got reaped after a PR_CreateProcess
// as per bug 227246. This shouldn't matter, as we still seem to get the data
// from the pipe, and if we didn't, the outcome would be to blacklist anyway.
waiting_for_glxtest_process_failed = (waitpid_errno != ECHILD);
}
}
}
bool exited_with_error_code = !waiting_for_glxtest_process_failed &&
WIFEXITED(glxtest_status) &&
WEXITSTATUS(glxtest_status) != EXIT_SUCCESS;
bool received_signal = !waiting_for_glxtest_process_failed &&
WIFSIGNALED(glxtest_status);
bool error = waiting_for_glxtest_process_failed || exited_with_error_code || received_signal;
nsCString textureFromPixmap;
nsCString *stringToFill = nullptr;
char *bufptr = buf;
if (!error) {
while(true) {
char *line = NS_strtok("\n", &bufptr);
if (!line)
break;
if (stringToFill) {
stringToFill->Assign(line);
stringToFill = nullptr;
}
else if(!strcmp(line, "VENDOR"))
stringToFill = &mVendor;
else if(!strcmp(line, "RENDERER"))
stringToFill = &mRenderer;
else if(!strcmp(line, "VERSION"))
stringToFill = &mVersion;
else if(!strcmp(line, "TFP"))
stringToFill = &textureFromPixmap;
}
}
if (!strcmp(textureFromPixmap.get(), "TRUE"))
mHasTextureFromPixmap = true;
// only useful for Linux kernel version check for FGLRX driver.
// assumes X client == X server, which is sad.
struct utsname unameobj;
if (!uname(&unameobj))
{
mOS.Assign(unameobj.sysname);
mOSRelease.Assign(unameobj.release);
}
const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR");
if (spoofedVendor)
mVendor.Assign(spoofedVendor);
const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER");
if (spoofedRenderer)
mRenderer.Assign(spoofedRenderer);
const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION");
if (spoofedVersion)
mVersion.Assign(spoofedVersion);
const char *spoofedOS = PR_GetEnv("MOZ_GFX_SPOOF_OS");
if (spoofedOS)
mOS.Assign(spoofedOS);
const char *spoofedOSRelease = PR_GetEnv("MOZ_GFX_SPOOF_OS_RELEASE");
if (spoofedOSRelease)
mOSRelease.Assign(spoofedOSRelease);
if (error ||
mVendor.IsEmpty() ||
mRenderer.IsEmpty() ||
mVersion.IsEmpty() ||
mOS.IsEmpty() ||
mOSRelease.IsEmpty())
{
mAdapterDescription.AppendLiteral("GLXtest process failed");
if (waiting_for_glxtest_process_failed)
mAdapterDescription.AppendPrintf(" (waitpid failed with errno=%d for pid %d)", waitpid_errno, glxtest_pid);
if (exited_with_error_code)
mAdapterDescription.AppendPrintf(" (exited with status %d)", WEXITSTATUS(glxtest_status));
if (received_signal)
mAdapterDescription.AppendPrintf(" (received signal %d)", WTERMSIG(glxtest_status));
if (bytesread) {
mAdapterDescription.AppendLiteral(": ");
mAdapterDescription.Append(nsDependentCString(buf));
mAdapterDescription.Append('\n');
}
#ifdef MOZ_CRASHREPORTER
CrashReporter::AppendAppNotesToCrashReport(mAdapterDescription);
#endif
return;
}
mAdapterDescription.Append(mVendor);
mAdapterDescription.AppendLiteral(" -- ");
mAdapterDescription.Append(mRenderer);
nsAutoCString note;
note.AppendLiteral("OpenGL: ");
note.Append(mAdapterDescription);
note.AppendLiteral(" -- ");
note.Append(mVersion);
if (mHasTextureFromPixmap)
note.AppendLiteral(" -- texture_from_pixmap");
note.Append('\n');
#ifdef MOZ_CRASHREPORTER
CrashReporter::AppendAppNotesToCrashReport(note);
#endif
// determine the major OpenGL version. That's the first integer in the version string.
mGLMajorVersion = strtol(mVersion.get(), 0, 10);
// determine driver type (vendor) and where in the version string
// the actual driver version numbers should be expected to be found (whereToReadVersionNumbers)
const char *whereToReadVersionNumbers = nullptr;
const char *Mesa_in_version_string = strstr(mVersion.get(), "Mesa");
if (Mesa_in_version_string) {
mIsMesa = true;
// with Mesa, the version string contains "Mesa major.minor" and that's all the version information we get:
// there is no actual driver version info.
whereToReadVersionNumbers = Mesa_in_version_string + strlen("Mesa");
if (strcasestr(mVendor.get(), "nouveau"))
mIsNouveau = true;
if (strcasestr(mRenderer.get(), "intel")) // yes, intel is in the renderer string
mIsIntel = true;
if (strcasestr(mRenderer.get(), "llvmpipe"))
mIsLlvmpipe = true;
if (strcasestr(mRenderer.get(), "software rasterizer"))
mIsOldSwrast = true;
} else if (strstr(mVendor.get(), "NVIDIA Corporation")) {
mIsNVIDIA = true;
// with the NVIDIA driver, the version string contains "NVIDIA major.minor"
// note that here the vendor and version strings behave differently, that's why we don't put this above
// alongside Mesa_in_version_string.
const char *NVIDIA_in_version_string = strstr(mVersion.get(), "NVIDIA");
if (NVIDIA_in_version_string)
whereToReadVersionNumbers = NVIDIA_in_version_string + strlen("NVIDIA");
} else if (strstr(mVendor.get(), "ATI Technologies Inc")) {
mIsFGLRX = true;
// with the FGLRX driver, the version string only gives a OpenGL version :/ so let's return that.
// that can at least give a rough idea of how old the driver is.
whereToReadVersionNumbers = mVersion.get();
}
// read major.minor version numbers of the driver (not to be confused with the OpenGL version)
if (whereToReadVersionNumbers) {
// copy into writable buffer, for tokenization
strncpy(buf, whereToReadVersionNumbers, buf_size);
bufptr = buf;
// now try to read major.minor version numbers. In case of failure, gracefully exit: these numbers have
// been initialized as 0 anyways
char *token = NS_strtok(".", &bufptr);
if (token) {
mMajorVersion = strtol(token, 0, 10);
token = NS_strtok(".", &bufptr);
if (token) {
mMinorVersion = strtol(token, 0, 10);
token = NS_strtok(".", &bufptr);
if (token)
mRevisionVersion = strtol(token, 0, 10);
}
}
}
}
static inline uint64_t version(uint32_t major, uint32_t minor, uint32_t revision = 0)
{
return (uint64_t(major) << 32) + (uint64_t(minor) << 16) + uint64_t(revision);
}
const nsTArray<GfxDriverInfo>&
GfxInfo::GetGfxDriverInfo()
{
// Nothing here yet.
//if (!mDriverInfo->Length()) {
//
//}
return *mDriverInfo;
}
nsresult
GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
int32_t *aStatus,
nsAString & aSuggestedDriverVersion,
const nsTArray<GfxDriverInfo>& aDriverInfo,
OperatingSystem* aOS /* = nullptr */)
{
GetData();
NS_ENSURE_ARG_POINTER(aStatus);
*aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
aSuggestedDriverVersion.SetIsVoid(true);
OperatingSystem os = DRIVER_OS_LINUX;
if (aOS)
*aOS = os;
if (mGLMajorVersion == 1) {
// We're on OpenGL 1. In most cases that indicates really old hardware.
// We better block them, rather than rely on them to fail gracefully, because they don't!
// see bug 696636
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
return NS_OK;
}
// Don't evaluate any special cases if we're checking the downloaded blocklist.
if (!aDriverInfo.Length()) {
// Only check features relevant to Linux.
if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS ||
aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL ||
aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {
// Disable OpenGL layers when we don't have texture_from_pixmap because it regresses performance.
if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && !mHasTextureFromPixmap) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("<Anything with EXT_texture_from_pixmap support>");
return NS_OK;
}
// whitelist the linux test slaves' current configuration.
// this is necessary as they're still using the slightly outdated 190.42 driver.
// this isn't a huge risk, as at least this is the exact setting in which we do continuous testing,
// and this only affects GeForce 9400 cards on linux on this precise driver version, which is very few users.
// We do the same thing on Windows XP, see in widget/windows/GfxInfo.cpp
if (mIsNVIDIA &&
!strcmp(mRenderer.get(), "GeForce 9400/PCI/SSE2") &&
!strcmp(mVersion.get(), "3.2.0 NVIDIA 190.42"))
{
*aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
return NS_OK;
}
if (mIsMesa) {
if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(8,0)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("Mesa 8.0");
}
else if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(7,10,3)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("Mesa 7.10.3");
}
else if (mIsOldSwrast) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
}
else if (mIsLlvmpipe && version(mMajorVersion, mMinorVersion) < version(9, 1)) {
// bug 791905, Mesa bug 57733, fixed in Mesa 9.1 according to
// https://bugs.freedesktop.org/show_bug.cgi?id=57733#c3
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
}
else if (aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA)
{
if (mIsIntel && version(mMajorVersion, mMinorVersion) < version(8,1)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("Mesa 8.1");
}
}
} else if (mIsNVIDIA) {
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("NVIDIA 257.21");
}
} else if (mIsFGLRX) {
// FGLRX does not report a driver version number, so we have the OpenGL version instead.
// by requiring OpenGL 3, we effectively require recent drivers.
if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(3, 0)) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
aSuggestedDriverVersion.AssignLiteral("<Something recent>");
}
// Bug 724640: FGLRX + Linux 2.6.32 is a crashy combo
bool unknownOS = mOS.IsEmpty() || mOSRelease.IsEmpty();
bool badOS = mOS.Find("Linux", true) != -1 &&
mOSRelease.Find("2.6.32") != -1;
if (unknownOS || badOS) {
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
}
} else {
// like on windows, let's block unknown vendors. Think of virtual machines.
// Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed.
*aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
}
}
}
return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}
NS_IMETHODIMP
GfxInfo::GetD2DEnabled(bool *aEnabled)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetDWriteEnabled(bool *aEnabled)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
{
GetData();
AppendASCIItoUTF16(mAdapterDescription, aAdapterDescription);
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
{
aAdapterRAM.Truncate();
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
{
aAdapterDriver.Truncate();
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
{
GetData();
CopyASCIItoUTF16(mVersion, aAdapterDriverVersion);
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
{
aAdapterDriverDate.Truncate();
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
{
GetData();
CopyUTF8toUTF16(mVendor, aAdapterVendorID);
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
{
GetData();
CopyUTF8toUTF16(mRenderer, aAdapterDeviceID);
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
{
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
{
return NS_ERROR_FAILURE;
}
#ifdef DEBUG
// Implement nsIGfxInfoDebug
// We don't support spoofing anything on Linux
NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID)
{
CopyUTF16toUTF8(aVendorID, mVendor);
return NS_OK;
}
NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID)
{
CopyUTF16toUTF8(aDeviceID, mRenderer);
return NS_OK;
}
NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion)
{
CopyUTF16toUTF8(aDriverVersion, mVersion);
return NS_OK;
}
NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t aVersion)
{
// We don't support OS versioning on Linux. There's just "Linux".
return NS_OK;
}
#endif
} // end namespace widget
} // end namespace mozilla