Bug 1441270 - Remove unused WebGL parameter getters. r=jgilbert
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Mon, 26 Feb 2018 20:35:12 +0100
changeset 406255 c760a091c248571842dcd3b552dc1ed72f23e69d
parent 406254 5ee7d851d3d7b3520f9f51be0f3a35bcd99ca2df
child 406256 41cb252725406abe0a449db666649b1e892cd54e
push id33550
push userapavel@mozilla.com
push dateFri, 02 Mar 2018 16:19:44 +0000
treeherdermozilla-central@9552b5f236a5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1441270
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1441270 - Remove unused WebGL parameter getters. r=jgilbert MozReview-Commit-ID: 7PqaPG2STUs
dom/canvas/WebGLContext.cpp
dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
widget/GfxInfoBase.cpp
widget/GfxInfoBase.h
widget/GfxInfoWebGL.cpp
widget/GfxInfoWebGL.h
widget/GfxInfoX11.h
widget/android/GfxInfo.h
widget/cocoa/GfxInfo.h
widget/moz.build
widget/nsIGfxInfo.idl
widget/uikit/GfxInfo.h
widget/windows/GfxInfo.cpp
widget/windows/GfxInfo.h
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -1404,43 +1404,16 @@ WebGLContext::GetContextAttributes(dom::
     result.mDepth = mOptions.depth;
     result.mStencil = mOptions.stencil;
     result.mAntialias = mOptions.antialias;
     result.mPremultipliedAlpha = mOptions.premultipliedAlpha;
     result.mPreserveDrawingBuffer = mOptions.preserveDrawingBuffer;
     result.mFailIfMajorPerformanceCaveat = mOptions.failIfMajorPerformanceCaveat;
 }
 
-NS_IMETHODIMP
-WebGLContext::MozGetUnderlyingParamString(uint32_t pname, nsAString& retval)
-{
-    if (IsContextLost())
-        return NS_OK;
-
-    retval.SetIsVoid(true);
-
-    switch (pname) {
-    case LOCAL_GL_VENDOR:
-    case LOCAL_GL_RENDERER:
-    case LOCAL_GL_VERSION:
-    case LOCAL_GL_SHADING_LANGUAGE_VERSION:
-    case LOCAL_GL_EXTENSIONS:
-        {
-            const char* s = (const char*)gl->fGetString(pname);
-            retval.Assign(NS_ConvertASCIItoUTF16(nsDependentCString(s)));
-            break;
-        }
-
-    default:
-        return NS_ERROR_INVALID_ARG;
-    }
-
-    return NS_OK;
-}
-
 void
 WebGLContext::ForceClearFramebufferWithDefaultValues(const GLbitfield clearBits,
                                                      const bool fakeNoAlpha) const
 {
     const bool initializeColorBuffer = bool(clearBits & LOCAL_GL_COLOR_BUFFER_BIT);
     const bool initializeDepthBuffer = bool(clearBits & LOCAL_GL_DEPTH_BUFFER_BIT);
     const bool initializeStencilBuffer = bool(clearBits & LOCAL_GL_STENCIL_BUFFER_BIT);
 
--- a/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
+++ b/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
@@ -3,13 +3,9 @@
  * 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 "nsISupports.idl"
 
 [builtinclass, uuid(f1a2fd3a-c6ac-4ee2-a700-5d285d5e3fff)]
 interface nsIDOMWebGLRenderingContext : nsISupports
 {
-  // get an underlying GL parameter, without any WebGL intervention.
-  // Most useful for querying GL_VENDOR/GL_RENDERER for identifying
-  // the underlying renderer to the user.
-  [noscript] DOMString mozGetUnderlyingParamString(in unsigned long pname);
 };
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -4,17 +4,16 @@
  * 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 "mozilla/ArrayUtils.h"
 
 #include "GfxInfoBase.h"
 
-#include "GfxInfoWebGL.h"
 #include "GfxDriverInfo.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsString.h"
 #include "nsUnicharUtils.h"
 #include "nsVersionComparator.h"
 #include "mozilla/Services.h"
 #include "mozilla/Observer.h"
@@ -969,24 +968,16 @@ GfxInfoBase::GetFeatureSuggestedDriverVe
   }
 
   int32_t status;
   nsCString discardFailureId;
   nsTArray<GfxDriverInfo> driverInfo;
   return GetFeatureStatusImpl(aFeature, &status, aVersion, driverInfo, discardFailureId);
 }
 
