Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* vim: se cin sw=2 ts=2 et : */ |
michael@0 | 2 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef __mozilla_widget_GfxInfo_h__ |
michael@0 | 9 | #define __mozilla_widget_GfxInfo_h__ |
michael@0 | 10 | |
michael@0 | 11 | #include "GfxInfoBase.h" |
michael@0 | 12 | #include "GfxDriverInfo.h" |
michael@0 | 13 | |
michael@0 | 14 | #include "nsString.h" |
michael@0 | 15 | #include "mozilla/Scoped.h" |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | |
michael@0 | 19 | namespace gl { |
michael@0 | 20 | class GLContext; |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | namespace widget { |
michael@0 | 24 | |
michael@0 | 25 | class GfxInfo : public GfxInfoBase |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | GfxInfo(); |
michael@0 | 29 | |
michael@0 | 30 | // We only declare the subset of nsIGfxInfo that we actually implement. The |
michael@0 | 31 | // rest is brought forward from GfxInfoBase. |
michael@0 | 32 | NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled); |
michael@0 | 33 | NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled); |
michael@0 | 34 | NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion); |
michael@0 | 35 | NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams); |
michael@0 | 36 | NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription); |
michael@0 | 37 | NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver); |
michael@0 | 38 | NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID); |
michael@0 | 39 | NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID); |
michael@0 | 40 | NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM); |
michael@0 | 41 | NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion); |
michael@0 | 42 | NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate); |
michael@0 | 43 | NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription); |
michael@0 | 44 | NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver); |
michael@0 | 45 | NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID); |
michael@0 | 46 | NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID); |
michael@0 | 47 | NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM); |
michael@0 | 48 | NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion); |
michael@0 | 49 | NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate); |
michael@0 | 50 | NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active); |
michael@0 | 51 | using GfxInfoBase::GetFeatureStatus; |
michael@0 | 52 | using GfxInfoBase::GetFeatureSuggestedDriverVersion; |
michael@0 | 53 | using GfxInfoBase::GetWebGLParameter; |
michael@0 | 54 | |
michael@0 | 55 | void EnsureInitialized(); |
michael@0 | 56 | |
michael@0 | 57 | virtual nsString Model(); |
michael@0 | 58 | virtual nsString Hardware(); |
michael@0 | 59 | virtual nsString Product(); |
michael@0 | 60 | virtual nsString Manufacturer(); |
michael@0 | 61 | |
michael@0 | 62 | #ifdef DEBUG |
michael@0 | 63 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 64 | NS_DECL_NSIGFXINFODEBUG |
michael@0 | 65 | #endif |
michael@0 | 66 | |
michael@0 | 67 | virtual uint32_t OperatingSystemVersion() MOZ_OVERRIDE; |
michael@0 | 68 | |
michael@0 | 69 | protected: |
michael@0 | 70 | |
michael@0 | 71 | virtual nsresult GetFeatureStatusImpl(int32_t aFeature, |
michael@0 | 72 | int32_t *aStatus, |
michael@0 | 73 | nsAString & aSuggestedDriverVersion, |
michael@0 | 74 | const nsTArray<GfxDriverInfo>& aDriverInfo, |
michael@0 | 75 | OperatingSystem* aOS = nullptr); |
michael@0 | 76 | virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo(); |
michael@0 | 77 | |
michael@0 | 78 | private: |
michael@0 | 79 | |
michael@0 | 80 | void AddCrashReportAnnotations(); |
michael@0 | 81 | |
michael@0 | 82 | bool mInitialized; |
michael@0 | 83 | |
michael@0 | 84 | class GLStrings; |
michael@0 | 85 | ScopedDeletePtr<GLStrings> mGLStrings; |
michael@0 | 86 | |
michael@0 | 87 | nsCString mAdapterDescription; |
michael@0 | 88 | |
michael@0 | 89 | OperatingSystem mOS; |
michael@0 | 90 | |
michael@0 | 91 | nsString mModel, mHardware, mManufacturer, mProduct; |
michael@0 | 92 | nsCString mOSVersion; |
michael@0 | 93 | uint32_t mOSVersionInteger; |
michael@0 | 94 | }; |
michael@0 | 95 | |
michael@0 | 96 | } // namespace widget |
michael@0 | 97 | } // namespace mozilla |
michael@0 | 98 | |
michael@0 | 99 | #endif /* __mozilla_widget_GfxInfo_h__ */ |