summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/GLContext.cpp4
-rw-r--r--gfx/gl/GLContextProviderEGL.cpp1
-rw-r--r--gfx/gl/GLContextProviderGLX.cpp4
-rw-r--r--gfx/gl/GLContextProviderWGL.cpp5
-rw-r--r--gfx/gl/GLLibraryEGL.cpp4
-rw-r--r--gfx/layers/d3d11/CompositorD3D11.cpp4
-rw-r--r--gfx/layers/d3d9/CompositorD3D9.cpp5
-rw-r--r--gfx/layers/opengl/CompositorOGL.cpp5
-rw-r--r--gfx/src/gfxCrashReporterUtils.cpp141
-rw-r--r--gfx/src/gfxCrashReporterUtils.h51
-rw-r--r--gfx/src/moz.build2
-rw-r--r--gfx/thebes/DeviceManagerDx.cpp2
-rw-r--r--gfx/thebes/DeviceManagerDx.h2
-rw-r--r--gfx/thebes/gfxPlatform.cpp2
-rwxr-xr-xgfx/thebes/gfxWindowsPlatform.cpp7
-rw-r--r--gfx/thebes/gfxWindowsPlatform.h1
16 files changed, 0 insertions, 240 deletions
diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp
index 23090ef98..33315413f 100644
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -19,7 +19,6 @@
#include "GLReadTexImageHelper.h"
#include "GLScreenBuffer.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxEnv.h"
#include "gfxUtils.h"
#include "GLContextProvider.h"
@@ -523,8 +522,6 @@ GLContext::InitWithPrefix(const char* prefix, bool trygl)
MOZ_RELEASE_ASSERT(!mSymbols.fBindFramebuffer,
"GFX: InitWithPrefix should only be called once.");
- ScopedGfxFeatureReporter reporter("GL Context");
-
if (!InitWithPrefixImpl(prefix, trygl)) {
// If initialization fails, zero the symbols to avoid hard-to-understand bugs.
mSymbols.Zero();
@@ -532,7 +529,6 @@ GLContext::InitWithPrefix(const char* prefix, bool trygl)
return false;
}
- reporter.SetSuccessful();
return true;
}
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
index 086f35ad7..098662200 100644
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -79,7 +79,6 @@
#endif
#include "gfxASurface.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxFailure.h"
#include "gfxPlatform.h"
#include "gfxUtils.h"
diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp
index 9a1157f33..d804f95af 100644
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -35,8 +35,6 @@
#include "GLScreenBuffer.h"
#include "gfxPrefs.h"
-#include "gfxCrashReporterUtils.h"
-
#ifdef MOZ_WIDGET_GTK
#include "gfxPlatformGtk.h"
#endif
@@ -93,13 +91,11 @@ GLXLibrary::EnsureInitialized()
libGLfilename = "libGL.so.1";
#endif
- ScopedGfxFeatureReporter reporter(libGLfilename, forceFeatureReport);
mOGLLibrary = PR_LoadLibrary(libGLfilename);
if (!mOGLLibrary) {
NS_WARNING("Couldn't load OpenGL shared library.");
return false;
}
- reporter.SetSuccessful();
}
if (gfxEnv::GlxDebug()) {
diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp
index a1373f78f..c9c3f0a54 100644
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -11,8 +11,6 @@
#include "gfxPlatform.h"
#include "gfxWindowsSurface.h"
-#include "gfxCrashReporterUtils.h"
-
#include "prenv.h"
#include "mozilla/Preferences.h"
@@ -99,8 +97,6 @@ WGLLibrary::EnsureInitialized()
if (mInitialized)
return true;
- mozilla::ScopedGfxFeatureReporter reporter("WGL");
-
std::string libGLFilename = "Opengl32.dll";
// SU_SPIES_DIRECTORY is for AMD CodeXL/gDEBugger
if (PR_GetEnv("SU_SPIES_DIRECTORY")) {
@@ -268,7 +264,6 @@ WGLLibrary::EnsureInitialized()
mInitialized = true;
- reporter.SetSuccessful();
return true;
}
diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp
index 22be44ed6..3d8da3085 100644
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -6,7 +6,6 @@
#include "angle/Platform.h"
#include "gfxConfig.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Assertions.h"
@@ -300,8 +299,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
return true;
}
- mozilla::ScopedGfxFeatureReporter reporter("EGL");
-
#ifdef XP_WIN
if (!mEGLLibrary) {
// On Windows, the GLESv2, EGL and DXSDK libraries are shipped with libxul and
@@ -624,7 +621,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
}
mInitialized = true;
- reporter.SetSuccessful();
return true;
}
diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp
index 540d39b33..2197f5444 100644
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -19,7 +19,6 @@
#include "nsWindowsHelpers.h"
#include "gfxPrefs.h"
#include "gfxConfig.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxUtils.h"
#include "mozilla/gfx/StackArray.h"
#include "mozilla/Services.h"
@@ -181,8 +180,6 @@ CompositorD3D11::~CompositorD3D11()
bool
CompositorD3D11::Initialize(nsCString* const out_failureReason)
{
- ScopedGfxFeatureReporter reporter("D3D11 Layers");
-
MOZ_ASSERT(gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING));
HRESULT hr;
@@ -415,7 +412,6 @@ CompositorD3D11::Initialize(nsCString* const out_failureReason)
mAllowPartialPresents = CanUsePartialPresents(mDevice);
- reporter.SetSuccessful();
return true;
}
diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp
index 0f7e942c1..85c19139f 100644
--- a/gfx/layers/d3d9/CompositorD3D9.cpp
+++ b/gfx/layers/d3d9/CompositorD3D9.cpp
@@ -15,7 +15,6 @@
#include "gfxFailure.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "gfxPrefs.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxUtils.h"
#include "mozilla/gfx/DeviceManagerDx.h"
#include "mozilla/layers/CompositorBridgeParent.h"
@@ -43,8 +42,6 @@ CompositorD3D9::~CompositorD3D9()
bool
CompositorD3D9::Initialize(nsCString* const out_failureReason)
{
- ScopedGfxFeatureReporter reporter("D3D9 Layers");
-
mDeviceManager = DeviceManagerD3D9::Get();
if (!mDeviceManager) {
*out_failureReason = "FEATURE_FAILURE_D3D9_DEVICE_MANAGER";
@@ -62,8 +59,6 @@ CompositorD3D9::Initialize(nsCString* const out_failureReason)
return false;
}
- reporter.SetSuccessful();
-
return true;
}
diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp
index bbe1b4657..93656d72a 100644
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -12,7 +12,6 @@
#include "GLUploadHelpers.h"
#include "Layers.h" // for WriteSnapshotToDumpFile
#include "LayerScope.h" // for LayerScope
-#include "gfxCrashReporterUtils.h" // for ScopedGfxFeatureReporter
#include "gfxEnv.h" // for gfxEnv
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxPrefs.h" // for gfxPrefs
@@ -225,8 +224,6 @@ CompositorOGL::CleanupResources()
bool
CompositorOGL::Initialize(nsCString* const out_failureReason)
{
- ScopedGfxFeatureReporter reporter("GL Layers");
-
// Do not allow double initialization
MOZ_ASSERT(mGLContext == nullptr, "Don't reinitialize CompositorOGL");
@@ -424,8 +421,6 @@ CompositorOGL::Initialize(nsCString* const out_failureReason)
console->LogStringMessage(msg.get());
}
- reporter.SetSuccessful();
-
return true;
}
diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp
deleted file mode 100644
index 757c15527..000000000
--- a/gfx/src/gfxCrashReporterUtils.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- 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 "gfxCrashReporterUtils.h"
-
-#ifdef MOZ_GFXFEATUREREPORTER
-#include "gfxCrashReporterUtils.h"
-#include <string.h> // for strcmp
-#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
-#include "mozilla/Services.h" // for GetObserverService
-#include "mozilla/StaticMutex.h"
-#include "mozilla/mozalloc.h" // for operator new, etc
-#include "mozilla/RefPtr.h" // for RefPtr
-#include "nsCOMPtr.h" // for nsCOMPtr
-#include "nsError.h" // for NS_OK, NS_FAILED, nsresult
-#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport
-#include "nsID.h"
-#include "nsIEventTarget.h" // for NS_DISPATCH_NORMAL
-#include "nsIObserver.h" // for nsIObserver, etc
-#include "nsIObserverService.h" // for nsIObserverService
-#include "nsIRunnable.h" // for nsIRunnable
-#include "nsISupports.h"
-#include "nsTArray.h" // for nsTArray
-#include "nsThreadUtils.h" // for NS_DispatchToMainThread, etc
-#include "nscore.h" // for NS_IMETHOD, NS_IMETHODIMP, etc
-
-namespace mozilla {
-
-static nsTArray<nsCString> *gFeaturesAlreadyReported = nullptr;
-static StaticMutex gFeaturesAlreadyReportedMutex;
-
-class ObserverToDestroyFeaturesAlreadyReported final : public nsIObserver
-{
-
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
-
- ObserverToDestroyFeaturesAlreadyReported() {}
-private:
- virtual ~ObserverToDestroyFeaturesAlreadyReported() {}
-};
-
-NS_IMPL_ISUPPORTS(ObserverToDestroyFeaturesAlreadyReported,
- nsIObserver)
-
-NS_IMETHODIMP
-ObserverToDestroyFeaturesAlreadyReported::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- if (!strcmp(aTopic, "xpcom-shutdown")) {
- StaticMutexAutoLock al(gFeaturesAlreadyReportedMutex);
- if (gFeaturesAlreadyReported) {
- delete gFeaturesAlreadyReported;
- gFeaturesAlreadyReported = nullptr;
- }
- }
- return NS_OK;
-}
-
-class RegisterObserverRunnable : public Runnable {
-public:
- NS_IMETHOD Run() override {
- // LeakLog made me do this. Basically, I just wanted gFeaturesAlreadyReported to be a static nsTArray<nsCString>,
- // and LeakLog was complaining about leaks like this:
- // leaked 1 instance of nsTArray_base with size 8 bytes
- // leaked 7 instances of nsStringBuffer with size 8 bytes each (56 bytes total)
- // So this is a work-around using a pointer, and using a nsIObserver to deallocate on xpcom shutdown.
- // Yay for fighting bloat.
- nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
- if (!observerService)
- return NS_OK;
- RefPtr<ObserverToDestroyFeaturesAlreadyReported> observer = new ObserverToDestroyFeaturesAlreadyReported;
- observerService->AddObserver(observer, "xpcom-shutdown", false);
- return NS_OK;
- }
-};
-
-class AppendAppNotesRunnable : public CancelableRunnable {
-public:
- explicit AppendAppNotesRunnable(const nsACString& aFeatureStr)
- : mFeatureString(aFeatureStr)
- {
- }
-
- NS_IMETHOD Run() override {
- CrashReporter::AppendAppNotesToCrashReport(mFeatureString);
- return NS_OK;
- }
-
-private:
- nsAutoCString mFeatureString;
-};
-
-void
-ScopedGfxFeatureReporter::WriteAppNote(char statusChar)
-{
- StaticMutexAutoLock al(gFeaturesAlreadyReportedMutex);
-
- if (!gFeaturesAlreadyReported) {
- gFeaturesAlreadyReported = new nsTArray<nsCString>;
- nsCOMPtr<nsIRunnable> r = new RegisterObserverRunnable();
- NS_DispatchToMainThread(r);
- }
-
- nsAutoCString featureString;
- featureString.AppendPrintf("%s%c ",
- mFeature,
- statusChar);
-
- if (!gFeaturesAlreadyReported->Contains(featureString)) {
- gFeaturesAlreadyReported->AppendElement(featureString);
- AppNote(featureString);
- }
-}
-
-void
-ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage)
-{
- if (NS_IsMainThread()) {
- CrashReporter::AppendAppNotesToCrashReport(aMessage);
- } else {
- nsCOMPtr<nsIRunnable> r = new AppendAppNotesRunnable(aMessage);
- NS_DispatchToMainThread(r);
- }
-}
-
-} // end namespace mozilla
-
-#else
-
-namespace mozilla {
-void ScopedGfxFeatureReporter::WriteAppNote(char) {}
-void ScopedGfxFeatureReporter::AppNote(const nsACString&) {}
-
-} // namespace mozilla
-
-#endif
diff --git a/gfx/src/gfxCrashReporterUtils.h b/gfx/src/gfxCrashReporterUtils.h
deleted file mode 100644
index efc5ab1ab..000000000
--- a/gfx/src/gfxCrashReporterUtils.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- 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 gfxCrashReporterUtils_h__
-#define gfxCrashReporterUtils_h__
-
-#include "nsString.h"
-
-namespace mozilla {
-
-/** \class ScopedGfxFeatureReporter
- *
- * On creation, adds "FeatureName?" to AppNotes
- * On destruction, adds "FeatureName-", or "FeatureName+" if you called SetSuccessful().
- *
- * Any such string is added at most once to AppNotes, and is subsequently skipped.
- *
- * This ScopedGfxFeatureReporter class is designed to be fool-proof to use in functions that
- * have many exit points. We don't want to encourage having function with many exit points.
- * It just happens that our graphics features initialization functions are like that.
- */
-class ScopedGfxFeatureReporter
-{
-public:
- explicit ScopedGfxFeatureReporter(const char *aFeature, bool aForce = false)
- : mFeature(aFeature), mStatusChar('-')
- {
- WriteAppNote(aForce ? '!' : '?');
- }
- ~ScopedGfxFeatureReporter() {
- WriteAppNote(mStatusChar);
- }
- void SetSuccessful() { mStatusChar = '+'; }
-
- static void AppNote(const nsACString& aMessage);
-
- class AppNoteWritingRunnable;
-
-protected:
- const char *mFeature;
- char mStatusChar;
-
-private:
- void WriteAppNote(char statusChar);
-};
-
-} // end namespace mozilla
-
-#endif // gfxCrashReporterUtils_h__
diff --git a/gfx/src/moz.build b/gfx/src/moz.build
index 3678eee7a..ea707a340 100644
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -16,7 +16,6 @@ DEFINES['MOZ_APP_VERSION'] = '"%s"' % CONFIG['MOZ_APP_VERSION']
EXPORTS += [
'DriverCrashGuard.h',
'FilterSupport.h',
- 'gfxCrashReporterUtils.h',
'gfxTelemetry.h',
'nsBoundingMetrics.h',
'nsColor.h',
@@ -60,7 +59,6 @@ if CONFIG['MOZ_X11']:
UNIFIED_SOURCES += [
'DriverCrashGuard.cpp',
'FilterSupport.cpp',
- 'gfxCrashReporterUtils.cpp',
'gfxTelemetry.cpp',
'nsColor.cpp',
'nsFont.cpp',
diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp
index c194f40f2..2f2693c76 100644
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -389,7 +389,6 @@ DeviceManagerDx::CreateDevice(IDXGIAdapter* aAdapter,
void
DeviceManagerDx::CreateWARPCompositorDevice()
{
- ScopedGfxFeatureReporter reporterWARP("D3D11-WARP", gfxPrefs::LayersD3D11ForceWARP());
FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING);
HRESULT hr;
@@ -434,7 +433,6 @@ DeviceManagerDx::CreateWARPCompositorDevice()
}
mCompositorDevice->SetExceptionMode(0);
- reporterWARP.SetSuccessful();
}
FeatureStatus
diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h
index ea6dd4846..e29ab0731 100644
--- a/gfx/thebes/DeviceManagerDx.h
+++ b/gfx/thebes/DeviceManagerDx.h
@@ -34,8 +34,6 @@ struct ID3D11Device;
struct IDirectDraw7;
namespace mozilla {
-class ScopedGfxFeatureReporter;
-
namespace gfx {
class FeatureState;
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 4db7bc29f..684117788 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -18,7 +18,6 @@
#include "mozilla/Logging.h"
#include "mozilla/Services.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "gfxEnv.h"
@@ -650,7 +649,6 @@ gfxPlatform::Init()
gfxPrefs::CanvasAzureAccelerated(),
gfxPrefs::DisableGralloc(),
gfxPrefs::ForceShmemTiles());
- ScopedGfxFeatureReporter::AppNote(forcedPrefs);
}
InitMoz2DLogging();
diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp
index c68f622c6..a988859eb 100755
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -33,8 +33,6 @@
#include "nsIGfxInfo.h"
-#include "gfxCrashReporterUtils.h"
-
#include "gfxGDIFontList.h"
#include "gfxGDIFont.h"
@@ -400,7 +398,6 @@ gfxWindowsPlatform::InitDWriteSupport()
return false;
}
- mozilla::ScopedGfxFeatureReporter reporter("DWrite");
decltype(DWriteCreateFactory)* createDWriteFactory = (decltype(DWriteCreateFactory)*)
GetProcAddress(LoadLibraryW(L"dwrite.dll"), "DWriteCreateFactory");
if (!createDWriteFactory) {
@@ -422,7 +419,6 @@ gfxWindowsPlatform::InitDWriteSupport()
Factory::SetDWriteFactory(mDWriteFactory);
SetupClearTypeParams();
- reporter.SetSuccessful();
return true;
}
@@ -1569,8 +1565,6 @@ gfxWindowsPlatform::InitializeD2DConfig()
void
gfxWindowsPlatform::InitializeD2D()
{
- ScopedGfxFeatureReporter d2d1_1("D2D1.1");
-
FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D);
DeviceManagerDx* dm = DeviceManagerDx::Get();
@@ -1621,7 +1615,6 @@ gfxWindowsPlatform::InitializeD2D()
}
MOZ_ASSERT(d2d1.IsEnabled());
- d2d1_1.SetSuccessful();
}
bool
diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h
index f77d9a87a..f401038fc 100644
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -13,7 +13,6 @@
*/
#include "cairo-win32.h"
-#include "gfxCrashReporterUtils.h"
#include "gfxFontUtils.h"
#include "gfxWindowsSurface.h"
#include "gfxFont.h"