-
-NS_IMETHODIMP
-GfxInfoBase::GetWebGLParameter(const nsAString& aParam,
-                               nsAString& aResult)
-{
-  return GfxInfoWebGL::GetWebGLParameter(aParam, aResult);
-}
-
 void
 GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
 {
   int32_t features[] = {
     nsIGfxInfo::FEATURE_DIRECT2D,
     nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS,
--- a/widget/GfxInfoBase.h
+++ b/widget/GfxInfoBase.h
@@ -41,21 +41,19 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   // We only declare a subset of the nsIGfxInfo interface. It's up to derived
   // classes to implement the rest of the interface.  
   // Derived classes need to use
   // using GfxInfoBase::GetFeatureStatus;
   // using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  // using GfxInfoBase::GetWebGLParameter;
   // to import the relevant methods into their namespace.
   NS_IMETHOD GetFeatureStatus(int32_t aFeature, nsACString& aFailureId, int32_t *_retval) override;
   NS_IMETHOD GetFeatureSuggestedDriverVersion(int32_t aFeature, nsAString & _retval) override;
-  NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval) override;
 
   NS_IMETHOD GetMonitors(JSContext* cx, JS::MutableHandleValue _retval) override;
   NS_IMETHOD GetFailures(uint32_t *failureCount, int32_t** indices, char ***failures) override;
   NS_IMETHOD_(void) LogFailure(const nsACString &failure) override;
   NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>) override;
   NS_IMETHOD GetFeatures(JSContext*, JS::MutableHandle<JS::Value>) override;
   NS_IMETHOD GetFeatureLog(JSContext*, JS::MutableHandle<JS::Value>) override;
   NS_IMETHOD GetActiveCrashGuards(JSContext*, JS::MutableHandle<JS::Value>) override;
