1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gonk/GfxInfo.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,202 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "GfxInfo.h" 1.10 + 1.11 +using namespace mozilla::widget; 1.12 + 1.13 +/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after gfxPlatform initialization 1.14 + * has occurred because they depend on it for information. (See bug 591561) */ 1.15 +nsresult 1.16 +GfxInfo::GetD2DEnabled(bool *aEnabled) 1.17 +{ 1.18 + return NS_ERROR_FAILURE; 1.19 +} 1.20 + 1.21 +nsresult 1.22 +GfxInfo::GetDWriteEnabled(bool *aEnabled) 1.23 +{ 1.24 + return NS_ERROR_FAILURE; 1.25 +} 1.26 + 1.27 +/* readonly attribute DOMString DWriteVersion; */ 1.28 +NS_IMETHODIMP 1.29 +GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion) 1.30 +{ 1.31 + return NS_ERROR_FAILURE; 1.32 +} 1.33 + 1.34 +/* readonly attribute DOMString cleartypeParameters; */ 1.35 +NS_IMETHODIMP 1.36 +GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams) 1.37 +{ 1.38 + return NS_ERROR_FAILURE; 1.39 +} 1.40 + 1.41 +/* readonly attribute DOMString adapterDescription; */ 1.42 +NS_IMETHODIMP 1.43 +GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription) 1.44 +{ 1.45 + aAdapterDescription.AssignLiteral(""); 1.46 + return NS_OK; 1.47 +} 1.48 + 1.49 +/* readonly attribute DOMString adapterDescription2; */ 1.50 +NS_IMETHODIMP 1.51 +GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription) 1.52 +{ 1.53 + return NS_ERROR_FAILURE; 1.54 +} 1.55 + 1.56 +/* readonly attribute DOMString adapterRAM; */ 1.57 +NS_IMETHODIMP 1.58 +GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM) 1.59 +{ 1.60 + aAdapterRAM.AssignLiteral(""); 1.61 + return NS_OK; 1.62 +} 1.63 + 1.64 +/* readonly attribute DOMString adapterRAM2; */ 1.65 +NS_IMETHODIMP 1.66 +GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM) 1.67 +{ 1.68 + return NS_ERROR_FAILURE; 1.69 +} 1.70 + 1.71 +/* readonly attribute DOMString adapterDriver; */ 1.72 +NS_IMETHODIMP 1.73 +GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver) 1.74 +{ 1.75 + aAdapterDriver.AssignLiteral(""); 1.76 + return NS_OK; 1.77 +} 1.78 + 1.79 +/* readonly attribute DOMString adapterDriver2; */ 1.80 +NS_IMETHODIMP 1.81 +GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver) 1.82 +{ 1.83 + return NS_ERROR_FAILURE; 1.84 +} 1.85 + 1.86 +/* readonly attribute DOMString adapterDriverVersion; */ 1.87 +NS_IMETHODIMP 1.88 +GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) 1.89 +{ 1.90 + aAdapterDriverVersion.AssignLiteral(""); 1.91 + return NS_OK; 1.92 +} 1.93 + 1.94 +/* readonly attribute DOMString adapterDriverVersion2; */ 1.95 +NS_IMETHODIMP 1.96 +GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) 1.97 +{ 1.98 + return NS_ERROR_FAILURE; 1.99 +} 1.100 + 1.101 +/* readonly attribute DOMString adapterDriverDate; */ 1.102 +NS_IMETHODIMP 1.103 +GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate) 1.104 +{ 1.105 + aAdapterDriverDate.AssignLiteral(""); 1.106 + return NS_OK; 1.107 +} 1.108 + 1.109 +/* readonly attribute DOMString adapterDriverDate2; */ 1.110 +NS_IMETHODIMP 1.111 +GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate) 1.112 +{ 1.113 + return NS_ERROR_FAILURE; 1.114 +} 1.115 + 1.116 +/* readonly attribute DOMString adapterVendorID; */ 1.117 +NS_IMETHODIMP 1.118 +GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID) 1.119 +{ 1.120 + aAdapterVendorID.AssignLiteral(""); 1.121 + return NS_OK; 1.122 +} 1.123 + 1.124 +/* readonly attribute DOMString adapterVendorID2; */ 1.125 +NS_IMETHODIMP 1.126 +GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID) 1.127 +{ 1.128 + return NS_ERROR_FAILURE; 1.129 +} 1.130 + 1.131 +/* readonly attribute DOMString adapterDeviceID; */ 1.132 +NS_IMETHODIMP 1.133 +GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID) 1.134 +{ 1.135 + aAdapterDeviceID.AssignLiteral(""); 1.136 + return NS_OK; 1.137 +} 1.138 + 1.139 +/* readonly attribute DOMString adapterDeviceID2; */ 1.140 +NS_IMETHODIMP 1.141 +GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID) 1.142 +{ 1.143 + return NS_ERROR_FAILURE; 1.144 +} 1.145 + 1.146 +/* readonly attribute boolean isGPU2Active; */ 1.147 +NS_IMETHODIMP 1.148 +GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) 1.149 +{ 1.150 + return NS_ERROR_FAILURE; 1.151 +} 1.152 + 1.153 +const nsTArray<GfxDriverInfo>& 1.154 +GfxInfo::GetGfxDriverInfo() 1.155 +{ 1.156 + return *mDriverInfo; 1.157 +} 1.158 + 1.159 +uint32_t GfxInfo::OperatingSystemVersion() 1.160 +{ 1.161 + return 0; 1.162 +} 1.163 + 1.164 +nsresult 1.165 +GfxInfo::GetFeatureStatusImpl(int32_t /*aFeature*/, 1.166 + int32_t *aStatus, 1.167 + nsAString & /*aSuggestedDriverVersion*/, 1.168 + const nsTArray<GfxDriverInfo>& /*aDriverInfo*/, 1.169 + OperatingSystem* /*aOS*/ /* = nullptr */) 1.170 +{ 1.171 + NS_ENSURE_ARG_POINTER(aStatus); 1.172 + *aStatus = nsIGfxInfo::FEATURE_NO_INFO; 1.173 + 1.174 + return NS_OK; 1.175 +} 1.176 + 1.177 +#ifdef DEBUG 1.178 + 1.179 +// Implement nsIGfxInfoDebug 1.180 + 1.181 +/* void spoofVendorID (in DOMString aVendorID); */ 1.182 +NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString &) 1.183 +{ 1.184 + return NS_OK; 1.185 +} 1.186 + 1.187 +/* void spoofDeviceID (in unsigned long aDeviceID); */ 1.188 +NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString &) 1.189 +{ 1.190 + return NS_OK; 1.191 +} 1.192 + 1.193 +/* void spoofDriverVersion (in DOMString aDriverVersion); */ 1.194 +NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString &) 1.195 +{ 1.196 + return NS_OK; 1.197 +} 1.198 + 1.199 +/* void spoofOSVersion (in unsigned long aVersion); */ 1.200 +NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t) 1.201 +{ 1.202 + return NS_OK; 1.203 +} 1.204 + 1.205 +#endif