Bug 1441270 - Remove unused WebGL parameter getters. r=jgilbert

MozReview-Commit-ID: 7PqaPG2STUs

--HG--
extra : rebase_source : e24d7534964d15c54c1f8706ad01e17a4e31dd8c
This commit is contained in:
Adrian Wielgosik 2018-02-26 20:35:12 +01:00
Родитель 5f3177906e
Коммит d61c7fbed5
14 изменённых файлов: 0 добавлений и 152 удалений

Просмотреть файл

@ -1409,33 +1409,6 @@ WebGLContext::GetContextAttributes(dom::Nullable<dom::WebGLContextAttributes>& r
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

Просмотреть файл

@ -8,8 +8,4 @@
[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);
};

Просмотреть файл

@ -9,7 +9,6 @@
#include "GfxInfoBase.h"
#include "GfxInfoWebGL.h"
#include "GfxDriverInfo.h"
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
@ -974,14 +973,6 @@ GfxInfoBase::GetFeatureSuggestedDriverVersion(int32_t aFeature,
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)
{

Просмотреть файл

@ -46,11 +46,9 @@ public:
// 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;

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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

Просмотреть файл

@ -42,7 +42,6 @@ public:
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
virtual nsresult Init() override;

Просмотреть файл

@ -51,7 +51,6 @@ public:
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
void EnsureInitialized();

Просмотреть файл

@ -46,7 +46,6 @@ public:
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
virtual nsresult Init() override;

Просмотреть файл

@ -173,7 +173,6 @@ UNIFIED_SOURCES += [
'GfxDriverInfo.cpp',
'GfxInfoBase.cpp',
'GfxInfoCollector.cpp',
'GfxInfoWebGL.cpp',
'InProcessCompositorWidget.cpp',
'InputData.cpp',
'nsAutoRollup.cpp',

Просмотреть файл

@ -169,13 +169,6 @@ interface nsIGfxInfo : nsISupports
*/
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();

Просмотреть файл

@ -55,7 +55,6 @@ public:
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
#ifdef DEBUG
NS_DECL_ISUPPORTS_INHERITED

Просмотреть файл

@ -10,7 +10,6 @@
#include "gfxConfig.h"
#include "gfxWindowsPlatform.h"
#include "GfxInfo.h"
#include "GfxInfoWebGL.h"
#include "nsUnicharUtils.h"
#include "prenv.h"
#include "prprf.h"

Просмотреть файл

@ -44,7 +44,6 @@ public:
NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
virtual nsresult Init() override;