deleted file mode 100644
--- a/widget/GfxInfoWebGL.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* vim: se cin sw=2 ts=2 et : */
-/* -*- 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/. */
-
-#include "GfxInfoWebGL.h"
-
-#include "nsServiceManagerUtils.h"
-
-#include "GLDefs.h"
-#include "nsIDOMWebGLRenderingContext.h"
-#include "nsICanvasRenderingContextInternal.h"
-
-using namespace mozilla::widget;
-
-nsresult
-GfxInfoWebGL::GetWebGLParameter(const nsAString& aParam, nsAString& aResult)
-{
-  GLenum param;
-
-  if (aParam.EqualsLiteral("vendor")) param = LOCAL_GL_VENDOR;
-  else if (aParam.EqualsLiteral("renderer")) param = LOCAL_GL_RENDERER;
-  else if (aParam.EqualsLiteral("version")) param = LOCAL_GL_VERSION;
-  else if (aParam.EqualsLiteral("shading_language_version")) param = LOCAL_GL_SHADING_LANGUAGE_VERSION;
-  else if (aParam.EqualsLiteral("extensions")) param = LOCAL_GL_EXTENSIONS;
-  else if (aParam.EqualsLiteral("full-renderer")) param = 0;
-  else return NS_ERROR_INVALID_ARG;
-
-  nsCOMPtr<nsIDOMWebGLRenderingContext> webgl =
-    do_CreateInstance("@mozilla.org/content/canvas-rendering-context;1?id=webgl");
-  if (!webgl)
-    return NS_ERROR_NOT_AVAILABLE;
-
-  nsCOMPtr<nsICanvasRenderingContextInternal> webglInternal =
-    do_QueryInterface(webgl);
-  if (!webglInternal)
-    return NS_ERROR_NOT_AVAILABLE;
-
-  nsresult rv = webglInternal->SetDimensions(16, 16);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (param)
-    return webgl->MozGetUnderlyingParamString(param, aResult);
-
-  // this is the "full renderer" string, which is vendor + renderer + version
-
-  nsAutoString str;
-
-  rv = webgl->MozGetUnderlyingParamString(LOCAL_GL_VENDOR, str);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  aResult.Append(str);
-  aResult.AppendLiteral(" -- ");
-
-  rv = webgl->MozGetUnderlyingParamString(LOCAL_GL_RENDERER, str);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  aResult.Append(str);
-  aResult.AppendLiteral(" -- ");
-
-  rv = webgl->MozGetUnderlyingParamString(LOCAL_GL_VERSION, str);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  aResult.Append(str);
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/widget/GfxInfoWebGL.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* vim: se cin sw=2 ts=2 et : */
-/* -*- 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/. */
-
-#ifndef __mozilla_widget_GfxInfoWebGL_h__
-#define __mozilla_widget_GfxInfoWebGL_h__
-
-#include "nsString.h"
-
-namespace mozilla {
-namespace widget {
-
-class GfxInfoWebGL {
-public:
-    static nsresult GetWebGLParameter(const nsAString& aParam, nsAString& aResult);
-
-protected:
-    GfxInfoWebGL() { }
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif
--- a/widget/GfxInfoX11.h
+++ b/widget/GfxInfoX11.h
@@ -37,17 +37,16 @@ public:
   NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) override;
   NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init() override;
   
   NS_IMETHOD_(void) GetData() override;
 
 #ifdef DEBUG
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIGFXINFODEBUG
--- a/widget/android/GfxInfo.h
+++ b/widget/android/GfxInfo.h
@@ -46,17 +46,16 @@ public:
   NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) override;
   NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  using GfxInfoBase::GetWebGLParameter;
 
   void EnsureInitialized();
 
   virtual nsString Model() override;
   virtual nsString Hardware() override;
   virtual nsString Product() override;
   virtual nsString Manufacturer() override;
 
--- a/widget/cocoa/GfxInfo.h
+++ b/widget/cocoa/GfxInfo.h
@@ -41,17 +41,16 @@ public:
   NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
 
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init() override;
 
 #ifdef DEBUG
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIGFXINFODEBUG
 #endif
 
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -168,17 +168,16 @@ EXPORTS.mozilla.widget += [
 ]
 
 UNIFIED_SOURCES += [
     'CompositorWidget.cpp',
     'ContentCache.cpp',
     'GfxDriverInfo.cpp',
     'GfxInfoBase.cpp',
     'GfxInfoCollector.cpp',
-    'GfxInfoWebGL.cpp',
     'InProcessCompositorWidget.cpp',
     'InputData.cpp',
     'nsAutoRollup.cpp',
     'nsBaseAppShell.cpp',
     'nsBaseScreen.cpp',
     'nsClipboardHelper.cpp',
     'nsClipboardProxy.cpp',
     'nsColorPickerProxy.cpp',
--- a/widget/nsIGfxInfo.idl
+++ b/widget/nsIGfxInfo.idl
@@ -164,23 +164,16 @@ interface nsIGfxInfo : nsISupports
   long getFeatureStatus(in long aFeature, [optional] out ACString aFailureId);
 
   /*
    * Ask about a feature, return the minimum driver version required for it if its status is
    * FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
    */
   DOMString getFeatureSuggestedDriverVersion(in long aFeature);
 
-  /**
-   * WebGL info; valid params are "full-renderer", "vendor", "renderer", "version",
-   * "shading_language_version", "extensions".  These return info from
-   * underlying GL impl that's used to implement WebGL.
-   */
-  DOMString getWebGLParameter(in DOMString aParam);
-
   // only useful on X11
   [noscript, notxpcom] void GetData();
 
   [implicit_jscontext]
   jsval getInfo();
 
   // Return an object describing all features that have been configured:
   //
--- a/widget/uikit/GfxInfo.h
+++ b/widget/uikit/GfxInfo.h
@@ -50,17 +50,16 @@ public:
   NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) override;
   NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  using GfxInfoBase::GetWebGLParameter;
 
 #ifdef DEBUG
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIGFXINFODEBUG
 #endif
 
 protected:
 
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -5,17 +5,16 @@
 
 #include "mozilla/ArrayUtils.h"
 
 #include <windows.h>
 #include <setupapi.h>
 #include "gfxConfig.h"
 #include "gfxWindowsPlatform.h"
 #include "GfxInfo.h"
-#include "GfxInfoWebGL.h"
 #include "nsUnicharUtils.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "GfxDriverInfo.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/gfx/Logging.h"
 #include "nsExceptionHandler.h"
--- a/widget/windows/GfxInfo.h
+++ b/widget/windows/GfxInfo.h
@@ -39,17 +39,16 @@ public:
   NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) override;
   NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
   using GfxInfoBase::GetFeatureStatus;
   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
-  using GfxInfoBase::GetWebGLParameter;
 
   virtual nsresult Init() override;
 
   virtual uint32_t OperatingSystemVersion() override { return mWindowsVersion; }
 
   nsresult FindMonitors(JSContext* cx, JS::HandleObject array) override;
 
 #ifdef DEBUG