widget/android/GfxInfo.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial