Bug 1317637 - Replace default bodies of special member functions with = default; in gfx/.
MozReview-Commit-ID: EWUpBvj5i6Z
--- a/gfx/2d/JobScheduler_posix.cpp
+++ b/gfx/2d/JobScheduler_posix.cpp
@@ -155,18 +155,17 @@ MultiThreadedJobQueue::UnregisterThread(
mShutdownCondvar.Broadcast();
}
}
EventObject::EventObject()
: mIsSet(false)
{}
-EventObject::~EventObject()
-{}
+EventObject::~EventObject() = default;
bool
EventObject::Peak()
{
CriticalSectionAutoEnter lock(&mMutex);
return mIsSet;
}
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -554,19 +554,17 @@ PlanarYCbCrImage::GetAsSourceSurface()
}
NVImage::NVImage()
: Image(nullptr, ImageFormat::NV_IMAGE)
, mBufferSize(0)
{
}
-NVImage::~NVImage()
-{
-}
+NVImage::~NVImage() = default;
IntSize
NVImage::GetSize()
{
return mSize;
}
IntRect
@@ -719,19 +717,17 @@ SourceSurfaceImage::SourceSurfaceImage(c
SourceSurfaceImage::SourceSurfaceImage(gfx::SourceSurface* aSourceSurface)
: Image(nullptr, ImageFormat::CAIRO_SURFACE),
mSize(aSourceSurface->GetSize()),
mSourceSurface(aSourceSurface),
mTextureFlags(TextureFlags::DEFAULT)
{}
-SourceSurfaceImage::~SourceSurfaceImage()
-{
-}
+SourceSurfaceImage::~SourceSurfaceImage() = default;
TextureClient*
SourceSurfaceImage::GetTextureClient(KnowsCompositor* aForwarder)
{
if (!aForwarder) {
return nullptr;
}
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -2205,18 +2205,17 @@ CanvasLayer::CanvasLayer(LayerManager* a
, mPreTransCallback(nullptr)
, mPreTransCallbackData(nullptr)
, mPostTransCallback(nullptr)
, mPostTransCallbackData(nullptr)
, mSamplingFilter(gfx::SamplingFilter::GOOD)
, mDirty(false)
{}
-CanvasLayer::~CanvasLayer()
-{}
+CanvasLayer::~CanvasLayer() = default;
void
CanvasLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
{
Layer::PrintInfo(aStream, aPrefix);
if (mSamplingFilter != SamplingFilter::GOOD) {
AppendToString(aStream, mSamplingFilter, " [filter=", "]");
}
--- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp
@@ -16,18 +16,17 @@ using namespace gfx;
MacIOSurfaceTextureData::MacIOSurfaceTextureData(MacIOSurface* aSurface,
BackendType aBackend)
: mSurface(aSurface)
, mBackend(aBackend)
{
MOZ_ASSERT(mSurface);
}
-MacIOSurfaceTextureData::~MacIOSurfaceTextureData()
-{}
+MacIOSurfaceTextureData::~MacIOSurfaceTextureData() = default;
// static
MacIOSurfaceTextureData*
MacIOSurfaceTextureData::Create(MacIOSurface* aSurface, BackendType aBackend)
{
MOZ_ASSERT(aSurface);
if (!aSurface) {
return nullptr;
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -461,17 +461,17 @@ static_assert(MOZ_ARRAY_LENGTH(sSurfaceM
size_t(gfxSurfaceType::Max), "sSurfaceMemoryReporterAttrs exceeds max capacity");
static_assert(uint32_t(CAIRO_SURFACE_TYPE_SKIA) ==
uint32_t(gfxSurfaceType::Skia), "CAIRO_SURFACE_TYPE_SKIA not equal to gfxSurfaceType::Skia");
/* Surface size memory reporting */
class SurfaceMemoryReporter final : public nsIMemoryReporter
{
- ~SurfaceMemoryReporter() {}
+ ~SurfaceMemoryReporter() = default;
// We can touch this array on several different threads, and we don't
// want to introduce memory barriers when recording the memory used. To
// assure dynamic race checkers like TSan that this is OK, we use
// relaxed memory ordering here.
static Atomic<size_t, Relaxed> sSurfaceMemoryUsed[size_t(gfxSurfaceType::Max)];
public:
--- a/gfx/thebes/gfxDrawable.cpp
+++ b/gfx/thebes/gfxDrawable.cpp
@@ -176,28 +176,26 @@ gfxCallbackDrawable::Draw(gfxContext* aC
gfxPatternDrawable::gfxPatternDrawable(gfxPattern* aPattern,
const IntSize aSize)
: gfxDrawable(aSize)
, mPattern(aPattern)
{
}
-gfxPatternDrawable::~gfxPatternDrawable()
-{
-}
+gfxPatternDrawable::~gfxPatternDrawable() = default;
class DrawingCallbackFromDrawable : public gfxDrawingCallback {
public:
explicit DrawingCallbackFromDrawable(gfxDrawable* aDrawable)
: mDrawable(aDrawable) {
NS_ASSERTION(aDrawable, "aDrawable is null!");
}
- virtual ~DrawingCallbackFromDrawable() {}
+ virtual ~DrawingCallbackFromDrawable() = default;
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const SamplingFilter aSamplingFilter,
const gfxMatrix& aTransform = gfxMatrix())
{
return mDrawable->Draw(aContext, aFillRect, ExtendMode::CLAMP,
aSamplingFilter, 1.0,
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -173,17 +173,17 @@ static void ShutdownCMS();
#include "mozilla/gfx/SourceSurfaceCairo.h"
using namespace mozilla::gfx;
/* Class to listen for pref changes so that chrome code can dynamically
force sRGB as an output profile. See Bug #452125. */
class SRGBOverrideObserver final : public nsIObserver,
public nsSupportsWeakReference
{
- ~SRGBOverrideObserver() {}
+ ~SRGBOverrideObserver() = default;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
};
/// This override of the LogForwarder, initially used for the critical graphics
/// errors, is sending the log to the crash annotations as well, but only
/// if the capacity set with the method below is >= 2. We always retain the
@@ -302,17 +302,17 @@ void CrashStatsLogForwarder::UpdateCrash
if (annotated != NS_OK) {
printf("Crash Annotation %s: %s",
mCrashCriticalKey.get(), message.str().c_str());
}
}
class LogForwarderEvent : public Runnable
{
- virtual ~LogForwarderEvent() {}
+ virtual ~LogForwarderEvent() = default;
NS_DECL_ISUPPORTS_INHERITED
explicit LogForwarderEvent(const nsCString& aMessage) : mMessage(aMessage) {}
NS_IMETHOD Run() override {
MOZ_ASSERT(NS_IsMainThread() && (XRE_IsContentProcess() || XRE_IsGPUProcess()));
@@ -356,17 +356,17 @@ void CrashStatsLogForwarder::Log(const s
nsCOMPtr<nsIRunnable> r1 = new LogForwarderEvent(stringToSend);
NS_DispatchToMainThread(r1);
}
}
}
class CrashTelemetryEvent : public Runnable
{
- virtual ~CrashTelemetryEvent() {}
+ virtual ~CrashTelemetryEvent() = default;
NS_DECL_ISUPPORTS_INHERITED
explicit CrashTelemetryEvent(uint32_t aReason) : mReason(aReason) {}
NS_IMETHOD Run() override {
MOZ_ASSERT(NS_IsMainThread());
Telemetry::Accumulate(Telemetry::GFX_CRASH, mReason);
@@ -442,17 +442,17 @@ static const char* kObservedPrefs[] = {
"gfx.downloadable_fonts.",
"gfx.font_rendering.",
BIDI_NUMERAL_PREF,
nullptr
};
class FontPrefsObserver final : public nsIObserver
{
- ~FontPrefsObserver() {}
+ ~FontPrefsObserver() = default;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
};
NS_IMPL_ISUPPORTS(FontPrefsObserver, nsIObserver)
NS_IMETHODIMP
@@ -467,17 +467,17 @@ FontPrefsObserver::Observe(nsISupports *
NS_ASSERTION(gfxPlatform::GetPlatform(), "the singleton instance has gone");
gfxPlatform::GetPlatform()->FontsPrefsChanged(NS_ConvertUTF16toUTF8(someData).get());
return NS_OK;
}
class MemoryPressureObserver final : public nsIObserver
{
- ~MemoryPressureObserver() {}
+ ~MemoryPressureObserver() = default;
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
};
NS_IMPL_ISUPPORTS(MemoryPressureObserver, nsIObserver)
NS_IMETHODIMP
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -521,19 +521,17 @@ public:
private:
// Manages the display link render thread
CVDisplayLinkRef mDisplayLink;
RefPtr<nsITimer> mTimer;
TimeDuration mVsyncRate;
}; // OSXDisplay
private:
- virtual ~OSXVsyncSource()
- {
- }
+ virtual ~OSXVsyncSource() = default;
OSXDisplay mGlobalDisplay;
}; // OSXVsyncSource
static CVReturn VsyncCallback(CVDisplayLinkRef aDisplayLink,
const CVTimeStamp* aNow,
const CVTimeStamp* aOutputTime,
CVOptionFlags aFlagsIn,