Bug 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 11 Apr 2019 12:36:51 +0000
changeset 469134 884f5dc55873c9345ee945cd6d5427e8ab398071
parent 469133 c8d5854c0ef078fe1f725530c8fc4479abe65b1c
child 469135 cc37bdabd566f3b0e29be2c4bc00eacd585aed0d
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, jrmuizel
bugs1540581
milestone68.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 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel * Remove redundant virtual keywords * Mark all destructors of inheriting classes as virtual for clarity * Mark all classes without virtual destructor as final (exposed errors) * Make destructor virtual where it needed to be (some were missing) * Replace empty ({}) code declaration in header with = default * Remove virtual unused methods I probably missed some, it quickly became a rabbit hole. Differential Revision: https://phabricator.services.mozilla.com/D26060
gfx/2d/2D.h
gfx/2d/Blur.h
gfx/2d/ConvolutionFilter.h
gfx/2d/CriticalSection.h
gfx/2d/DataSourceSurfaceWrapper.h
gfx/2d/DrawCommand.h
gfx/2d/DrawCommands.h
gfx/2d/DrawEventRecorder.h
gfx/2d/DrawTargetCairo.cpp
gfx/2d/DrawTargetCairo.h
gfx/2d/DrawTargetCapture.h
gfx/2d/DrawTargetDual.cpp
gfx/2d/DrawTargetRecording.cpp
gfx/2d/DrawTargetTiled.h
gfx/2d/DrawTargetWrapAndRecord.cpp
gfx/2d/DrawingJob.h
gfx/2d/FilterNodeCapture.h
gfx/2d/FilterNodeD2D1.h
gfx/2d/FilterNodeSoftware.h
gfx/2d/Filters.h
gfx/2d/Helpers.h
gfx/2d/HelpersD2D.h
gfx/2d/JobScheduler.h
gfx/2d/JobScheduler_posix.cpp
gfx/2d/JobScheduler_win32.cpp
gfx/2d/Logging.h
gfx/2d/NativeFontResourceGDI.h
gfx/2d/PathCairo.h
gfx/2d/PathSkia.h
gfx/2d/PatternHelpers.h
gfx/2d/Polygon.h
gfx/2d/RecordedEvent.h
gfx/2d/RecordedEventImpl.h
gfx/2d/Rect.h
gfx/2d/ScaledFontMac.cpp
gfx/2d/SourceSurfaceCairo.h
gfx/2d/SourceSurfaceCapture.h
gfx/2d/SourceSurfaceD2D1.h
gfx/2d/SourceSurfaceSkia.h
gfx/2d/StackArray.h
gfx/2d/Tools.h
gfx/2d/UnscaledFontFreeType.h
gfx/2d/UnscaledFontMac.h
gfx/gl/AndroidNativeWindow.h
gfx/gl/AndroidSurfaceTexture.cpp
gfx/gl/GLContextGLX.h
gfx/gl/GLTextureImage.h
gfx/gl/SharedSurface.h
gfx/gl/SharedSurfaceD3D11Interop.h
gfx/ipc/CompositorOptions.h
gfx/ipc/CrossProcessPaint.h
gfx/ipc/GPUChild.h
gfx/ipc/GPUProcessImpl.h
gfx/ipc/GPUProcessListener.h
gfx/ipc/GPUProcessManager.h
gfx/ipc/RemoteCompositorSession.h
gfx/ipc/VsyncBridgeChild.h
gfx/layers/AnimationHelper.h
gfx/layers/AxisPhysicsMSDModel.h
gfx/layers/AxisPhysicsModel.h
gfx/layers/BSPTree.h
gfx/layers/BufferTexture.h
gfx/layers/CompositionRecorder.h
gfx/layers/Compositor.h
gfx/layers/D3D11ShareHandleImage.h
gfx/layers/D3D11YCbCrImage.cpp
gfx/layers/D3D9SurfaceImage.h
gfx/layers/Effects.h
gfx/layers/GPUVideoImage.h
gfx/layers/IPDLActor.h
gfx/layers/ImageContainer.h
gfx/layers/ImageLayers.h
gfx/layers/LayerMetricsWrapper.h
gfx/layers/LayerScope.cpp
gfx/layers/LayerScope.h
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/LayerTreeInvalidation.h
gfx/layers/LayerUserData.h
gfx/layers/Layers.h
gfx/layers/LayersTypes.h
gfx/layers/PersistentBufferProvider.h
gfx/layers/ReadbackLayer.h
gfx/layers/SourceSurfaceSharedData.h
gfx/layers/SourceSurfaceVolatileData.h
gfx/layers/SyncObject.h
gfx/layers/TextureDIB.h
gfx/layers/TextureSourceProvider.h
gfx/layers/TransactionIdAllocator.h
gfx/layers/apz/public/APZInputBridge.h
gfx/layers/apz/public/CompositorController.h
gfx/layers/apz/public/GeckoContentController.h
gfx/layers/apz/public/IAPZCTreeManager.h
gfx/layers/apz/public/MetricsSharingController.h
gfx/layers/apz/src/APZUtils.h
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/AutoDirWheelDeltaAdjuster.h
gfx/layers/apz/src/Axis.h
gfx/layers/apz/src/CheckerboardEvent.h
gfx/layers/apz/src/HitTestingTreeNode.h
gfx/layers/apz/src/InputBlockState.h
gfx/layers/apz/src/InputQueue.h
gfx/layers/apz/src/Overscroll.h
gfx/layers/apz/util/APZEventState.h
gfx/layers/apz/util/APZThreadUtils.h
gfx/layers/apz/util/ActiveElementManager.h
gfx/layers/apz/util/CheckerboardReportService.h
gfx/layers/apz/util/ChromeProcessController.h
gfx/layers/apz/util/ScrollLinkedEffectDetector.h
gfx/layers/basic/BasicCanvasLayer.h
gfx/layers/basic/BasicColorLayer.cpp
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/basic/BasicCompositor.h
gfx/layers/basic/BasicContainerLayer.h
gfx/layers/basic/BasicImageLayer.cpp
gfx/layers/basic/BasicLayersImpl.h
gfx/layers/basic/BasicPaintedLayer.h
gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
gfx/layers/basic/TextureHostBasic.h
gfx/layers/basic/X11BasicCompositor.h
gfx/layers/client/CanvasClient.h
gfx/layers/client/ClientCanvasLayer.h
gfx/layers/client/ClientColorLayer.cpp
gfx/layers/client/ClientContainerLayer.h
gfx/layers/client/ClientImageLayer.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ClientPaintedLayer.h
gfx/layers/client/ClientReadbackLayer.h
gfx/layers/client/ClientTiledPaintedLayer.h
gfx/layers/client/CompositableClient.h
gfx/layers/client/ContentClient.h
gfx/layers/client/GPUVideoTextureClient.h
gfx/layers/client/ImageClient.h
gfx/layers/client/MultiTiledContentClient.h
gfx/layers/client/SingleTiledContentClient.h
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/client/TextureClientPool.h
gfx/layers/client/TextureClientRecycleAllocator.cpp
gfx/layers/client/TextureClientRecycleAllocator.h
gfx/layers/client/TextureClientSharedSurface.h
gfx/layers/client/TiledContentClient.h
gfx/layers/composite/AsyncCompositionManager.h
gfx/layers/composite/CanvasLayerComposite.h
gfx/layers/composite/ColorLayerComposite.h
gfx/layers/composite/ContainerLayerComposite.h
gfx/layers/composite/ContentHost.h
gfx/layers/composite/FPSCounter.h
gfx/layers/composite/GPUVideoTextureHost.h
gfx/layers/composite/ImageComposite.h
gfx/layers/composite/ImageHost.h
gfx/layers/composite/ImageLayerComposite.h
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/composite/PaintedLayerComposite.h
gfx/layers/composite/TextRenderer.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/composite/TextureHost.h
gfx/layers/composite/TiledContentHost.h
gfx/layers/composite/X11TextureHost.h
gfx/layers/d3d11/CompositorD3D11.h
gfx/layers/d3d11/DeviceAttachmentsD3D11.h
gfx/layers/d3d11/MLGDeviceD3D11.h
gfx/layers/d3d11/TextureD3D11.h
gfx/layers/ipc/APZChild.h
gfx/layers/ipc/CompositorBench.cpp
gfx/layers/ipc/CompositorBridgeChild.h
gfx/layers/ipc/CompositorBridgeParent.h
gfx/layers/ipc/CompositorManagerChild.h
gfx/layers/ipc/CompositorManagerParent.h
gfx/layers/ipc/CompositorVsyncScheduler.h
gfx/layers/ipc/ISurfaceAllocator.h
gfx/layers/ipc/ImageBridgeChild.cpp
gfx/layers/ipc/ImageBridgeChild.h
gfx/layers/ipc/ImageBridgeParent.cpp
gfx/layers/ipc/ImageBridgeParent.h
gfx/layers/ipc/KnowsCompositor.h
gfx/layers/ipc/LayerTransactionChild.h
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/LayerTransactionParent.h
gfx/layers/ipc/RemoteContentController.h
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/ShadowLayers.h
gfx/layers/ipc/SharedSurfacesChild.h
gfx/layers/ipc/SynchronousTask.h
gfx/layers/ipc/TextureForwarder.h
gfx/layers/ipc/UiCompositorControllerChild.h
gfx/layers/ipc/UiCompositorControllerParent.h
gfx/layers/ipc/VideoBridgeChild.h
gfx/layers/mlgpu/BufferCache.h
gfx/layers/mlgpu/CanvasLayerMLGPU.h
gfx/layers/mlgpu/ContainerLayerMLGPU.h
gfx/layers/mlgpu/ImageLayerMLGPU.h
gfx/layers/mlgpu/LayerMLGPU.h
gfx/layers/mlgpu/LayerManagerMLGPU.cpp
gfx/layers/mlgpu/LayerManagerMLGPU.h
gfx/layers/mlgpu/MLGDevice.h
gfx/layers/mlgpu/MLGPUScreenshotGrabber.cpp
gfx/layers/mlgpu/MLGPUScreenshotGrabber.h
gfx/layers/mlgpu/MaskOperation.h
gfx/layers/mlgpu/PaintedLayerMLGPU.h
gfx/layers/mlgpu/RenderPassMLGPU.h
gfx/layers/mlgpu/ShaderDefinitionsMLGPU.h
gfx/layers/mlgpu/TextureSourceProviderMLGPU.h
gfx/layers/mlgpu/TexturedLayerMLGPU.h
gfx/layers/opengl/CompositingRenderTargetOGL.h
gfx/layers/opengl/CompositorOGL.cpp
gfx/layers/opengl/CompositorOGL.h
gfx/layers/opengl/GLManager.cpp
gfx/layers/opengl/GLManager.h
gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
gfx/layers/opengl/TextureClientOGL.h
gfx/layers/opengl/TextureHostOGL.h
gfx/layers/opengl/X11TextureSourceOGL.h
gfx/layers/wr/WebRenderBridgeChild.h
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.h
gfx/layers/wr/WebRenderCommandBuilder.cpp
gfx/layers/wr/WebRenderCommandBuilder.h
gfx/layers/wr/WebRenderDrawEventRecorder.h
gfx/layers/wr/WebRenderImageHost.h
gfx/layers/wr/WebRenderLayerManager.h
gfx/layers/wr/WebRenderScrollData.cpp
gfx/layers/wr/WebRenderScrollData.h
gfx/layers/wr/WebRenderScrollDataWrapper.h
gfx/layers/wr/WebRenderTextureHost.h
gfx/layers/wr/WebRenderUserData.h
gfx/src/gfxCrashReporterUtils.cpp
gfx/src/nsFont.cpp
gfx/src/nsFont.h
gfx/src/nsRegion.h
gfx/tests/gtest/TestArena.cpp
gfx/tests/gtest/TestLayers.h
gfx/thebes/PrintTargetPDF.h
gfx/thebes/PrintTargetPS.h
gfx/thebes/PrintTargetRecording.h
gfx/thebes/PrintTargetSkPDF.h
gfx/thebes/PrintTargetThebes.h
gfx/thebes/PrintTargetWindows.h
gfx/thebes/SoftwareVsyncSource.h
gfx/thebes/VsyncSource.h
gfx/thebes/gfxASurface.h
gfx/thebes/gfxAndroidPlatform.cpp
gfx/thebes/gfxAndroidPlatform.h
gfx/thebes/gfxBlur.cpp
gfx/thebes/gfxBlur.h
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxDWriteFontList.h
gfx/thebes/gfxDWriteFonts.h
gfx/thebes/gfxDrawable.cpp
gfx/thebes/gfxDrawable.h
gfx/thebes/gfxFT2FontBase.h
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFT2FontList.h
gfx/thebes/gfxFT2Fonts.h
gfx/thebes/gfxFcPlatformFontList.h
gfx/thebes/gfxFont.h
gfx/thebes/gfxFontInfoLoader.cpp
gfx/thebes/gfxFontInfoLoader.h
gfx/thebes/gfxGDIFont.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatformFontList.h
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxPlatformGtk.h
gfx/thebes/gfxPlatformMac.cpp
gfx/thebes/gfxPlatformMac.h
gfx/thebes/gfxSVGGlyphs.h
gfx/thebes/gfxUserFontSet.h
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxWindowsPlatform.h
gfx/thebes/gfxXlibSurface.h
gfx/vr/gfxVRExternal.h
gfx/vr/gfxVRPuppet.h
gfx/webrender_bindings/RenderAndroidSurfaceTextureHostOGL.h
gfx/webrender_bindings/RenderD3D11TextureHostOGL.h
gfx/webrender_bindings/RenderEGLImageTextureHost.h
gfx/webrender_bindings/RenderMacIOSurfaceTextureHostOGL.h
gfx/webrender_bindings/RenderSharedSurfaceTextureHost.h
gfx/webrender_bindings/RenderTextureHostWrapper.h
gfx/webrender_bindings/RenderThread.h
gfx/webrender_bindings/WebRenderAPI.cpp
gfx/webrender_bindings/WebRenderAPI.h
gfx/webrender_bindings/WebRenderTypes.h
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -189,67 +189,65 @@ struct DrawSurfaceOptions {
 /**
  * This class is used to store gradient stops, it can only be used with a
  * matching DrawTarget. Not adhering to this condition will make a draw call
  * fail.
  */
 class GradientStops : public external::AtomicRefCounted<GradientStops> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStops)
-  virtual ~GradientStops() {}
+  virtual ~GradientStops() = default;
 
   virtual BackendType GetBackendType() const = 0;
   virtual bool IsValid() const { return true; }
 
  protected:
   GradientStops() {}
 };
 
 /**
  * This is the base class for 'patterns'. Patterns describe the pixels used as
  * the source for a masked composition operation that is done by the different
  * drawing commands. These objects are not backend specific, however for
  * example the gradient stops on a gradient pattern can be backend specific.
  */
 class Pattern {
  public:
-  virtual ~Pattern() {}
+  virtual ~Pattern() = default;
 
   virtual PatternType GetType() const = 0;
 
  protected:
-  Pattern() {}
+  Pattern() = default;
 };
 
 class ColorPattern : public Pattern {
  public:
   // Explicit because consumers should generally use ToDeviceColor when
   // creating a ColorPattern.
   explicit ColorPattern(const Color &aColor) : mColor(aColor) {}
 
-  virtual PatternType GetType() const override { return PatternType::COLOR; }
+  PatternType GetType() const override { return PatternType::COLOR; }
 
   Color mColor;
 };
 
 /**
  * This class is used for Linear Gradient Patterns, the gradient stops are
  * stored in a separate object and are backend dependent. This class itself
  * may be used on the stack.
  */
 class LinearGradientPattern : public Pattern {
  public:
   /// For constructor parameter description, see member data documentation.
   LinearGradientPattern(const Point &aBegin, const Point &aEnd,
                         GradientStops *aStops, const Matrix &aMatrix = Matrix())
       : mBegin(aBegin), mEnd(aEnd), mStops(aStops), mMatrix(aMatrix) {}
 
-  virtual PatternType GetType() const override {
-    return PatternType::LINEAR_GRADIENT;
-  }
+  PatternType GetType() const override { return PatternType::LINEAR_GRADIENT; }
 
   Point mBegin;  //!< Start of the linear gradient
   Point mEnd;    /**< End of the linear gradient - NOTE: In the case
                       of a zero length gradient it will act as the
                       color of the last stop. */
   RefPtr<GradientStops>
       mStops;     /**< GradientStops object for this gradient, this
                        should match the backend type of the draw
@@ -271,19 +269,17 @@ class RadialGradientPattern : public Pat
                         const Matrix &aMatrix = Matrix())
       : mCenter1(aCenter1),
         mCenter2(aCenter2),
         mRadius1(aRadius1),
         mRadius2(aRadius2),
         mStops(aStops),
         mMatrix(aMatrix) {}
 
-  virtual PatternType GetType() const override {
-    return PatternType::RADIAL_GRADIENT;
-  }
+  PatternType GetType() const override { return PatternType::RADIAL_GRADIENT; }
 
   Point mCenter1;  //!< Center of the inner (focal) circle.
   Point mCenter2;  //!< Center of the outer circle.
   Float mRadius1;  //!< Radius of the inner (focal) circle.
   Float mRadius2;  //!< Radius of the outer circle.
   RefPtr<GradientStops>
       mStops;      /**< GradientStops object for this gradient, this
                         should match the backend type of the draw target
@@ -303,17 +299,17 @@ class SurfacePattern : public Pattern {
                  SamplingFilter aSamplingFilter = SamplingFilter::GOOD,
                  const IntRect &aSamplingRect = IntRect())
       : mSurface(aSourceSurface),
         mExtendMode(aExtendMode),
         mSamplingFilter(aSamplingFilter),
         mMatrix(aMatrix),
         mSamplingRect(aSamplingRect) {}
 
-  virtual PatternType GetType() const override { return PatternType::SURFACE; }
+  PatternType GetType() const override { return PatternType::SURFACE; }
 
   RefPtr<SourceSurface> mSurface;  //!< Surface to use for drawing
   ExtendMode mExtendMode; /**< This determines how the image is extended
                                outside the bounds of the image */
   SamplingFilter
       mSamplingFilter;  //!< Resampling filter for resampling the image.
   Matrix mMatrix;       //!< Transforms the pattern into user space
 
@@ -333,17 +329,17 @@ class DrawTargetCaptureImpl;
  * Although SourceSurface has thread-safe refcount, some SourceSurface cannot
  * be used on random threads at the same time. Only DataSourceSurface can be
  * used on random threads now. This will be fixed in the future. Eventually
  * all SourceSurface should be thread-safe.
  */
 class SourceSurface : public external::AtomicRefCounted<SourceSurface> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurface)
-  virtual ~SourceSurface() {}
+  virtual ~SourceSurface() = default;
 
   virtual SurfaceType GetType() const = 0;
   virtual IntSize GetSize() const = 0;
   /* GetRect is useful for when the underlying surface doesn't actually
    * have a backing store starting at 0, 0. e.g. SourceSurfaceOffset */
   virtual IntRect GetRect() const { return IntRect(IntPoint(0, 0), GetSize()); }
   virtual SurfaceFormat GetFormat() const = 0;
 
@@ -424,17 +420,17 @@ class DataSourceSurface : public SourceS
    * This is a scoped version of Map(). Map() is called in the constructor and
    * Unmap() in the destructor. Use this for automatic unmapping of your data
    * surfaces.
    *
    * Use IsMapped() to verify whether Map() succeeded or not.
    */
   class ScopedMap final {
    public:
-    explicit ScopedMap(DataSourceSurface *aSurface, MapType aType)
+    ScopedMap(DataSourceSurface *aSurface, MapType aType)
         : mSurface(aSurface), mIsMapped(aSurface->Map(aType, &mMap)) {}
 
     ScopedMap(ScopedMap &&aOther)
         : mSurface(std::move(aOther.mSurface)),
           mMap(aOther.mMap),
           mIsMapped(aOther.mIsMapped) {
       aOther.mMap.mData = nullptr;
       aOther.mIsMapped = false;
@@ -479,17 +475,17 @@ class DataSourceSurface : public SourceS
     ScopedMap(const ScopedMap &aOther) = delete;
     ScopedMap &operator=(const ScopedMap &aOther) = delete;
 
     RefPtr<DataSourceSurface> mSurface;
     MappedSurface mMap;
     bool mIsMapped;
   };
 
-  virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
+  SurfaceType GetType() const override { return SurfaceType::DATA; }
   /** @deprecated
    * Get the raw bitmap data of the surface.
    * Can return null if there was OOM allocating surface data.
    *
    * Deprecated means you shouldn't be using this!! Use Map instead.
    * Please deny any reviews which add calls to this!
    */
   virtual uint8_t *GetData() = 0;
@@ -530,17 +526,17 @@ class DataSourceSurface : public SourceS
 
   /**
    * Returns a DataSourceSurface with the same data as this one, but
    * guaranteed to have surface->GetType() == SurfaceType::DATA.
    *
    * The returning surface might be null, because of OOM or gfx device reset.
    * The caller needs to do null-check before using it.
    */
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
+  already_AddRefed<DataSourceSurface> GetDataSurface() override;
 
   /**
    * Add the size of the underlying data buffer to the aggregate.
    */
   virtual void AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
                                       size_t &aHeapSizeOut,
                                       size_t &aNonHeapSizeOut,
                                       size_t &aExtHandlesOut,
@@ -565,17 +561,17 @@ class DataSourceSurface : public SourceS
  protected:
   Atomic<int32_t> mMapCount;
 };
 
 /** This is an abstract object that accepts path segments. */
 class PathSink : public RefCounted<PathSink> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSink)
-  virtual ~PathSink() {}
+  virtual ~PathSink() = default;
 
   /** Move the current point in the path, any figure currently being drawn will
    * be considered closed during fill operations, however when stroking the
    * closing line segment will not be drawn.
    */
   virtual void MoveTo(const Point &aPoint) = 0;
   /** Add a linesegment to the current figure */
   virtual void LineTo(const Point &aPoint) = 0;
@@ -889,34 +885,34 @@ class NativeFontResource
    *                      data.
    * @param aInstanceDataLength the size of the instance data.
    * @return an already_addrefed UnscaledFont, containing nullptr if failed.
    */
   virtual already_AddRefed<UnscaledFont> CreateUnscaledFont(
       uint32_t aIndex, const uint8_t *aInstanceData,
       uint32_t aInstanceDataLength) = 0;
 
-  virtual ~NativeFontResource() {}
+  virtual ~NativeFontResource() = default;
 };
 
 class DrawTargetCapture;
 
 /** This is the main class used for all the drawing. It is created through the
  * factory and accepts drawing commands. The results of drawing to a target
  * may be used either through a Snapshot or by flushing the target and directly
  * accessing the backing store a DrawTarget was created with.
  */
 class DrawTarget : public external::AtomicRefCounted<DrawTarget> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTarget)
   DrawTarget()
       : mTransformDirty(false),
         mPermitSubpixelAA(false),
         mFormat(SurfaceFormat::UNKNOWN) {}
-  virtual ~DrawTarget() {}
+  virtual ~DrawTarget() = default;
 
   virtual bool IsValid() const { return true; };
   virtual DrawTargetType GetType() const = 0;
 
   virtual BackendType GetBackendType() const = 0;
 
   virtual bool IsRecording() const { return false; }
   virtual bool IsCaptureDT() const { return false; }
@@ -1514,28 +1510,28 @@ class DrawTarget : public external::Atom
   bool mTransformDirty : 1;
   bool mPermitSubpixelAA : 1;
 
   SurfaceFormat mFormat;
 };
 
 class DrawTargetCapture : public DrawTarget {
  public:
-  virtual bool IsCaptureDT() const override { return true; }
+  bool IsCaptureDT() const override { return true; }
 
   virtual bool IsEmpty() const = 0;
   virtual void Dump() = 0;
 };
 
 class DrawEventRecorder : public RefCounted<DrawEventRecorder> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorder)
   // returns true if there were any items in the recording
   virtual bool Finish() = 0;
-  virtual ~DrawEventRecorder() {}
+  virtual ~DrawEventRecorder() = default;
 };
 
 struct Tile {
   RefPtr<DrawTarget> mDrawTarget;
   IntPoint mTileOrigin;
 };
 
 struct TileSet {
--- a/gfx/2d/Blur.h
+++ b/gfx/2d/Blur.h
@@ -31,17 +31,17 @@ namespace gfx {
  * channel context.
  * The callers are responsible for creating and managing the backing surface
  * and passing the pointer to the data to the Blur() method.  This class does
  * not retain the pointer to the data outside of the Blur() call.
  *
  * A spread N makes each output pixel the maximum value of all source
  * pixels within a square of side length 2N+1 centered on the output pixel.
  */
-class GFX2D_API AlphaBoxBlur {
+class GFX2D_API AlphaBoxBlur final {
  public:
   /** Constructs a box blur and computes the backing surface size.
    *
    * @param aRect The coordinates of the surface to create in device units.
    *
    * @param aBlurRadius The blur radius in pixels.  This is the radius of the
    *   entire (triple) kernel function.  Each individual box blur has radius
    *   approximately 1/3 this value, or diameter approximately 2/3 this value.
--- a/gfx/2d/ConvolutionFilter.h
+++ b/gfx/2d/ConvolutionFilter.h
@@ -9,17 +9,17 @@
 
 #include "mozilla/UniquePtr.h"
 
 class SkConvolutionFilter1D;
 
 namespace mozilla {
 namespace gfx {
 
-class ConvolutionFilter {
+class ConvolutionFilter final {
  public:
   ConvolutionFilter();
   ~ConvolutionFilter();
 
   int32_t MaxFilter() const;
   int32_t NumValues() const;
 
   bool GetFilterOffsetAndLength(int32_t aRowIndex, int32_t* aResultOffset,
--- a/gfx/2d/CriticalSection.h
+++ b/gfx/2d/CriticalSection.h
@@ -62,17 +62,17 @@ class CriticalSection {
  protected:
   pthread_mutex_t mMutex;
   friend class PosixCondVar;
 };
 
 #endif
 
 /// RAII helper.
-struct CriticalSectionAutoEnter {
+struct CriticalSectionAutoEnter final {
   explicit CriticalSectionAutoEnter(CriticalSection* aSection)
       : mSection(aSection) {
     mSection->Enter();
   }
   ~CriticalSectionAutoEnter() { mSection->Leave(); }
 
  protected:
   CriticalSection* mSection;
--- a/gfx/2d/DataSourceSurfaceWrapper.h
+++ b/gfx/2d/DataSourceSurfaceWrapper.h
@@ -20,25 +20,23 @@ class DataSourceSurfaceWrapper final : p
   explicit DataSourceSurfaceWrapper(DataSourceSurface *aSurface)
       : mSurface(aSurface) {}
 
   bool Equals(SourceSurface *aOther, bool aSymmetric = true) override {
     return DataSourceSurface::Equals(aOther, aSymmetric) ||
            mSurface->Equals(aOther, aSymmetric);
   }
 
-  virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
+  SurfaceType GetType() const override { return SurfaceType::DATA; }
 
-  virtual uint8_t *GetData() override { return mSurface->GetData(); }
-  virtual int32_t Stride() override { return mSurface->Stride(); }
-  virtual IntSize GetSize() const override { return mSurface->GetSize(); }
-  virtual SurfaceFormat GetFormat() const override {
-    return mSurface->GetFormat();
-  }
-  virtual bool IsValid() const override { return mSurface->IsValid(); }
+  uint8_t *GetData() override { return mSurface->GetData(); }
+  int32_t Stride() override { return mSurface->Stride(); }
+  IntSize GetSize() const override { return mSurface->GetSize(); }
+  SurfaceFormat GetFormat() const override { return mSurface->GetFormat(); }
+  bool IsValid() const override { return mSurface->IsValid(); }
 
   bool Map(MapType aType, MappedSurface *aMappedSurface) override {
     return mSurface->Map(aType, aMappedSurface);
   }
 
   void Unmap() override { mSurface->Unmap(); }
 
  private:
--- a/gfx/2d/DrawCommand.h
+++ b/gfx/2d/DrawCommand.h
@@ -47,17 +47,17 @@ enum class CommandType : int8_t {
   SETPERMITSUBPIXELAA,
   FLUSH,
   BLUR,
   PADEDGES,
 };
 
 class DrawingCommand {
  public:
-  virtual ~DrawingCommand() {}
+  virtual ~DrawingCommand() = default;
 
   virtual CommandType GetType() const = 0;
   virtual void ExecuteOnDT(DrawTarget* aDT,
                            const Matrix* aTransform = nullptr) const = 0;
   virtual void CloneInto(CaptureCommandList* aList) = 0;
   virtual void Log(TreeLog<>& aLog) const = 0;
 };
 
--- a/gfx/2d/DrawCommands.h
+++ b/gfx/2d/DrawCommands.h
@@ -33,17 +33,17 @@ class StrokeOptionsCommand : public Draw
     if (aStrokeOptions.mDashLength) {
       mDashes.resize(aStrokeOptions.mDashLength);
       mStrokeOptions.mDashPattern = &mDashes.front();
       PodCopy(&mDashes.front(), aStrokeOptions.mDashPattern,
               mStrokeOptions.mDashLength);
     }
   }
 
-  virtual ~StrokeOptionsCommand() {}
+  virtual ~StrokeOptionsCommand() = default;
 
  protected:
   StrokeOptions mStrokeOptions;
   std::vector<Float> mDashes;
 };
 
 class StoredPattern {
  public:
@@ -862,18 +862,17 @@ class SetTransformCommand : public Drawi
       : mTransform(aTransform) {}
 
   CommandType GetType() const override { return SetTransformCommand::Type; }
 
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(SetTransformCommand)(mTransform);
   }
 
-  virtual void ExecuteOnDT(DrawTarget* aDT,
-                           const Matrix* aMatrix) const override {
+  void ExecuteOnDT(DrawTarget* aDT, const Matrix* aMatrix) const override {
     if (aMatrix) {
       aDT->SetTransform(mTransform * (*aMatrix));
     } else {
       aDT->SetTransform(mTransform);
     }
   }
 
   void Log(TreeLog<>& aStream) const override {
@@ -897,18 +896,17 @@ class SetPermitSubpixelAACommand : publi
   CommandType GetType() const override {
     return SetPermitSubpixelAACommand::Type;
   }
 
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(SetPermitSubpixelAACommand)(mPermitSubpixelAA);
   }
 
-  virtual void ExecuteOnDT(DrawTarget* aDT,
-                           const Matrix* aMatrix) const override {
+  void ExecuteOnDT(DrawTarget* aDT, const Matrix* aMatrix) const override {
     aDT->SetPermitSubpixelAA(mPermitSubpixelAA);
   }
 
   void Log(TreeLog<>& aStream) const override {
     aStream << "[SetPermitSubpixelAA permitSubpixelAA=" << mPermitSubpixelAA
             << "]";
   }
 
@@ -916,17 +914,17 @@ class SetPermitSubpixelAACommand : publi
   static const CommandType Type = CommandType::SETPERMITSUBPIXELAA;
 
  private:
   bool mPermitSubpixelAA;
 };
 
 class FlushCommand : public DrawingCommand {
  public:
-  explicit FlushCommand() {}
+  FlushCommand() = default;
 
   CommandType GetType() const override { return FlushCommand::Type; }
 
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(FlushCommand)();
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
--- a/gfx/2d/DrawEventRecorder.h
+++ b/gfx/2d/DrawEventRecorder.h
@@ -24,18 +24,18 @@ namespace gfx {
 
 class PathRecording;
 
 class DrawEventRecorderPrivate : public DrawEventRecorder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderPrivate, override)
 
   DrawEventRecorderPrivate();
-  virtual ~DrawEventRecorderPrivate() {}
-  virtual bool Finish() override {
+  virtual ~DrawEventRecorderPrivate() = default;
+  bool Finish() override {
     ClearResources();
     return true;
   }
   virtual void FlushItem(IntRect) {}
   void DetachResources() {
     // The iteration is a bit awkward here because our iterator will
     // be invalidated by the removal
     for (auto font = mStoredFonts.begin(); font != mStoredFonts.end();) {
@@ -131,17 +131,17 @@ class DrawEventRecorderPrivate : public 
 };
 
 class DrawEventRecorderFile : public DrawEventRecorderPrivate {
   using char_type = filesystem::Path::value_type;
 
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderFile, override)
   explicit DrawEventRecorderFile(const char_type* aFilename);
-  ~DrawEventRecorderFile();
+  virtual ~DrawEventRecorderFile();
 
   void RecordEvent(const RecordedEvent& aEvent) override;
 
   /**
    * Returns whether a recording file is currently open.
    */
   bool IsOpen();
 
@@ -206,17 +206,17 @@ class DrawEventRecorderMemory : public D
    * ItemIndex { size_t dataEnd; size_t extraDataEnd; }
    * It gets concatenated to the end of mOutputStream in Finish()
    * The last size_t in the stream is offset of the begining of the
    * index.
    */
   MemStream mIndex;
 
  protected:
-  ~DrawEventRecorderMemory(){};
+  virtual ~DrawEventRecorderMemory(){};
 
  private:
   SerializeResourcesFn mSerializeCallback;
   nsTHashtable<nsUint64HashKey> mDependentSurfaces;
 
   void Flush() override;
 };
 
--- a/gfx/2d/DrawTargetCairo.cpp
+++ b/gfx/2d/DrawTargetCairo.cpp
@@ -382,17 +382,17 @@ static cairo_surface_t* GetCairoSurfaceF
   cairo_surface_set_user_data(surf, &surfaceDataKey, data.forget().take(),
                               ReleaseData);
   return surf;
 }
 
 // An RAII class to temporarily clear any device offset set
 // on a surface. Note that this does not take a reference to the
 // surface.
-class AutoClearDeviceOffset {
+class AutoClearDeviceOffset final {
  public:
   explicit AutoClearDeviceOffset(SourceSurface* aSurface)
       : mSurface(nullptr), mX(0), mY(0) {
     Init(aSurface);
   }
 
   explicit AutoClearDeviceOffset(const Pattern& aPattern)
       : mSurface(nullptr), mX(0.0), mY(0.0) {
--- a/gfx/2d/DrawTargetCairo.h
+++ b/gfx/2d/DrawTargetCairo.h
@@ -25,17 +25,17 @@ class GradientStopsCairo : public Gradie
   GradientStopsCairo(GradientStop *aStops, uint32_t aNumStops,
                      ExtendMode aExtendMode)
       : mExtendMode(aExtendMode) {
     for (uint32_t i = 0; i < aNumStops; ++i) {
       mStops.push_back(aStops[i]);
     }
   }
 
-  virtual ~GradientStopsCairo() {}
+  virtual ~GradientStopsCairo() = default;
 
   const std::vector<GradientStop> &GetStops() const { return mStops; }
 
   ExtendMode GetExtendMode() const { return mExtendMode; }
 
   virtual BackendType GetBackendType() const override {
     return BackendType::CAIRO;
   }
--- a/gfx/2d/DrawTargetCapture.h
+++ b/gfx/2d/DrawTargetCapture.h
@@ -14,129 +14,125 @@
 
 namespace mozilla {
 namespace gfx {
 
 class DrawingCommand;
 class SourceSurfaceCapture;
 class AlphaBoxBlur;
 
-class DrawTargetCaptureImpl : public DrawTargetCapture {
+class DrawTargetCaptureImpl final : public DrawTargetCapture {
   friend class SourceSurfaceCapture;
 
  public:
   DrawTargetCaptureImpl(gfx::DrawTarget *aTarget, size_t aFlushBytes);
   DrawTargetCaptureImpl(BackendType aBackend, const IntSize &aSize,
                         SurfaceFormat aFormat);
 
   bool Init(const IntSize &aSize, DrawTarget *aRefDT);
   void InitForData(int32_t aStride, size_t aSurfaceAllocationSize);
 
-  virtual BackendType GetBackendType() const override {
+  BackendType GetBackendType() const override {
     return mRefDT->GetBackendType();
   }
-  virtual DrawTargetType GetType() const override { return mRefDT->GetType(); }
-  virtual bool IsCaptureDT() const override { return true; }
-  virtual already_AddRefed<SourceSurface> Snapshot() override;
-  virtual already_AddRefed<SourceSurface> IntoLuminanceSource(
+  DrawTargetType GetType() const override { return mRefDT->GetType(); }
+  bool IsCaptureDT() const override { return true; }
+  already_AddRefed<SourceSurface> Snapshot() override;
+  already_AddRefed<SourceSurface> IntoLuminanceSource(
       LuminanceType aLuminanceType, float aOpacity) override;
-  virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
-  virtual void DetachAllSnapshots() override;
-  virtual IntSize GetSize() const override { return mSize; }
-  virtual void Flush() override {}
-  virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
-                           const Rect &aSource,
-                           const DrawSurfaceOptions &aSurfOptions,
-                           const DrawOptions &aOptions) override;
-  virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
-                          const Point &aDestPoint,
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void DrawSurfaceWithShadow(SourceSurface *aSurface,
-                                     const Point &aDest, const Color &aColor,
-                                     const Point &aOffset, Float aSigma,
-                                     CompositionOp aOperator) override;
+  void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
+  void DetachAllSnapshots() override;
+  IntSize GetSize() const override { return mSize; }
+  void Flush() override {}
+  void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
+                   const Rect &aSource, const DrawSurfaceOptions &aSurfOptions,
+                   const DrawOptions &aOptions) override;
+  void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
+                  const Point &aDestPoint,
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void DrawSurfaceWithShadow(SourceSurface *aSurface, const Point &aDest,
+                             const Color &aColor, const Point &aOffset,
+                             Float aSigma, CompositionOp aOperator) override;
 
-  virtual void ClearRect(const Rect &aRect) override;
-  virtual void MaskSurface(
-      const Pattern &aSource, SourceSurface *aMask, Point aOffset,
-      const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
-                           const IntPoint &aDestination) override;
-  virtual void CopyRect(const IntRect &aSourceRect,
-                        const IntPoint &aDestination) override;
+  void ClearRect(const Rect &aRect) override;
+  void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset,
+                   const DrawOptions &aOptions = DrawOptions()) override;
+  void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
+                   const IntPoint &aDestination) override;
+  void CopyRect(const IntRect &aSourceRect,
+                const IntPoint &aDestination) override;
 
-  virtual void FillRect(const Rect &aRect, const Pattern &aPattern,
-                        const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void FillRoundedRect(
-      const RoundedRect &aRect, const Pattern &aPattern,
-      const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern,
-                          const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void StrokeLine(const Point &aStart, const Point &aEnd,
-                          const Pattern &aPattern,
-                          const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Stroke(const Path *aPath, const Pattern &aPattern,
-                      const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                      const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Fill(const Path *aPath, const Pattern &aPattern,
+  void FillRect(const Rect &aRect, const Pattern &aPattern,
+                const DrawOptions &aOptions = DrawOptions()) override;
+  void FillRoundedRect(const RoundedRect &aRect, const Pattern &aPattern,
+                       const DrawOptions &aOptions = DrawOptions()) override;
+  void StrokeRect(const Rect &aRect, const Pattern &aPattern,
+                  const StrokeOptions &aStrokeOptions = StrokeOptions(),
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void StrokeLine(const Point &aStart, const Point &aEnd,
+                  const Pattern &aPattern,
+                  const StrokeOptions &aStrokeOptions = StrokeOptions(),
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void Stroke(const Path *aPath, const Pattern &aPattern,
+              const StrokeOptions &aStrokeOptions = StrokeOptions(),
+              const DrawOptions &aOptions = DrawOptions()) override;
+  void Fill(const Path *aPath, const Pattern &aPattern,
+            const DrawOptions &aOptions = DrawOptions()) override;
+  void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
+                  const Pattern &aPattern,
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void StrokeGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
+                    const Pattern &aPattern,
+                    const StrokeOptions &aStrokeOptions = StrokeOptions(),
                     const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
-                          const Pattern &aPattern,
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void StrokeGlyphs(
-      ScaledFont *aFont, const GlyphBuffer &aBuffer, const Pattern &aPattern,
-      const StrokeOptions &aStrokeOptions = StrokeOptions(),
-      const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Mask(const Pattern &aSource, const Pattern &aMask,
-                    const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void PushClip(const Path *aPath) override;
-  virtual void PushClipRect(const Rect &aRect) override;
-  virtual void PopClip() override;
-  virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
-                         const Matrix &aMaskTransform, const IntRect &aBounds,
-                         bool aCopyBackground) override;
-  virtual void PopLayer() override;
-  virtual void Blur(const AlphaBoxBlur &aBlur) override;
-  virtual void PadEdges(const IntRegion &aRegion) override;
+  void Mask(const Pattern &aSource, const Pattern &aMask,
+            const DrawOptions &aOptions = DrawOptions()) override;
+  void PushClip(const Path *aPath) override;
+  void PushClipRect(const Rect &aRect) override;
+  void PopClip() override;
+  void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
+                 const Matrix &aMaskTransform, const IntRect &aBounds,
+                 bool aCopyBackground) override;
+  void PopLayer() override;
+  void Blur(const AlphaBoxBlur &aBlur) override;
+  void PadEdges(const IntRegion &aRegion) override;
 
-  virtual void SetTransform(const Matrix &aTransform) override;
+  void SetTransform(const Matrix &aTransform) override;
 
-  virtual bool SupportsRegionClipping() const override {
+  bool SupportsRegionClipping() const override {
     return mRefDT->SupportsRegionClipping();
   }
 
-  virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
+  already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
       unsigned char *aData, const IntSize &aSize, int32_t aStride,
       SurfaceFormat aFormat) const override {
     return mRefDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat);
   }
-  virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(
+  already_AddRefed<SourceSurface> OptimizeSourceSurface(
       SourceSurface *aSurface) const override;
 
-  virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
+  already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
       const NativeSurface &aSurface) const override {
     return mRefDT->CreateSourceSurfaceFromNativeSurface(aSurface);
   }
 
-  virtual already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
+  already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
       const IntSize &aSize, SurfaceFormat aFormat) const override;
-  virtual RefPtr<DrawTarget> CreateSimilarRasterTarget(
+  RefPtr<DrawTarget> CreateSimilarRasterTarget(
       const IntSize &aSize, SurfaceFormat aFormat) const override;
 
-  virtual already_AddRefed<PathBuilder> CreatePathBuilder(
+  already_AddRefed<PathBuilder> CreatePathBuilder(
       FillRule aFillRule = FillRule::FILL_WINDING) const override;
 
-  virtual already_AddRefed<GradientStops> CreateGradientStops(
+  already_AddRefed<GradientStops> CreateGradientStops(
       GradientStop *aStops, uint32_t aNumStops,
       ExtendMode aExtendMode = ExtendMode::CLAMP) const override {
     return mRefDT->CreateGradientStops(aStops, aNumStops, aExtendMode);
   }
-  virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
+  already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
 
   void ReplayToDrawTarget(DrawTarget *aDT, const Matrix &aTransform);
 
   bool IsEmpty() const override;
   void Dump() override;
 
  protected:
   virtual ~DrawTargetCaptureImpl();
--- a/gfx/2d/DrawTargetDual.cpp
+++ b/gfx/2d/DrawTargetDual.cpp
@@ -32,17 +32,17 @@ class DualSurface {
   SourceSurface *mA;
   SourceSurface *mB;
 };
 
 /* This only needs to split patterns up for SurfacePatterns. Only in that
  * case can we be dealing with a 'dual' source (SourceSurfaceDual) and do
  * we need to pass separate patterns into our destination DrawTargets.
  */
-class DualPattern {
+class DualPattern final {
  public:
   inline explicit DualPattern(const Pattern &aPattern)
       : mPatternsInitialized(false) {
     if (aPattern.GetType() != PatternType::SURFACE) {
       mA = mB = &aPattern;
       return;
     }
 
--- a/gfx/2d/DrawTargetRecording.cpp
+++ b/gfx/2d/DrawTargetRecording.cpp
@@ -64,22 +64,20 @@ class SourceSurfaceRecording : public So
   }
 
   ~SourceSurfaceRecording() {
     mRecorder->RemoveStoredObject(this);
     mRecorder->RecordEvent(
         RecordedSourceSurfaceDestruction(ReferencePtr(this)));
   }
 
-  virtual SurfaceType GetType() const override {
-    return SurfaceType::RECORDING;
-  }
-  virtual IntSize GetSize() const override { return mSize; }
-  virtual SurfaceFormat GetFormat() const override { return mFormat; }
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
+  SurfaceType GetType() const override { return SurfaceType::RECORDING; }
+  IntSize GetSize() const override { return mSize; }
+  SurfaceFormat GetFormat() const override { return mFormat; }
+  already_AddRefed<DataSourceSurface> GetDataSurface() override {
     return nullptr;
   }
 
   IntSize mSize;
   SurfaceFormat mFormat;
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
@@ -104,83 +102,79 @@ class DataSourceSurfaceRecording : publi
       memcpy(data.get(), aData, aStride * aSize.height);
       RefPtr<DataSourceSurfaceRecording> surf = new DataSourceSurfaceRecording(
           std::move(data), aSize, aStride, aFormat);
       return surf.forget();
     }
     return nullptr;
   }
 
-  virtual SurfaceType GetType() const override {
-    return SurfaceType::RECORDING;
-  }
-  virtual IntSize GetSize() const override { return mSize; }
-  virtual int32_t Stride() override { return mStride; }
-  virtual SurfaceFormat GetFormat() const override { return mFormat; }
-  virtual uint8_t *GetData() override { return mData.get(); }
+  SurfaceType GetType() const override { return SurfaceType::RECORDING; }
+  IntSize GetSize() const override { return mSize; }
+  int32_t Stride() override { return mStride; }
+  SurfaceFormat GetFormat() const override { return mFormat; }
+  uint8_t *GetData() override { return mData.get(); }
 
   UniquePtr<uint8_t[]> mData;
   IntSize mSize;
   int32_t mStride;
   SurfaceFormat mFormat;
 };
 
 class GradientStopsRecording : public GradientStops {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStopsRecording, override)
 
   explicit GradientStopsRecording(DrawEventRecorderPrivate *aRecorder)
       : mRecorder(aRecorder) {
     mRecorder->AddStoredObject(this);
   }
 
-  ~GradientStopsRecording() {
+  virtual ~GradientStopsRecording() {
     mRecorder->RemoveStoredObject(this);
     mRecorder->RecordEvent(
         RecordedGradientStopsDestruction(ReferencePtr(this)));
   }
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::RECORDING;
-  }
+  BackendType GetBackendType() const override { return BackendType::RECORDING; }
 
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
 class FilterNodeRecording : public FilterNode {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeRecording, override)
   using FilterNode::SetAttribute;
 
   explicit FilterNodeRecording(DrawEventRecorderPrivate *aRecorder)
       : mRecorder(aRecorder) {
     mRecorder->AddStoredObject(this);
   }
 
-  ~FilterNodeRecording() {
+  virtual ~FilterNodeRecording() {
     mRecorder->RemoveStoredObject(this);
     mRecorder->RecordEvent(RecordedFilterNodeDestruction(ReferencePtr(this)));
   }
 
-  virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
+  void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
     EnsureSurfaceStoredRecording(mRecorder, aSurface, "SetInput");
 
     mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface));
   }
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
+  void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
     MOZ_ASSERT(mRecorder->HasStoredObject(aFilter));
 
     mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter));
   }
 
-#define FORWARD_SET_ATTRIBUTE(type, argtype)                         \
-  virtual void SetAttribute(uint32_t aIndex, type aValue) override { \
-    mRecorder->RecordEvent(RecordedFilterNodeSetAttribute(           \
-        this, aIndex, aValue,                                        \
-        RecordedFilterNodeSetAttribute::ARGTYPE_##argtype));         \
+#define FORWARD_SET_ATTRIBUTE(type, argtype)                 \
+  void SetAttribute(uint32_t aIndex, type aValue) override { \
+    mRecorder->RecordEvent(RecordedFilterNodeSetAttribute(   \
+        this, aIndex, aValue,                                \
+        RecordedFilterNodeSetAttribute::ARGTYPE_##argtype)); \
   }
 
   FORWARD_SET_ATTRIBUTE(bool, BOOL);
   FORWARD_SET_ATTRIBUTE(uint32_t, UINT32);
   FORWARD_SET_ATTRIBUTE(Float, FLOAT);
   FORWARD_SET_ATTRIBUTE(const Size &, SIZE);
   FORWARD_SET_ATTRIBUTE(const IntSize &, INTSIZE);
   FORWARD_SET_ATTRIBUTE(const IntPoint &, INTPOINT);
@@ -189,25 +183,23 @@ class FilterNodeRecording : public Filte
   FORWARD_SET_ATTRIBUTE(const Point &, POINT);
   FORWARD_SET_ATTRIBUTE(const Matrix &, MATRIX);
   FORWARD_SET_ATTRIBUTE(const Matrix5x4 &, MATRIX5X4);
   FORWARD_SET_ATTRIBUTE(const Point3D &, POINT3D);
   FORWARD_SET_ATTRIBUTE(const Color &, COLOR);
 
 #undef FORWARD_SET_ATTRIBUTE
 
-  virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
-                            uint32_t aSize) override {
+  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+                    uint32_t aSize) override {
     mRecorder->RecordEvent(
         RecordedFilterNodeSetAttribute(this, aIndex, aFloat, aSize));
   }
 
-  virtual FilterBackend GetBackendType() override {
-    return FILTER_BACKEND_RECORDING;
-  }
+  FilterBackend GetBackendType() override { return FILTER_BACKEND_RECORDING; }
 
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
 DrawTargetRecording::DrawTargetRecording(DrawEventRecorder *aRecorder,
                                          DrawTarget *aDT, IntSize aSize,
                                          bool aHasData)
     : mRecorder(static_cast<DrawEventRecorderPrivate *>(aRecorder)),
--- a/gfx/2d/DrawTargetTiled.h
+++ b/gfx/2d/DrawTargetTiled.h
@@ -29,136 +29,134 @@ struct TileInternal : public Tile {
 };
 
 class DrawTargetTiled : public DrawTarget {
  public:
   DrawTargetTiled();
 
   bool Init(const TileSet &mTiles);
 
-  virtual bool IsTiledDrawTarget() const override { return true; }
+  bool IsTiledDrawTarget() const override { return true; }
 
-  virtual bool IsCaptureDT() const override {
+  bool IsCaptureDT() const override {
     return mTiles[0].mDrawTarget->IsCaptureDT();
   }
-  virtual DrawTargetType GetType() const override {
+  DrawTargetType GetType() const override {
     return mTiles[0].mDrawTarget->GetType();
   }
-  virtual BackendType GetBackendType() const override {
+  BackendType GetBackendType() const override {
     return mTiles[0].mDrawTarget->GetBackendType();
   }
-  virtual already_AddRefed<SourceSurface> Snapshot() override;
-  virtual void DetachAllSnapshots() override;
-  virtual IntSize GetSize() const override {
+  already_AddRefed<SourceSurface> Snapshot() override;
+  void DetachAllSnapshots() override;
+  IntSize GetSize() const override {
     MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
     return IntSize(mRect.XMost(), mRect.YMost());
   }
-  virtual IntRect GetRect() const override { return mRect; }
+  IntRect GetRect() const override { return mRect; }
 
-  virtual void Flush() override;
-  virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
-                           const Rect &aSource,
-                           const DrawSurfaceOptions &aSurfOptions,
-                           const DrawOptions &aOptions) override;
-  virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
-                          const Point &aDestPoint,
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void DrawSurfaceWithShadow(
+  void Flush() override;
+  void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
+                   const Rect &aSource, const DrawSurfaceOptions &aSurfOptions,
+                   const DrawOptions &aOptions) override;
+  void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
+                  const Point &aDestPoint,
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void DrawSurfaceWithShadow(
       SourceSurface *aSurface, const Point &aDest, const Color &aColor,
       const Point &aOffset, Float aSigma,
       CompositionOp aOperator) override { /* Not implemented */
     MOZ_CRASH("GFX: DrawSurfaceWithShadow");
   }
 
-  virtual void ClearRect(const Rect &aRect) override;
-  virtual void MaskSurface(
-      const Pattern &aSource, SourceSurface *aMask, Point aOffset,
-      const DrawOptions &aOptions = DrawOptions()) override;
+  void ClearRect(const Rect &aRect) override;
+  void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset,
+                   const DrawOptions &aOptions = DrawOptions()) override;
 
-  virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
-                           const IntPoint &aDestination) override;
+  void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
+                   const IntPoint &aDestination) override;
 
-  virtual void FillRect(const Rect &aRect, const Pattern &aPattern,
-                        const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern,
-                          const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void StrokeLine(const Point &aStart, const Point &aEnd,
-                          const Pattern &aPattern,
-                          const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Stroke(const Path *aPath, const Pattern &aPattern,
-                      const StrokeOptions &aStrokeOptions = StrokeOptions(),
-                      const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Fill(const Path *aPath, const Pattern &aPattern,
-                    const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
-                          const Pattern &aPattern,
-                          const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void Mask(const Pattern &aSource, const Pattern &aMask,
-                    const DrawOptions &aOptions = DrawOptions()) override;
-  virtual void PushClip(const Path *aPath) override;
-  virtual void PushClipRect(const Rect &aRect) override;
-  virtual void PopClip() override;
-  virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
-                         const Matrix &aMaskTransform,
-                         const IntRect &aBounds = IntRect(),
-                         bool aCopyBackground = false) override;
-  virtual void PushLayerWithBlend(
-      bool aOpaque, Float aOpacity, SourceSurface *aMask,
-      const Matrix &aMaskTransform, const IntRect &aBounds = IntRect(),
-      bool aCopyBackground = false,
-      CompositionOp = CompositionOp::OP_OVER) override;
-  virtual void PopLayer() override;
+  void FillRect(const Rect &aRect, const Pattern &aPattern,
+                const DrawOptions &aOptions = DrawOptions()) override;
+  void StrokeRect(const Rect &aRect, const Pattern &aPattern,
+                  const StrokeOptions &aStrokeOptions = StrokeOptions(),
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void StrokeLine(const Point &aStart, const Point &aEnd,
+                  const Pattern &aPattern,
+                  const StrokeOptions &aStrokeOptions = StrokeOptions(),
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void Stroke(const Path *aPath, const Pattern &aPattern,
+              const StrokeOptions &aStrokeOptions = StrokeOptions(),
+              const DrawOptions &aOptions = DrawOptions()) override;
+  void Fill(const Path *aPath, const Pattern &aPattern,
+            const DrawOptions &aOptions = DrawOptions()) override;
+  void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
+                  const Pattern &aPattern,
+                  const DrawOptions &aOptions = DrawOptions()) override;
+  void Mask(const Pattern &aSource, const Pattern &aMask,
+            const DrawOptions &aOptions = DrawOptions()) override;
+  void PushClip(const Path *aPath) override;
+  void PushClipRect(const Rect &aRect) override;
+  void PopClip() override;
+  void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
+                 const Matrix &aMaskTransform,
+                 const IntRect &aBounds = IntRect(),
+                 bool aCopyBackground = false) override;
+  void PushLayerWithBlend(bool aOpaque, Float aOpacity, SourceSurface *aMask,
+                          const Matrix &aMaskTransform,
+                          const IntRect &aBounds = IntRect(),
+                          bool aCopyBackground = false,
+                          CompositionOp = CompositionOp::OP_OVER) override;
+  void PopLayer() override;
 
-  virtual void PadEdges(const IntRegion &aRegion) override;
+  void PadEdges(const IntRegion &aRegion) override;
 
-  virtual void SetTransform(const Matrix &aTransform) override;
+  void SetTransform(const Matrix &aTransform) override;
 
-  virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
+  void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
 
-  virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
+  already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
       unsigned char *aData, const IntSize &aSize, int32_t aStride,
       SurfaceFormat aFormat) const override {
     return mTiles[0].mDrawTarget->CreateSourceSurfaceFromData(aData, aSize,
                                                               aStride, aFormat);
   }
-  virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(
+  already_AddRefed<SourceSurface> OptimizeSourceSurface(
       SourceSurface *aSurface) const override {
     return mTiles[0].mDrawTarget->OptimizeSourceSurface(aSurface);
   }
 
-  virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
+  already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
       const NativeSurface &aSurface) const override {
     return mTiles[0].mDrawTarget->CreateSourceSurfaceFromNativeSurface(
         aSurface);
   }
 
-  virtual already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
+  already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
       const IntSize &aSize, SurfaceFormat aFormat) const override {
     return mTiles[0].mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat);
   }
 
-  virtual bool CanCreateSimilarDrawTarget(
-      const IntSize &aSize, SurfaceFormat aFormat) const override {
+  bool CanCreateSimilarDrawTarget(const IntSize &aSize,
+                                  SurfaceFormat aFormat) const override {
     return mTiles[0].mDrawTarget->CanCreateSimilarDrawTarget(aSize, aFormat);
   }
 
-  virtual already_AddRefed<PathBuilder> CreatePathBuilder(
+  already_AddRefed<PathBuilder> CreatePathBuilder(
       FillRule aFillRule = FillRule::FILL_WINDING) const override {
     return mTiles[0].mDrawTarget->CreatePathBuilder(aFillRule);
   }
 
-  virtual already_AddRefed<GradientStops> CreateGradientStops(
+  already_AddRefed<GradientStops> CreateGradientStops(
       GradientStop *aStops, uint32_t aNumStops,
       ExtendMode aExtendMode = ExtendMode::CLAMP) const override {
     return mTiles[0].mDrawTarget->CreateGradientStops(aStops, aNumStops,
                                                       aExtendMode);
   }
-  virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override {
+  already_AddRefed<FilterNode> CreateFilter(FilterType aType) override {
     return mTiles[0].mDrawTarget->CreateFilter(aType);
   }
 
  private:
   std::vector<TileInternal> mTiles;
 
   // mClippedOutTilesStack[clipIndex][tileIndex] is true if the tile at
   // tileIndex has become completely clipped out at the clip stack depth
@@ -180,27 +178,27 @@ class SnapshotTiled : public SourceSurfa
   SnapshotTiled(const std::vector<TileInternal> &aTiles, const IntRect &aRect)
       : mRect(aRect) {
     for (size_t i = 0; i < aTiles.size(); i++) {
       mSnapshots.push_back(aTiles[i].mDrawTarget->Snapshot());
       mOrigins.push_back(aTiles[i].mTileOrigin);
     }
   }
 
-  virtual SurfaceType GetType() const override { return SurfaceType::TILED; }
-  virtual IntSize GetSize() const override {
+  SurfaceType GetType() const override { return SurfaceType::TILED; }
+  IntSize GetSize() const override {
     MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
     return IntSize(mRect.XMost(), mRect.YMost());
   }
-  virtual IntRect GetRect() const override { return mRect; }
-  virtual SurfaceFormat GetFormat() const override {
+  IntRect GetRect() const override { return mRect; }
+  SurfaceFormat GetFormat() const override {
     return mSnapshots[0]->GetFormat();
   }
 
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
+  already_AddRefed<DataSourceSurface> GetDataSurface() override {
     RefPtr<DataSourceSurface> surf =
         Factory::CreateDataSourceSurface(mRect.Size(), GetFormat());
     if (!surf) {
       gfxCriticalError()
           << "DrawTargetTiled::GetDataSurface failed to allocate surface";
       return nullptr;
     }
 
--- a/gfx/2d/DrawTargetWrapAndRecord.cpp
+++ b/gfx/2d/DrawTargetWrapAndRecord.cpp
@@ -87,24 +87,22 @@ class SourceSurfaceWrapAndRecord : publi
   }
 
   ~SourceSurfaceWrapAndRecord() {
     mRecorder->RemoveStoredObject(this);
     mRecorder->RecordEvent(
         RecordedSourceSurfaceDestruction(ReferencePtr(this)));
   }
 
-  virtual SurfaceType GetType() const override {
-    return SurfaceType::RECORDING;
-  }
-  virtual IntSize GetSize() const override { return mFinalSurface->GetSize(); }
-  virtual SurfaceFormat GetFormat() const override {
+  SurfaceType GetType() const override { return SurfaceType::RECORDING; }
+  IntSize GetSize() const override { return mFinalSurface->GetSize(); }
+  SurfaceFormat GetFormat() const override {
     return mFinalSurface->GetFormat();
   }
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
+  already_AddRefed<DataSourceSurface> GetDataSurface() override {
     return mFinalSurface->GetDataSurface();
   }
 
   RefPtr<SourceSurface> mFinalSurface;
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
 class GradientStopsWrapAndRecord : public GradientStops {
@@ -118,19 +116,17 @@ class GradientStopsWrapAndRecord : publi
   }
 
   ~GradientStopsWrapAndRecord() {
     mRecorder->RemoveStoredObject(this);
     mRecorder->RecordEvent(
         RecordedGradientStopsDestruction(ReferencePtr(this)));
   }
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::RECORDING;
-  }
+  BackendType GetBackendType() const override { return BackendType::RECORDING; }
 
   RefPtr<GradientStops> mFinalGradientStops;
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
 static SourceSurface *GetSourceSurface(SourceSurface *aSurface) {
   if (aSurface->GetType() != SurfaceType::RECORDING) {
     return aSurface;
@@ -168,35 +164,35 @@ class FilterNodeWrapAndRecord : public F
       gfxWarning()
           << "Non recording filter node used with recording DrawTarget!";
       return aNode;
     }
 
     return static_cast<FilterNodeWrapAndRecord *>(aNode)->mFinalFilterNode;
   }
 
-  virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
+  void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
     EnsureSurfaceStored(mRecorder, aSurface, "SetInput");
 
     mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface));
     mFinalFilterNode->SetInput(aIndex, GetSourceSurface(aSurface));
   }
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
+  void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
     MOZ_ASSERT(mRecorder->HasStoredObject(aFilter));
 
     mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter));
     mFinalFilterNode->SetInput(aIndex, GetFilterNode(aFilter));
   }
 
-#define FORWARD_SET_ATTRIBUTE(type, argtype)                         \
-  virtual void SetAttribute(uint32_t aIndex, type aValue) override { \
-    mRecorder->RecordEvent(RecordedFilterNodeSetAttribute(           \
-        this, aIndex, aValue,                                        \
-        RecordedFilterNodeSetAttribute::ARGTYPE_##argtype));         \
-    mFinalFilterNode->SetAttribute(aIndex, aValue);                  \
+#define FORWARD_SET_ATTRIBUTE(type, argtype)                 \
+  void SetAttribute(uint32_t aIndex, type aValue) override { \
+    mRecorder->RecordEvent(RecordedFilterNodeSetAttribute(   \
+        this, aIndex, aValue,                                \
+        RecordedFilterNodeSetAttribute::ARGTYPE_##argtype)); \
+    mFinalFilterNode->SetAttribute(aIndex, aValue);          \
   }
 
   FORWARD_SET_ATTRIBUTE(bool, BOOL);
   FORWARD_SET_ATTRIBUTE(uint32_t, UINT32);
   FORWARD_SET_ATTRIBUTE(Float, FLOAT);
   FORWARD_SET_ATTRIBUTE(const Size &, SIZE);
   FORWARD_SET_ATTRIBUTE(const IntSize &, INTSIZE);
   FORWARD_SET_ATTRIBUTE(const IntPoint &, INTPOINT);
@@ -212,25 +208,23 @@ class FilterNodeWrapAndRecord : public F
 
   virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
                             uint32_t aSize) override {
     mRecorder->RecordEvent(
         RecordedFilterNodeSetAttribute(this, aIndex, aFloat, aSize));
     mFinalFilterNode->SetAttribute(aIndex, aFloat, aSize);
   }
 
-  virtual FilterBackend GetBackendType() override {
-    return FILTER_BACKEND_RECORDING;
-  }
+  FilterBackend GetBackendType() override { return FILTER_BACKEND_RECORDING; }
 
   RefPtr<FilterNode> mFinalFilterNode;
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
-struct AdjustedPattern {
+struct AdjustedPattern final {
   explicit AdjustedPattern(const Pattern &aPattern) : mPattern(nullptr) {
     mOrigPattern = const_cast<Pattern *>(&aPattern);
   }
 
   ~AdjustedPattern() {
     if (mPattern) {
       mPattern->~Pattern();
     }
--- a/gfx/2d/DrawingJob.h
+++ b/gfx/2d/DrawingJob.h
@@ -77,19 +77,19 @@ class CommandBufferBuilder {
 
  protected:
   RefPtr<CommandBuffer> mCommands;
 };
 
 /// Stores multiple commands to be executed sequencially.
 class DrawingJob : public Job {
  public:
-  ~DrawingJob();
+  virtual ~DrawingJob();
 
-  virtual JobStatus Run() override;
+  JobStatus Run() override;
 
  protected:
   DrawingJob(DrawTarget* aTarget, IntPoint aOffset, SyncObject* aStart,
              SyncObject* aCompletion, WorkerThread* aPinToWorker = nullptr);
 
   /// Runs the tasks's destructors and resets the buffer.
   void Clear();
 
@@ -102,17 +102,17 @@ class DrawingJob : public Job {
 
   friend class DrawingJobBuilder;
 };
 
 /// Generates DrawingJob objects.
 ///
 /// The builder is a separate object to ensure that commands are not added to a
 /// submitted DrawingJob.
-class DrawingJobBuilder {
+class DrawingJobBuilder final {
  public:
   DrawingJobBuilder();
 
   ~DrawingJobBuilder();
 
   /// Allocates a DrawingJob.
   ///
   /// call this method before starting to add commands.
--- a/gfx/2d/FilterNodeCapture.h
+++ b/gfx/2d/FilterNodeCapture.h
@@ -18,83 +18,81 @@ namespace gfx {
 
 class FilterNodeCapture final : public FilterNode {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCapture, override)
 
   explicit FilterNodeCapture(FilterType aType)
       : mType{aType}, mInputsChanged{true} {}
 
-  virtual FilterBackend GetBackendType() override {
-    return FILTER_BACKEND_CAPTURE;
-  }
+  FilterBackend GetBackendType() override { return FILTER_BACKEND_CAPTURE; }
 
   RefPtr<FilterNode> Validate(DrawTarget *aDT);
 
   template <typename T, typename C>
   void Replace(uint32_t aIndex, const T &aValue, C &aContainer) {
     // This replace function avoids generating the hash twice.
     auto result = aContainer.insert({aIndex, typename C::mapped_type(aValue)});
     if (!result.second) {
       result.first->second = typename C::mapped_type(aValue);
     }
   }
 
-  virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
+  void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
     mInputsChanged = true;
     Replace(aIndex, RefPtr<SourceSurface>(aSurface), mInputs);
   }
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
+  void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
     mInputsChanged = true;
     Replace(aIndex, RefPtr<FilterNode>(aFilter), mInputs);
   }
 
   using AttributeValue =
       Variant<uint32_t, Float, Point, Matrix5x4, Point3D, Size, IntSize, Color,
               Rect, IntRect, bool, std::vector<Float>, IntPoint, Matrix>;
 
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override {
+  void SetAttribute(uint32_t aIndex, uint32_t aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override {
+  void SetAttribute(uint32_t aIndex, Float aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Point &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Point &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Point3D &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Point3D &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Size &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Size &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const IntSize &aValue) override {
+  void SetAttribute(uint32_t aIndex, const IntSize &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Color &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Color &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Rect &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Rect &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const IntRect &aValue) override {
+  void SetAttribute(uint32_t aIndex, const IntRect &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, bool aValue) override {
+  void SetAttribute(uint32_t aIndex, bool aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
   virtual void SetAttribute(uint32_t aIndex, const Float *aValues,
                             uint32_t aSize) override;
-  virtual void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override {
+  void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
-  virtual void SetAttribute(uint32_t aIndex, const Matrix &aValue) override {
+  void SetAttribute(uint32_t aIndex, const Matrix &aValue) override {
     Replace(aIndex, aValue, mAttributes);
   }
 
  private:
   FilterType mType;
   RefPtr<FilterNode> mFilterNodeInternal;
 
   // This only contains attributes that were set since the last validation.
--- a/gfx/2d/FilterNodeD2D1.h
+++ b/gfx/2d/FilterNodeD2D1.h
@@ -76,24 +76,24 @@ class FilterNodeD2D1 : public FilterNode
   using FilterNode::SetInput;
 };
 
 class FilterNodeConvolveD2D1 : public FilterNodeD2D1 {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveD2D1, override)
   explicit FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC);
 
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
+  void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
 
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
-  virtual void SetAttribute(uint32_t aIndex, const IntSize &aValue) override;
-  virtual void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override;
-  virtual void SetAttribute(uint32_t aIndex, const IntRect &aValue) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
+  void SetAttribute(uint32_t aIndex, const IntSize &aValue) override;
+  void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override;
+  void SetAttribute(uint32_t aIndex, const IntRect &aValue) override;
 
-  virtual ID2D1Effect *InputEffect() override;
+  ID2D1Effect *InputEffect() override;
 
  private:
   using FilterNode::SetAttribute;
   using FilterNode::SetInput;
 
   void UpdateChain();
   void UpdateOffset();
   void UpdateSourceRect();
@@ -104,54 +104,50 @@ class FilterNodeConvolveD2D1 : public Fi
   IntPoint mTarget;
   IntSize mKernelSize;
   IntRect mSourceRect;
 };
 
 class FilterNodeOpacityD2D1 : public FilterNodeD2D1 {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacityD2D1, override)
-  explicit FilterNodeOpacityD2D1(ID2D1Effect *aEffect, FilterType aType)
+  FilterNodeOpacityD2D1(ID2D1Effect *aEffect, FilterType aType)
       : FilterNodeD2D1(aEffect, aType) {}
 
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
+  void SetAttribute(uint32_t aIndex, Float aValue) override;
 };
 
 class FilterNodeExtendInputAdapterD2D1 : public FilterNodeD2D1 {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeExtendInputAdapterD2D1,
                                           override)
   FilterNodeExtendInputAdapterD2D1(ID2D1DeviceContext *aDC,
                                    FilterNodeD2D1 *aFilterNode,
                                    FilterType aType);
 
-  virtual ID2D1Effect *InputEffect() override {
-    return mExtendInputEffect.get();
-  }
-  virtual ID2D1Effect *OutputEffect() override {
+  ID2D1Effect *InputEffect() override { return mExtendInputEffect.get(); }
+  ID2D1Effect *OutputEffect() override {
     return mWrappedFilterNode->OutputEffect();
   }
 
  private:
   RefPtr<FilterNodeD2D1> mWrappedFilterNode;
   RefPtr<ID2D1Effect> mExtendInputEffect;
 };
 
 class FilterNodePremultiplyAdapterD2D1 : public FilterNodeD2D1 {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplyAdapterD2D1,
                                           override)
   FilterNodePremultiplyAdapterD2D1(ID2D1DeviceContext *aDC,
                                    FilterNodeD2D1 *aFilterNode,
                                    FilterType aType);
 
-  virtual ID2D1Effect *InputEffect() override {
-    return mPrePremultiplyEffect.get();
-  }
-  virtual ID2D1Effect *OutputEffect() override {
+  ID2D1Effect *InputEffect() override { return mPrePremultiplyEffect.get(); }
+  ID2D1Effect *OutputEffect() override {
     return mPostUnpremultiplyEffect.get();
   }
 
  private:
   RefPtr<ID2D1Effect> mPrePremultiplyEffect;
   RefPtr<ID2D1Effect> mPostUnpremultiplyEffect;
 };
 
--- a/gfx/2d/FilterNodeSoftware.h
+++ b/gfx/2d/FilterNodeSoftware.h
@@ -44,30 +44,27 @@ class FilterNodeSoftware : public Filter
 
   // Factory method, intended to be called from DrawTarget*::CreateFilter.
   static already_AddRefed<FilterNode> Create(FilterType aType);
 
   // Draw the filter, intended to be called by DrawTarget*::DrawFilter.
   void Draw(DrawTarget *aDrawTarget, const Rect &aSourceRect,
             const Point &aDestPoint, const DrawOptions &aOptions);
 
-  virtual FilterBackend GetBackendType() override {
-    return FILTER_BACKEND_SOFTWARE;
-  }
-  virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override;
-  virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
+  FilterBackend GetBackendType() override { return FILTER_BACKEND_SOFTWARE; }
+  void SetInput(uint32_t aIndex, SourceSurface *aSurface) override;
+  void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
 
   virtual const char *GetName() { return "Unknown"; }
 
-  virtual void AddInvalidationListener(FilterInvalidationListener *aListener);
-  virtual void RemoveInvalidationListener(
-      FilterInvalidationListener *aListener);
+  void AddInvalidationListener(FilterInvalidationListener *aListener);
+  void RemoveInvalidationListener(FilterInvalidationListener *aListener);
 
   // FilterInvalidationListener implementation
-  virtual void FilterInvalidated(FilterNodeSoftware *aFilter) override;
+  void FilterInvalidated(FilterNodeSoftware *aFilter) override;
 
  protected:
   // The following methods are intended to be overriden by subclasses.
 
   /**
    * Translates a *FilterInputs enum value into an index for the
    * mInputFilters / mInputSurfaces arrays. Returns -1 for invalid inputs.
    * If somebody calls SetInput(enumValue, input) with an enumValue for which
@@ -226,208 +223,197 @@ class FilterNodeSoftware : public Filter
 };
 
 // Subclasses for specific filters.
 
 class FilterNodeTransformSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTransformSoftware, override)
   FilterNodeTransformSoftware();
-  virtual const char *GetName() override { return "Transform"; }
+  const char *GetName() override { return "Transform"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aGraphicsFilter) override;
-  virtual void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aGraphicsFilter) override;
+  void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
   IntRect SourceRectForOutputRect(const IntRect &aRect);
 
  private:
   Matrix mMatrix;
   SamplingFilter mSamplingFilter;
 };
 
 class FilterNodeBlendSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlendSoftware, override)
   FilterNodeBlendSoftware();
-  virtual const char *GetName() override { return "Blend"; }
+  const char *GetName() override { return "Blend"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   BlendMode mBlendMode;
 };
 
 class FilterNodeMorphologySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeMorphologySoftware,
                                           override)
   FilterNodeMorphologySoftware();
-  virtual const char *GetName() override { return "Morphology"; }
+  const char *GetName() override { return "Morphology"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const IntSize &aRadii) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
+  void SetAttribute(uint32_t aIndex, const IntSize &aRadii) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   IntSize mRadii;
   MorphologyOperator mOperator;
 };
 
 class FilterNodeColorMatrixSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeColorMatrixSoftware,
                                           override)
-  virtual const char *GetName() override { return "ColorMatrix"; }
+  const char *GetName() override { return "ColorMatrix"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override;
+  void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  private:
   Matrix5x4 mMatrix;
   AlphaMode mAlphaMode;
 };
 
 class FilterNodeFloodSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeFloodSoftware, override)
-  virtual const char *GetName() override { return "Flood"; }
+  const char *GetName() override { return "Flood"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Color &aColor) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Color &aColor) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> GetOutput(
-      const IntRect &aRect) override;
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> GetOutput(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
 
  private:
   Color mColor;
 };
 
 class FilterNodeTileSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTileSoftware, override)
-  virtual const char *GetName() override { return "Tile"; }
+  const char *GetName() override { return "Tile"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex,
-                            const IntRect &aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   IntRect mSourceRect;
 };
 
 /**
  * Baseclass for the four different component transfer filters.
  */
 class FilterNodeComponentTransferSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeComponentTransferSoftware,
                                           override)
   FilterNodeComponentTransferSoftware();
 
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, bool aDisable) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, bool aDisable) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
   virtual void GenerateLookupTable(ptrdiff_t aComponent,
                                    uint8_t aTables[4][256], bool aDisabled);
   virtual void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) = 0;
 
   bool mDisableR;
   bool mDisableG;
   bool mDisableB;
   bool mDisableA;
 };
 
 class FilterNodeTableTransferSoftware
     : public FilterNodeComponentTransferSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTableTransferSoftware,
                                           override)
-  virtual const char *GetName() override { return "TableTransfer"; }
+  const char *GetName() override { return "TableTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
-                            uint32_t aSize) override;
+  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+                    uint32_t aSize) override;
 
  protected:
-  virtual void FillLookupTable(ptrdiff_t aComponent,
-                               uint8_t aTable[256]) override;
+  void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
   void FillLookupTableImpl(std::vector<Float> &aTableValues,
                            uint8_t aTable[256]);
 
   std::vector<Float> mTableR;
   std::vector<Float> mTableG;
   std::vector<Float> mTableB;
   std::vector<Float> mTableA;
 };
 
 class FilterNodeDiscreteTransferSoftware
     : public FilterNodeComponentTransferSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDiscreteTransferSoftware,
                                           override)
-  virtual const char *GetName() override { return "DiscreteTransfer"; }
+  const char *GetName() override { return "DiscreteTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
-                            uint32_t aSize) override;
+  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+                    uint32_t aSize) override;
 
  protected:
-  virtual void FillLookupTable(ptrdiff_t aComponent,
-                               uint8_t aTable[256]) override;
+  void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
   void FillLookupTableImpl(std::vector<Float> &aTableValues,
                            uint8_t aTable[256]);
 
   std::vector<Float> mTableR;
   std::vector<Float> mTableG;
   std::vector<Float> mTableB;
@@ -435,23 +421,22 @@ class FilterNodeDiscreteTransferSoftware
 };
 
 class FilterNodeLinearTransferSoftware
     : public FilterNodeComponentTransferSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeLinearTransformSoftware,
                                           override)
   FilterNodeLinearTransferSoftware();
-  virtual const char *GetName() override { return "LinearTransfer"; }
+  const char *GetName() override { return "LinearTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
+  void SetAttribute(uint32_t aIndex, Float aValue) override;
 
  protected:
-  virtual void FillLookupTable(ptrdiff_t aComponent,
-                               uint8_t aTable[256]) override;
+  void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
   void FillLookupTableImpl(Float aSlope, Float aIntercept, uint8_t aTable[256]);
 
   Float mSlopeR;
   Float mSlopeG;
   Float mSlopeB;
   Float mSlopeA;
@@ -462,23 +447,22 @@ class FilterNodeLinearTransferSoftware
 };
 
 class FilterNodeGammaTransferSoftware
     : public FilterNodeComponentTransferSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGammaTransferSoftware,
                                           override)
   FilterNodeGammaTransferSoftware();
-  virtual const char *GetName() override { return "GammaTransfer"; }
+  const char *GetName() override { return "GammaTransfer"; }
   using FilterNodeComponentTransferSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
+  void SetAttribute(uint32_t aIndex, Float aValue) override;
 
  protected:
-  virtual void FillLookupTable(ptrdiff_t aComponent,
-                               uint8_t aTable[256]) override;
+  void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
 
  private:
   void FillLookupTableImpl(Float aAmplitude, Float aExponent, Float aOffset,
                            uint8_t aTable[256]);
 
   Float mAmplitudeR;
   Float mAmplitudeG;
   Float mAmplitudeB;
@@ -493,39 +477,35 @@ class FilterNodeGammaTransferSoftware
   Float mOffsetA;
 };
 
 class FilterNodeConvolveMatrixSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveMatrixSoftware,
                                           override)
   FilterNodeConvolveMatrixSoftware();
-  virtual const char *GetName() override { return "ConvolveMatrix"; }
+  const char *GetName() override { return "ConvolveMatrix"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex,
-                            const IntSize &aKernelSize) override;
-  virtual void SetAttribute(uint32_t aIndex, const Float *aMatrix,
-                            uint32_t aSize) override;
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
-  virtual void SetAttribute(uint32_t aIndex,
-                            const Size &aKernelUnitLength) override;
-  virtual void SetAttribute(uint32_t aIndex,
-                            const IntRect &aSourceRect) override;
-  virtual void SetAttribute(uint32_t aIndex, const IntPoint &aTarget) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aEdgeMode) override;
-  virtual void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const IntSize &aKernelSize) override;
+  void SetAttribute(uint32_t aIndex, const Float *aMatrix,
+                    uint32_t aSize) override;
+  void SetAttribute(uint32_t aIndex, Float aValue) override;
+  void SetAttribute(uint32_t aIndex, const Size &aKernelUnitLength) override;
+  void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const IntPoint &aTarget) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aEdgeMode) override;
+  void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   template <typename CoordType>
   already_AddRefed<DataSourceSurface> DoRender(const IntRect &aRect,
                                                CoordType aKernelUnitLengthX,
                                                CoordType aKernelUnitLengthY);
 
   IntRect InflatedSourceRect(const IntRect &aDestRect);
@@ -542,264 +522,253 @@ class FilterNodeConvolveMatrixSoftware :
   bool mPreserveAlpha;
 };
 
 class FilterNodeDisplacementMapSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDisplacementMapSoftware,
                                           override)
   FilterNodeDisplacementMapSoftware();
-  virtual const char *GetName() override { return "DisplacementMap"; }
+  const char *GetName() override { return "DisplacementMap"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aScale) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, Float aScale) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   IntRect InflatedSourceOrDestRect(const IntRect &aDestOrSourceRect);
 
   Float mScale;
   ColorChannel mChannelX;
   ColorChannel mChannelY;
 };
 
 class FilterNodeTurbulenceSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTurbulenceSoftware,
                                           override)
   FilterNodeTurbulenceSoftware();
-  virtual const char *GetName() override { return "Turbulence"; }
+  const char *GetName() override { return "Turbulence"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Size &aSize) override;
-  virtual void SetAttribute(uint32_t aIndex,
-                            const IntRect &aRenderRect) override;
-  virtual void SetAttribute(uint32_t aIndex, bool aStitchable) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Size &aSize) override;
+  void SetAttribute(uint32_t aIndex, const IntRect &aRenderRect) override;
+  void SetAttribute(uint32_t aIndex, bool aStitchable) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
 
  private:
   IntRect mRenderRect;
   Size mBaseFrequency;
   uint32_t mNumOctaves;
   uint32_t mSeed;
   bool mStitchable;
   TurbulenceType mType;
 };
 
 class FilterNodeArithmeticCombineSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeArithmeticCombineSoftware,
                                           override)
   FilterNodeArithmeticCombineSoftware();
-  virtual const char *GetName() override { return "ArithmeticCombine"; }
+  const char *GetName() override { return "ArithmeticCombine"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
-                            uint32_t aSize) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, const Float *aFloat,
+                    uint32_t aSize) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   Float mK1;
   Float mK2;
   Float mK3;
   Float mK4;
 };
 
 class FilterNodeCompositeSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCompositeSoftware, override)
   FilterNodeCompositeSoftware();
-  virtual const char *GetName() override { return "Composite"; }
+  const char *GetName() override { return "Composite"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  private:
   CompositeOperator mOperator;
 };
 
 // Base class for FilterNodeGaussianBlurSoftware and
 // FilterNodeDirectionalBlurSoftware.
 class FilterNodeBlurXYSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlurXYSoftware, override)
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
   IntRect InflatedSourceOrDestRect(const IntRect &aDestRect);
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
   // Implemented by subclasses.
   virtual Size StdDeviationXY() = 0;
 };
 
 class FilterNodeGaussianBlurSoftware : public FilterNodeBlurXYSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGaussianBlurSoftware,
                                           override)
   FilterNodeGaussianBlurSoftware();
-  virtual const char *GetName() override { return "GaussianBlur"; }
+  const char *GetName() override { return "GaussianBlur"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
+  void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
 
  protected:
-  virtual Size StdDeviationXY() override;
+  Size StdDeviationXY() override;
 
  private:
   Float mStdDeviation;
 };
 
 class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDirectionalBlurSoftware,
                                           override)
   FilterNodeDirectionalBlurSoftware();
-  virtual const char *GetName() override { return "DirectionalBlur"; }
+  const char *GetName() override { return "DirectionalBlur"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
-  virtual void SetAttribute(uint32_t aIndex, uint32_t aBlurDirection) override;
+  void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
+  void SetAttribute(uint32_t aIndex, uint32_t aBlurDirection) override;
 
  protected:
-  virtual Size StdDeviationXY() override;
+  Size StdDeviationXY() override;
 
  private:
   Float mStdDeviation;
   BlurDirection mBlurDirection;
 };
 
 class FilterNodeCropSoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCropSoftware, override)
-  virtual const char *GetName() override { return "Crop"; }
+  const char *GetName() override { return "Crop"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override;
+  void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  private:
   IntRect mCropRect;
 };
 
 class FilterNodePremultiplySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplySoftware,
                                           override)
-  virtual const char *GetName() override { return "Premultiply"; }
+  const char *GetName() override { return "Premultiply"; }
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 };
 
 class FilterNodeUnpremultiplySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeUnpremultiplySoftware,
                                           override)
-  virtual const char *GetName() override { return "Unpremultiply"; }
+  const char *GetName() override { return "Unpremultiply"; }
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 };
 
 class FilterNodeOpacitySoftware : public FilterNodeSoftware {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacitySoftware, override)
-  virtual const char *GetName() override { return "Opacity"; }
+  const char *GetName() override { return "Opacity"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, Float aValue) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
   Float mValue = 1.0f;
 };
 
 template <typename LightType, typename LightingType>
 class FilterNodeLightingSoftware : public FilterNodeSoftware {
  public:
 #if defined(MOZILLA_INTERNAL_API) && \
     (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
   // Helpers for refcounted
-  virtual const char *typeName() const override { return mTypeName; }
-  virtual size_t typeSize() const override { return sizeof(*this); }
+  const char *typeName() const override { return mTypeName; }
+  size_t typeSize() const override { return sizeof(*this); }
 #endif
   explicit FilterNodeLightingSoftware(const char *aTypeName);
-  virtual const char *GetName() override { return "Lighting"; }
+  const char *GetName() override { return "Lighting"; }
   using FilterNodeSoftware::SetAttribute;
-  virtual void SetAttribute(uint32_t aIndex, Float) override;
-  virtual void SetAttribute(uint32_t aIndex, const Size &) override;
-  virtual void SetAttribute(uint32_t aIndex, const Point3D &) override;
-  virtual void SetAttribute(uint32_t aIndex, const Color &) override;
-  virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
-                                  FilterNode *aSourceNode) override;
+  void SetAttribute(uint32_t aIndex, Float) override;
+  void SetAttribute(uint32_t aIndex, const Size &) override;
+  void SetAttribute(uint32_t aIndex, const Point3D &) override;
+  void SetAttribute(uint32_t aIndex, const Color &) override;
+  IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
+                          FilterNode *aSourceNode) override;
 
  protected:
-  virtual already_AddRefed<DataSourceSurface> Render(
-      const IntRect &aRect) override;
-  virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
-  virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
-  virtual void RequestFromInputsForRect(const IntRect &aRect) override;
+  already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
+  IntRect GetOutputRectInRect(const IntRect &aRect) override;
+  int32_t InputIndex(uint32_t aInputEnumIndex) override;
+  void RequestFromInputsForRect(const IntRect &aRect) override;
 
  private:
   template <typename CoordType>
   already_AddRefed<DataSourceSurface> DoRender(const IntRect &aRect,
                                                CoordType aKernelUnitLengthX,
                                                CoordType aKernelUnitLengthY);
 
   Mutex mLock;
--- a/gfx/2d/Filters.h
+++ b/gfx/2d/Filters.h
@@ -365,17 +365,17 @@ enum UnpremultiplyInputs { IN_UNPREMULTI
 
 enum OpacityAtts { ATT_OPACITY_VALUE = 0 };
 
 enum OpacityInputs { IN_OPACITY_IN = 0 };
 
 class FilterNode : public external::AtomicRefCounted<FilterNode> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNode)
-  virtual ~FilterNode() {}
+  virtual ~FilterNode() = default;
 
   virtual FilterBackend GetBackendType() = 0;
 
   virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) {
     MOZ_CRASH("GFX: FilterNode");
   }
   virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) {
     MOZ_CRASH("GFX: FilterNode");
--- a/gfx/2d/Helpers.h
+++ b/gfx/2d/Helpers.h
@@ -7,19 +7,19 @@
 #ifndef MOZILLA_GFX_2D_HELPERS_H_
 #define MOZILLA_GFX_2D_HELPERS_H_
 
 #include "2D.h"
 
 namespace mozilla {
 namespace gfx {
 
-class AutoRestoreTransform {
+class AutoRestoreTransform final {
  public:
-  AutoRestoreTransform() {}
+  AutoRestoreTransform() = default;
 
   explicit AutoRestoreTransform(DrawTarget *aTarget)
       : mDrawTarget(aTarget), mOldTransform(aTarget->GetTransform()) {}
 
   void Init(DrawTarget *aTarget) {
     MOZ_ASSERT(!mDrawTarget || aTarget == mDrawTarget);
     if (!mDrawTarget) {
       mDrawTarget = aTarget;
@@ -33,17 +33,17 @@ class AutoRestoreTransform {
     }
   }
 
  private:
   RefPtr<DrawTarget> mDrawTarget;
   Matrix mOldTransform;
 };
 
-class AutoPopClips {
+class AutoPopClips final {
  public:
   explicit AutoPopClips(DrawTarget *aTarget)
       : mDrawTarget(aTarget), mPushCount(0) {
     MOZ_ASSERT(mDrawTarget);
   }
 
   ~AutoPopClips() { PopAll(); }
 
--- a/gfx/2d/HelpersD2D.h
+++ b/gfx/2d/HelpersD2D.h
@@ -862,17 +862,17 @@ class DCCommandSink : public ID2D1Comman
   STDMETHODIMP PopLayer() {
     mCtx->PopLayer();
     return S_OK;
   }
 
   ID2D1DeviceContext *mCtx;
 };
 
-class MOZ_STACK_CLASS AutoRestoreFP {
+class MOZ_STACK_CLASS AutoRestoreFP final {
  public:
   AutoRestoreFP() {
     // save the current floating point control word
     _controlfp_s(&savedFPSetting, 0, 0);
     UINT unused;
     // set the floating point control word to its default value
     _controlfp_s(&unused, _CW_DEFAULT, MCW_PC);
   }
--- a/gfx/2d/JobScheduler.h
+++ b/gfx/2d/JobScheduler.h
@@ -137,17 +137,17 @@ class EventObject;
 /// Typically used as the final task, so that the main thread can block on the
 /// corresponfing EventObject until all of the tasks are processed.
 class SetEventJob : public Job {
  public:
   explicit SetEventJob(EventObject* aEvent, SyncObject* aStart,
                        SyncObject* aCompletion = nullptr,
                        WorkerThread* aPinToWorker = nullptr);
 
-  ~SetEventJob();
+  virtual ~SetEventJob();
 
   JobStatus Run() override;
 
   EventObject* GetEvent() { return mEvent; }
 
  protected:
   RefPtr<EventObject> mEvent;
 };
@@ -174,17 +174,17 @@ class SyncObject final : public external
   /// objects makes it easy to start scheduling some of the prerequisite tasks
   /// while creating the others, which is how we typically use the task
   /// scheduler. Automatically determining the number of prerequisites using
   /// Job's constructor brings the risk that the sync object enters the signaled
   /// state while we are still adding prerequisites which is hard to fix without
   /// using muteces.
   explicit SyncObject(uint32_t aNumPrerequisites = 1);
 
-  ~SyncObject();
+  virtual ~SyncObject();
 
   /// Attempt to register a task.
   ///
   /// If the sync object is already in the signaled state, the buffer is *not*
   /// registered and the sync object does not take ownership of the task.
   /// If the object is not yet in the signaled state, it takes ownership of
   /// the task and places it in a list of pending tasks.
   /// Pending tasks will not be processed by the worker thread.
@@ -232,17 +232,17 @@ class SyncObject final : public external
   friend class JobScheduler;
 };
 
 /// Base class for worker threads.
 class WorkerThread {
  public:
   static WorkerThread* Create(MultiThreadedJobQueue* aJobQueue);
 
-  virtual ~WorkerThread() {}
+  virtual ~WorkerThread() = default;
 
   void Run();
 
   MultiThreadedJobQueue* GetJobQueue() { return mQueue; }
 
  protected:
   explicit WorkerThread(MultiThreadedJobQueue* aJobQueue);
 
--- a/gfx/2d/JobScheduler_posix.cpp
+++ b/gfx/2d/JobScheduler_posix.cpp
@@ -17,17 +17,17 @@ void* ThreadCallback(void* threadData);
 class WorkerThreadPosix : public WorkerThread {
  public:
   explicit WorkerThreadPosix(MultiThreadedJobQueue* aJobQueue)
       : WorkerThread(aJobQueue) {
     pthread_create(&mThread, nullptr, ThreadCallback,
                    static_cast<WorkerThread*>(this));
   }
 
-  ~WorkerThreadPosix() override { pthread_join(mThread, nullptr); }
+  virtual ~WorkerThreadPosix() { pthread_join(mThread, nullptr); }
 
   void SetName(const char*) override {
     // XXX - temporarily disabled, see bug 1209039
     //
     //    // Call this from the thread itself because of Mac.
     /*
     #ifdef XP_MACOSX
         pthread_setname_np(aName);
--- a/gfx/2d/JobScheduler_win32.cpp
+++ b/gfx/2d/JobScheduler_win32.cpp
@@ -17,17 +17,17 @@ DWORD __stdcall ThreadCallback(void* thr
 class WorkerThreadWin32 : public WorkerThread {
  public:
   explicit WorkerThreadWin32(MultiThreadedJobQueue* aJobQueue)
       : WorkerThread(aJobQueue) {
     mThread = ::CreateThread(nullptr, 0, ThreadCallback,
                              static_cast<WorkerThread*>(this), 0, nullptr);
   }
 
-  ~WorkerThreadWin32() {
+  virtual ~WorkerThreadWin32() {
     ::WaitForSingleObject(mThread, INFINITE);
     ::CloseHandle(mThread);
   }
 
  protected:
   HANDLE mThread;
 };
 
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -207,17 +207,17 @@ struct CriticalLogger {
 // time in seconds since the process creation.
 typedef mozilla::Tuple<int32_t, std::string, double> LoggingRecordEntry;
 
 // Implement this interface and init the Factory with an instance to
 // forward critical logs.
 typedef std::vector<LoggingRecordEntry> LoggingRecord;
 class LogForwarder {
  public:
-  virtual ~LogForwarder() {}
+  virtual ~LogForwarder() = default;
   virtual void Log(const std::string& aString) = 0;
   virtual void CrashAction(LogReason aReason) = 0;
   virtual bool UpdateStringsVector(const std::string& aString) = 0;
 
   // Provide a copy of the logs to the caller.
   virtual LoggingRecord LoggingRecordCopy() = 0;
 };
 
@@ -252,17 +252,17 @@ Hexa<T> hexa(T val) {
   return Hexa<T>(val);
 }
 
 #ifdef WIN32
 void LogWStr(const wchar_t* aStr, std::stringstream& aOut);
 #endif
 
 template <int L, typename Logger = BasicLogger>
-class Log {
+class Log final {
  public:
   // The default is to have the prefix, have the new line, and for critical
   // logs assert on each call.
   static int DefaultOptions(bool aWithAssert = true) {
     return (int(LogOptions::AutoPrefix) |
             (aWithAssert ? int(LogOptions::AssertOnCall) : 0));
   }
 
@@ -926,17 +926,17 @@ class TreeLog {
   static bool EndsInNewline(char aChar) { return aChar == '\n'; }
 
   static bool EndsInNewline(const char* aString) {
     return EndsInNewline(std::string(aString));
   }
 };
 
 template <int Level = LOG_DEBUG>
-class TreeAutoIndent {
+class TreeAutoIndent final {
  public:
   explicit TreeAutoIndent(TreeLog<Level>& aTreeLog) : mTreeLog(aTreeLog) {
     mTreeLog.IncreaseIndent();
   }
 
   TreeAutoIndent(const TreeAutoIndent& aTreeAutoIndent)
       : mTreeLog(aTreeAutoIndent.mTreeLog) {
     mTreeLog.IncreaseIndent();
--- a/gfx/2d/NativeFontResourceGDI.h
+++ b/gfx/2d/NativeFontResourceGDI.h
@@ -26,17 +26,17 @@ class NativeFontResourceGDI final : publ
    *
    * @param aFontData the SFNT data.
    * @param aDataLength length of data.
    * @return Referenced NativeFontResourceGDI or nullptr if invalid.
    */
   static already_AddRefed<NativeFontResourceGDI> Create(uint8_t* aFontData,
                                                         uint32_t aDataLength);
 
-  ~NativeFontResourceGDI();
+  virtual ~NativeFontResourceGDI();
 
   already_AddRefed<UnscaledFont> CreateUnscaledFont(
       uint32_t aIndex, const uint8_t* aInstanceData,
       uint32_t aInstanceDataLength) final;
 
  private:
   explicit NativeFontResourceGDI(HANDLE aFontResourceHandle)
       : mFontResourceHandle(aFontResourceHandle) {}
--- a/gfx/2d/PathCairo.h
+++ b/gfx/2d/PathCairo.h
@@ -17,30 +17,28 @@ namespace gfx {
 class PathCairo;
 
 class PathBuilderCairo : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCairo, override)
 
   explicit PathBuilderCairo(FillRule aFillRule);
 
-  virtual void MoveTo(const Point &aPoint) override;
-  virtual void LineTo(const Point &aPoint) override;
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3) override;
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
-  virtual void Close() override;
-  virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
-                   float aEndAngle, bool aAntiClockwise = false) override;
-  virtual Point CurrentPoint() const override;
-  virtual already_AddRefed<Path> Finish() override;
+  void MoveTo(const Point &aPoint) override;
+  void LineTo(const Point &aPoint) override;
+  void BezierTo(const Point &aCP1, const Point &aCP2,
+                const Point &aCP3) override;
+  void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  void Close() override;
+  void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+           float aEndAngle, bool aAntiClockwise = false) override;
+  Point CurrentPoint() const override;
+  already_AddRefed<Path> Finish() override;
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::CAIRO;
-  }
+  BackendType GetBackendType() const override { return BackendType::CAIRO; }
 
  private:  // data
   friend class PathCairo;
 
   FillRule mFillRule;
   std::vector<cairo_path_data_t> mPathData;
   // It's easiest to track this here, parsing the path data to find the current
   // point is a little tricky.
@@ -50,43 +48,40 @@ class PathBuilderCairo : public PathBuil
 
 class PathCairo : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathCairo, override)
 
   PathCairo(FillRule aFillRule, std::vector<cairo_path_data_t> &aPathData,
             const Point &aCurrentPoint);
   explicit PathCairo(cairo_t *aContext);
-  ~PathCairo();
+  virtual ~PathCairo();
+
+  BackendType GetBackendType() const override { return BackendType::CAIRO; }
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::CAIRO;
-  }
-
-  virtual already_AddRefed<PathBuilder> CopyToBuilder(
+  already_AddRefed<PathBuilder> CopyToBuilder(
       FillRule aFillRule) const override;
-  virtual already_AddRefed<PathBuilder> TransformedCopyToBuilder(
+  already_AddRefed<PathBuilder> TransformedCopyToBuilder(
       const Matrix &aTransform, FillRule aFillRule) const override;
 
-  virtual bool ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const override;
+  bool ContainsPoint(const Point &aPoint,
+                     const Matrix &aTransform) const override;
 
-  virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const override;
+  bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
+                           const Point &aPoint,
+                           const Matrix &aTransform) const override;
 
-  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
+  Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
 
-  virtual Rect GetStrokedBounds(
-      const StrokeOptions &aStrokeOptions,
-      const Matrix &aTransform = Matrix()) const override;
+  Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
+                        const Matrix &aTransform = Matrix()) const override;
 
-  virtual void StreamToSink(PathSink *aSink) const override;
+  void StreamToSink(PathSink *aSink) const override;
 
-  virtual FillRule GetFillRule() const override { return mFillRule; }
+  FillRule GetFillRule() const override { return mFillRule; }
 
   void SetPathOnContext(cairo_t *aContext) const;
 
   void AppendPathToBuilder(PathBuilderCairo *aBuilder,
                            const Matrix *aTransform = nullptr) const;
 
  private:
   void EnsureContainingContext(const Matrix &aTransform) const;
--- a/gfx/2d/PathSkia.h
+++ b/gfx/2d/PathSkia.h
@@ -18,73 +18,68 @@ class PathSkia;
 class PathBuilderSkia : public PathBuilder {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderSkia, override)
 
   PathBuilderSkia(const Matrix &aTransform, const SkPath &aPath,
                   FillRule aFillRule);
   explicit PathBuilderSkia(FillRule aFillRule);
 
-  virtual void MoveTo(const Point &aPoint) override;
-  virtual void LineTo(const Point &aPoint) override;
-  virtual void BezierTo(const Point &aCP1, const Point &aCP2,
-                        const Point &aCP3) override;
-  virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
-  virtual void Close() override;
-  virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
-                   float aEndAngle, bool aAntiClockwise = false) override;
-  virtual Point CurrentPoint() const override;
-  virtual already_AddRefed<Path> Finish() override;
+  void MoveTo(const Point &aPoint) override;
+  void LineTo(const Point &aPoint) override;
+  void BezierTo(const Point &aCP1, const Point &aCP2,
+                const Point &aCP3) override;
+  void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
+  void Close() override;
+  void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
+           float aEndAngle, bool aAntiClockwise = false) override;
+  Point CurrentPoint() const override;
+  already_AddRefed<Path> Finish() override;
 
   void AppendPath(const SkPath &aPath);
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::SKIA;
-  }
+  BackendType GetBackendType() const override { return BackendType::SKIA; }
 
  private:
   void SetFillRule(FillRule aFillRule);
 
   SkPath mPath;
   FillRule mFillRule;
 };
 
 class PathSkia : public Path {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSkia, override)
 
   PathSkia(SkPath &aPath, FillRule aFillRule) : mFillRule(aFillRule) {
     mPath.swap(aPath);
   }
 
-  virtual BackendType GetBackendType() const override {
-    return BackendType::SKIA;
-  }
+  BackendType GetBackendType() const override { return BackendType::SKIA; }
 
-  virtual already_AddRefed<PathBuilder> CopyToBuilder(
+  already_AddRefed<PathBuilder> CopyToBuilder(
       FillRule aFillRule) const override;
-  virtual already_AddRefed<PathBuilder> TransformedCopyToBuilder(
+  already_AddRefed<PathBuilder> TransformedCopyToBuilder(
       const Matrix &aTransform, FillRule aFillRule) const override;
 
-  virtual bool ContainsPoint(const Point &aPoint,
-                             const Matrix &aTransform) const override;
+  bool ContainsPoint(const Point &aPoint,
+                     const Matrix &aTransform) const override;
 
-  virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
-                                   const Point &aPoint,
-                                   const Matrix &aTransform) const override;
+  bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
+                           const Point &aPoint,
+                           const Matrix &aTransform) const override;
 
-  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
+  Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
 
-  virtual Rect GetStrokedBounds(
-      const StrokeOptions &aStrokeOptions,
-      const Matrix &aTransform = Matrix()) const override;
+  Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
+                        const Matrix &aTransform = Matrix()) const override;
 
-  virtual void StreamToSink(PathSink *aSink) const override;
+  void StreamToSink(PathSink *aSink) const override;
 
-  virtual FillRule GetFillRule() const override { return mFillRule; }
+  FillRule GetFillRule() const override { return mFillRule; }
 
   const SkPath &GetPath() const { return mPath; }
 
  private:
   friend class DrawTargetSkia;
 
   SkPath mPath;
   FillRule mFillRule;
--- a/gfx/2d/PatternHelpers.h
+++ b/gfx/2d/PatternHelpers.h
@@ -20,21 +20,21 @@ namespace gfx {
  * stack before passing it in to the creation function). Without this class
  * writing pattern creation functions would be a pain since Pattern objects are
  * not reference counted, making lifetime management of instances created on
  * the free-store and returned from a creation function hazardous. Besides
  * that, in the case that ColorPattern's are expected to be common, it is
  * particularly desirable to avoid the overhead of allocating on the
  * free-store.
  */
-class GeneralPattern {
+class GeneralPattern final {
  public:
-  explicit GeneralPattern() : mPattern(nullptr) {}
+  explicit GeneralPattern() = default;
 
-  GeneralPattern(const GeneralPattern &aOther) : mPattern(nullptr) {}
+  GeneralPattern(const GeneralPattern &aOther) {}
 
   ~GeneralPattern() {
     if (mPattern) {
       mPattern->~Pattern();
     }
   }
 
   Pattern *Init(const Pattern &aPattern) {
@@ -110,15 +110,15 @@ class GeneralPattern {
 
  private:
   union {
     AlignedStorage2<ColorPattern> mColorPattern;
     AlignedStorage2<LinearGradientPattern> mLinearGradientPattern;
     AlignedStorage2<RadialGradientPattern> mRadialGradientPattern;
     AlignedStorage2<SurfacePattern> mSurfacePattern;
   };
-  Pattern *mPattern;
+  Pattern *mPattern = nullptr;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif  //  _MOZILLA_GFX_PATTERNHELPERS_H
--- a/gfx/2d/Polygon.h
+++ b/gfx/2d/Polygon.h
@@ -152,17 +152,17 @@ void ClipPointsWithPlane(const nsTArray<
  * PolygonTyped stores the points of a convex planar polygon.
  */
 template <class Units>
 class PolygonTyped {
   typedef Point3DTyped<Units> Point3DType;
   typedef Point4DTyped<Units> Point4DType;
 
  public:
-  PolygonTyped() {}
+  PolygonTyped() = default;
 
   explicit PolygonTyped(const nsTArray<Point4DType>& aPoints,
                         const Point4DType& aNormal = DefaultNormal())
       : mNormal(aNormal), mPoints(aPoints) {}
 
   explicit PolygonTyped(nsTArray<Point4DType>&& aPoints,
                         const Point4DType& aNormal = DefaultNormal())
       : mNormal(aNormal), mPoints(std::move(aPoints)) {}
--- a/gfx/2d/RecordedEvent.h
+++ b/gfx/2d/RecordedEvent.h
@@ -66,17 +66,17 @@ struct RecordedFontDetails {
 inline std::string StringFromPtr(ReferencePtr aPtr) {
   std::stringstream stream;
   stream << aPtr;
   return stream.str();
 }
 
 class Translator {
  public:
-  virtual ~Translator() {}
+  virtual ~Translator() = default;
 
   virtual DrawTarget *LookupDrawTarget(ReferencePtr aRefPtr) = 0;
   virtual Path *LookupPath(ReferencePtr aRefPtr) = 0;
   virtual SourceSurface *LookupSourceSurface(ReferencePtr aRefPtr) = 0;
   virtual FilterNode *LookupFilterNode(ReferencePtr aRefPtr) = 0;
   virtual GradientStops *LookupGradientStops(ReferencePtr aRefPtr) = 0;
   virtual ScaledFont *LookupScaledFont(ReferencePtr aRefPtr) = 0;
   virtual UnscaledFont *LookupUnscaledFont(ReferencePtr aRefPtr) = 0;
@@ -248,17 +248,17 @@ class RecordedEvent {
     UNSCALEDFONTCREATION,
     UNSCALEDFONTDESTRUCTION,
     INTOLUMINANCE,
     EXTERNALSURFACECREATION,
   };
   static const uint32_t kTotalEventTypes =
       RecordedEvent::FILTERNODESETINPUT + 1;
 
-  virtual ~RecordedEvent() {}
+  virtual ~RecordedEvent() = default;
 
   static std::string GetEventName(EventType aType);
 
   /**
    * Play back this event using the translator. Note that derived classes
    * should
    * only return false when there is a fatal error, as it will probably mean
    * the
--- a/gfx/2d/RecordedEventImpl.h
+++ b/gfx/2d/RecordedEventImpl.h
@@ -38,28 +38,28 @@ class RecordedEventDerived : public Reco
     MemWriter writer(aStream.mData + aStream.mLength - size.mTotalSize);
     static_cast<const Derived *>(this)->Record(writer);
   }
 };
 
 template <class Derived>
 class RecordedDrawingEvent : public RecordedEventDerived<Derived> {
  public:
-  virtual ReferencePtr GetDestinedDT() override { return mDT; }
+  ReferencePtr GetDestinedDT() override { return mDT; }
 
  protected:
   RecordedDrawingEvent(RecordedEvent::EventType aType, DrawTarget *aTarget)
       : RecordedEventDerived<Derived>(aType), mDT(aTarget) {}
 
   template <class S>
   RecordedDrawingEvent(RecordedEvent::EventType aType, S &aStream);
   template <class S>
   void Record(S &aStream) const;
 
-  virtual ReferencePtr GetObjectRef() const override;
+  ReferencePtr GetObjectRef() const override;
 
   ReferencePtr mDT;
 };
 
 class RecordedDrawTargetCreation
     : public RecordedEventDerived<RecordedDrawTargetCreation> {
  public:
   RecordedDrawTargetCreation(ReferencePtr aRefPtr, BackendType aType,
@@ -69,25 +69,25 @@ class RecordedDrawTargetCreation
       : RecordedEventDerived(DRAWTARGETCREATION),
         mRefPtr(aRefPtr),
         mBackendType(aType),
         mSize(aSize),
         mFormat(aFormat),
         mHasExistingData(aHasExistingData),
         mExistingData(aExistingData) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override { return "DrawTarget Creation"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  std::string GetName() const override { return "DrawTarget Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   ReferencePtr mRefPtr;
   BackendType mBackendType;
   IntSize mSize;
   SurfaceFormat mFormat;
   bool mHasExistingData;
   RefPtr<SourceSurface> mExistingData;
 
@@ -101,27 +101,24 @@ class RecordedDrawTargetCreation
 class RecordedDrawTargetDestruction
     : public RecordedEventDerived<RecordedDrawTargetDestruction> {
  public:
   MOZ_IMPLICIT RecordedDrawTargetDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(DRAWTARGETDESTRUCTION),
         mRefPtr(aRefPtr),
         mBackendType(BackendType::NONE) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "DrawTarget Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "DrawTarget Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   ReferencePtr mRefPtr;
 
   BackendType mBackendType;
 
  private:
   friend class RecordedEvent;
 
@@ -134,27 +131,25 @@ class RecordedCreateSimilarDrawTarget
  public:
   RecordedCreateSimilarDrawTarget(ReferencePtr aRefPtr, const IntSize &aSize,
                                   SurfaceFormat aFormat)
       : RecordedEventDerived(CREATESIMILARDRAWTARGET),
         mRefPtr(aRefPtr),
         mSize(aSize),
         mFormat(aFormat) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override {
-    return "CreateSimilarDrawTarget";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  std::string GetName() const override { return "CreateSimilarDrawTarget"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   ReferencePtr mRefPtr;
   IntSize mSize;
   SurfaceFormat mFormat;
 
  private:
   friend class RecordedEvent;
 
@@ -169,27 +164,25 @@ class RecordedCreateClippedDrawTarget
                                   const Matrix &aTransform,
                                   SurfaceFormat aFormat)
       : RecordedEventDerived(CREATECLIPPEDDRAWTARGET),
         mRefPtr(aRefPtr),
         mMaxSize(aMaxSize),
         mTransform(aTransform),
         mFormat(aFormat) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override {
-    return "CreateClippedDrawTarget";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  std::string GetName() const override { return "CreateClippedDrawTarget"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   ReferencePtr mRefPtr;
   IntSize mMaxSize;
   Matrix mTransform;
   SurfaceFormat mFormat;
 
  private:
   friend class RecordedEvent;
@@ -211,27 +204,27 @@ class RecordedCreateDrawTargetForFilter
         mRefPtr(aRefPtr),
         mMaxSize(aMaxSize),
         mFormat(aFormat),
         mFilter(aFilter),
         mSource(aSource),
         mSourceRect(aSourceRect),
         mDestPoint(aDestPoint) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override {
+  std::string GetName() const override {
     return "CreateSimilarDrawTargetForFilter";
   }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   ReferencePtr mRefPtr;
   IntSize mMaxSize;
   SurfaceFormat mFormat;
   ReferencePtr mFilter;
   ReferencePtr mSource;
   Rect mSourceRect;
   Point mDestPoint;
@@ -249,24 +242,23 @@ class RecordedFillRect : public Recorded
                    const DrawOptions &aOptions)
       : RecordedDrawingEvent(FILLRECT, aDT),
         mRect(aRect),
         mPattern(),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "FillRect"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "FillRect"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedFillRect(S &aStream);
 
   Rect mRect;
@@ -283,24 +275,23 @@ class RecordedStrokeRect : public Record
       : RecordedDrawingEvent(STROKERECT, aDT),
         mRect(aRect),
         mPattern(),
         mStrokeOptions(aStrokeOptions),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "StrokeRect"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "StrokeRect"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedStrokeRect(S &aStream);
 
   Rect mRect;
@@ -319,24 +310,23 @@ class RecordedStrokeLine : public Record
         mBegin(aBegin),
         mEnd(aEnd),
         mPattern(),
         mStrokeOptions(aStrokeOptions),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "StrokeLine"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "StrokeLine"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedStrokeLine(S &aStream);
 
   Point mBegin;
@@ -352,24 +342,23 @@ class RecordedFill : public RecordedDraw
                const DrawOptions &aOptions)
       : RecordedDrawingEvent(FILL, aDT),
         mPath(aPath),
         mPattern(),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Fill"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Fill"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedFill(S &aStream);
 
   ReferencePtr mPath;
@@ -388,24 +377,23 @@ class RecordedFillGlyphs : public Record
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
     mNumGlyphs = aNumGlyphs;
     mGlyphs = new Glyph[aNumGlyphs];
     memcpy(mGlyphs, aGlyphs, sizeof(Glyph) * aNumGlyphs);
   }
   virtual ~RecordedFillGlyphs();
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "FillGlyphs"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "FillGlyphs"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedFillGlyphs(S &aStream);
 
   ReferencePtr mScaledFont;
@@ -422,24 +410,23 @@ class RecordedMask : public RecordedDraw
       : RecordedDrawingEvent(MASK, aDT),
         mSource(),
         mMask(),
         mOptions(aOptions) {
     StorePattern(mSource, aSource);
     StorePattern(mMask, aMask);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Mask"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Mask"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedMask(S &aStream);
 
   PatternStorage mSource;
@@ -455,24 +442,24 @@ class RecordedStroke : public RecordedDr
       : RecordedDrawingEvent(STROKE, aDT),
         mPath(aPath),
         mPattern(),
         mStrokeOptions(aStrokeOptions),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override { return "Stroke"; }
+  std::string GetName() const override { return "Stroke"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedStroke(S &aStream);
 
   ReferencePtr mPath;
@@ -481,24 +468,23 @@ class RecordedStroke : public RecordedDr
   DrawOptions mOptions;
 };
 
 class RecordedClearRect : public RecordedDrawingEvent<RecordedClearRect> {
  public:
   RecordedClearRect(DrawTarget *aDT, const Rect &aRect)
       : RecordedDrawingEvent(CLEARRECT, aDT), mRect(aRect) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "ClearRect"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "ClearRect"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedClearRect(S &aStream);
 
   Rect mRect;
@@ -508,24 +494,23 @@ class RecordedCopySurface : public Recor
  public:
   RecordedCopySurface(DrawTarget *aDT, ReferencePtr aSourceSurface,
                       const IntRect &aSourceRect, const IntPoint &aDest)
       : RecordedDrawingEvent(COPYSURFACE, aDT),
         mSourceSurface(aSourceSurface),
         mSourceRect(aSourceRect),
         mDest(aDest) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "CopySurface"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "CopySurface"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedCopySurface(S &aStream);
 
   ReferencePtr mSourceSurface;
@@ -533,70 +518,67 @@ class RecordedCopySurface : public Recor
   IntPoint mDest;
 };
 
 class RecordedPushClip : public RecordedDrawingEvent<RecordedPushClip> {
  public:
   RecordedPushClip(DrawTarget *aDT, ReferencePtr aPath)
       : RecordedDrawingEvent(PUSHCLIP, aDT), mPath(aPath) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "PushClip"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "PushClip"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPushClip(S &aStream);
 
   ReferencePtr mPath;
 };
 
 class RecordedPushClipRect : public RecordedDrawingEvent<RecordedPushClipRect> {
  public:
   RecordedPushClipRect(DrawTarget *aDT, const Rect &aRect)
       : RecordedDrawingEvent(PUSHCLIPRECT, aDT), mRect(aRect) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "PushClipRect"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "PushClipRect"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPushClipRect(S &aStream);
 
   Rect mRect;
 };
 
 class RecordedPopClip : public RecordedDrawingEvent<RecordedPopClip> {
  public:
   MOZ_IMPLICIT RecordedPopClip(DrawTarget *aDT)
       : RecordedDrawingEvent(POPCLIP, aDT) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "PopClip"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "PopClip"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPopClip(S &aStream);
 };
 
@@ -608,24 +590,23 @@ class RecordedPushLayer : public Recorde
       : RecordedDrawingEvent(PUSHLAYER, aDT),
         mOpaque(aOpaque),
         mOpacity(aOpacity),
         mMask(aMask),
         mMaskTransform(aMaskTransform),
         mBounds(aBounds),
         mCopyBackground(aCopyBackground) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "PushLayer"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "PushLayer"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPushLayer(S &aStream);
 
   bool mOpaque;
@@ -647,24 +628,24 @@ class RecordedPushLayerWithBlend
         mOpaque(aOpaque),
         mOpacity(aOpacity),
         mMask(aMask),
         mMaskTransform(aMaskTransform),
         mBounds(aBounds),
         mCopyBackground(aCopyBackground),
         mCompositionOp(aCompositionOp) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream &aStringStream) const override;
 
-  virtual std::string GetName() const override { return "PushLayerWithBlend"; }
+  std::string GetName() const override { return "PushLayerWithBlend"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPushLayerWithBlend(S &aStream);
 
   bool mOpaque;
@@ -676,45 +657,43 @@ class RecordedPushLayerWithBlend
   CompositionOp mCompositionOp;
 };
 
 class RecordedPopLayer : public RecordedDrawingEvent<RecordedPopLayer> {
  public:
   MOZ_IMPLICIT RecordedPopLayer(DrawTarget *aDT)
       : RecordedDrawingEvent(POPLAYER, aDT) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "PopLayer"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "PopLayer"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedPopLayer(S &aStream);
 };
 
 class RecordedSetTransform : public RecordedDrawingEvent<RecordedSetTransform> {
  public:
   RecordedSetTransform(DrawTarget *aDT, const Matrix &aTransform)
       : RecordedDrawingEvent(SETTRANSFORM, aDT), mTransform(aTransform) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "SetTransform"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "SetTransform"; }
 
   Matrix mTransform;
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedSetTransform(S &aStream);
@@ -728,24 +707,23 @@ class RecordedDrawSurface : public Recor
                       const DrawOptions &aOptions)
       : RecordedDrawingEvent(DRAWSURFACE, aDT),
         mRefSource(aRefSource),
         mDest(aDest),
         mSource(aSource),
         mDSOptions(aDSOptions),
         mOptions(aOptions) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "DrawSurface"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "DrawSurface"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedDrawSurface(S &aStream);
 
   ReferencePtr mRefSource;
@@ -762,26 +740,23 @@ class RecordedDrawDependentSurface
                                const DrawSurfaceOptions &aDSOptions,
                                const DrawOptions &aOptions)
       : RecordedDrawingEvent(DRAWDEPENDENTSURFACE, aDT),
         mId(aId),
         mDest(aDest),
         mDSOptions(aDSOptions),
         mOptions(aOptions) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "DrawDependentSurface";
-  }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "DrawDependentSurface"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedDrawDependentSurface(S &aStream);
 
   uint64_t mId;
@@ -800,26 +775,23 @@ class RecordedDrawSurfaceWithShadow
       : RecordedDrawingEvent(DRAWSURFACEWITHSHADOW, aDT),
         mRefSource(aRefSource),
         mDest(aDest),
         mColor(aColor),
         mOffset(aOffset),
         mSigma(aSigma),
         mOp(aOp) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "DrawSurfaceWithShadow";
-  }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "DrawSurfaceWithShadow"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedDrawSurfaceWithShadow(S &aStream);
 
   ReferencePtr mRefSource;
@@ -836,24 +808,23 @@ class RecordedDrawFilter : public Record
                      const Rect &aSourceRect, const Point &aDestPoint,
                      const DrawOptions &aOptions)
       : RecordedDrawingEvent(DRAWFILTER, aDT),
         mNode(aNode),
         mSourceRect(aSourceRect),
         mDestPoint(aDestPoint),
         mOptions(aOptions) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "DrawFilter"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "DrawFilter"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedDrawFilter(S &aStream);
 
   ReferencePtr mNode;
@@ -862,25 +833,24 @@ class RecordedDrawFilter : public Record
   DrawOptions mOptions;
 };
 
 class RecordedPathCreation : public RecordedEventDerived<RecordedPathCreation> {
  public:
   MOZ_IMPLICIT RecordedPathCreation(PathRecording *aPath);
   ~RecordedPathCreation();
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Path Creation"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Path Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   FillRule mFillRule;
   std::vector<PathOp> mPathOps;
 
@@ -889,25 +859,24 @@ class RecordedPathCreation : public Reco
 };
 
 class RecordedPathDestruction
     : public RecordedEventDerived<RecordedPathDestruction> {
  public:
   MOZ_IMPLICIT RecordedPathDestruction(PathRecording *aPath)
       : RecordedEventDerived(PATHDESTRUCTION), mRefPtr(aPath) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Path Destruction"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Path Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedPathDestruction(S &aStream);
@@ -924,27 +893,24 @@ class RecordedSourceSurfaceCreation
         mData(aData),
         mStride(aStride),
         mSize(aSize),
         mFormat(aFormat),
         mDataOwned(false) {}
 
   ~RecordedSourceSurfaceCreation();
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "SourceSurface Creation";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "SourceSurface Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   uint8_t *mData;
   int32_t mStride;
   IntSize mSize;
@@ -956,27 +922,24 @@ class RecordedSourceSurfaceCreation
 };
 
 class RecordedSourceSurfaceDestruction
     : public RecordedEventDerived<RecordedSourceSurfaceDestruction> {
  public:
   MOZ_IMPLICIT RecordedSourceSurfaceDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(SOURCESURFACEDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "SourceSurface Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "SourceSurface Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedSourceSurfaceDestruction(S &aStream);
@@ -1018,25 +981,24 @@ class RecordedFilterNodeCreation
  public:
   RecordedFilterNodeCreation(ReferencePtr aRefPtr, FilterType aType)
       : RecordedEventDerived(FILTERNODECREATION),
         mRefPtr(aRefPtr),
         mType(aType) {}
 
   ~RecordedFilterNodeCreation();
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "FilterNode Creation"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "FilterNode Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   FilterType mType;
 
   template <class S>
@@ -1044,27 +1006,24 @@ class RecordedFilterNodeCreation
 };
 
 class RecordedFilterNodeDestruction
     : public RecordedEventDerived<RecordedFilterNodeDestruction> {
  public:
   MOZ_IMPLICIT RecordedFilterNodeDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(FILTERNODEDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "FilterNode Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "FilterNode Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedFilterNodeDestruction(S &aStream);
@@ -1079,27 +1038,24 @@ class RecordedGradientStopsCreation
         mRefPtr(aRefPtr),
         mStops(aStops),
         mNumStops(aNumStops),
         mExtendMode(aExtendMode),
         mDataOwned(false) {}
 
   ~RecordedGradientStopsCreation();
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "GradientStops Creation";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "GradientStops Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   GradientStop *mStops;
   uint32_t mNumStops;
   ExtendMode mExtendMode;
@@ -1110,51 +1066,47 @@ class RecordedGradientStopsCreation
 };
 
 class RecordedGradientStopsDestruction
     : public RecordedEventDerived<RecordedGradientStopsDestruction> {
  public:
   MOZ_IMPLICIT RecordedGradientStopsDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(GRADIENTSTOPSDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "GradientStops Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "GradientStops Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedGradientStopsDestruction(S &aStream);
 };
 
 class RecordedSnapshot : public RecordedEventDerived<RecordedSnapshot> {
  public:
   RecordedSnapshot(ReferencePtr aRefPtr, DrawTarget *aDT)
       : RecordedEventDerived(SNAPSHOT), mRefPtr(aRefPtr), mDT(aDT) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Snapshot"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Snapshot"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   ReferencePtr mDT;
 
   template <class S>
@@ -1167,25 +1119,24 @@ class RecordedIntoLuminanceSource
   RecordedIntoLuminanceSource(ReferencePtr aRefPtr, DrawTarget *aDT,
                               LuminanceType aLuminanceType, float aOpacity)
       : RecordedEventDerived(INTOLUMINANCE),
         mRefPtr(aRefPtr),
         mDT(aDT),
         mLuminanceType(aLuminanceType),
         mOpacity(aOpacity) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "IntoLuminanceSource"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "IntoLuminanceSource"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   ReferencePtr mDT;
   LuminanceType mLuminanceType;
   float mOpacity;
@@ -1206,29 +1157,28 @@ class RecordedFontData : public Recorded
       : RecordedEventDerived(FONTDATA),
         mType(aUnscaledFont->GetType()),
         mData(nullptr),
         mFontDetails() {
     mGetFontFileDataSucceeded =
         aUnscaledFont->GetFontFileData(&FontDataProc, this) && mData;
   }
 
-  ~RecordedFontData();
+  virtual ~RecordedFontData();
 
   bool IsValid() const { return mGetFontFileDataSucceeded; }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Font Data"; }
-  virtual ReferencePtr GetObjectRef() const override { return nullptr; };
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Font Data"; }
+  ReferencePtr GetObjectRef() const override { return nullptr; };
 
   void SetFontData(const uint8_t *aData, uint32_t aSize, uint32_t aIndex);
 
   bool GetFontDetails(RecordedFontDetails &fontDetails);
 
  private:
   friend class RecordedEvent;
 
@@ -1254,29 +1204,28 @@ class RecordedFontDescriptor
   explicit RecordedFontDescriptor(UnscaledFont *aUnscaledFont)
       : RecordedEventDerived(FONTDESC),
         mType(aUnscaledFont->GetType()),
         mIndex(0),
         mRefPtr(aUnscaledFont) {
     mHasDesc = aUnscaledFont->GetFontDescriptor(FontDescCb, this);
   }
 
-  ~RecordedFontDescriptor();
+  virtual ~RecordedFontDescriptor();
 
   bool IsValid() const { return mHasDesc; }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "Font Desc"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "Font Desc"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   void SetFontDescriptor(const uint8_t *aData, uint32_t aSize, uint32_t aIndex);
 
   bool mHasDesc;
 
@@ -1303,27 +1252,24 @@ class RecordedUnscaledFontCreation
                                RecordedFontDetails aFontDetails)
       : RecordedEventDerived(UNSCALEDFONTCREATION),
         mRefPtr(aUnscaledFont),
         mFontDataKey(aFontDetails.fontDataKey),
         mIndex(aFontDetails.index) {
     aUnscaledFont->GetFontInstanceData(FontInstanceDataProc, this);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "UnscaledFont Creation";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "UnscaledFont Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   void SetFontInstanceData(const uint8_t *aData, uint32_t aSize);
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
   uint64_t mFontDataKey;
@@ -1335,26 +1281,23 @@ class RecordedUnscaledFontCreation
 };
 
 class RecordedUnscaledFontDestruction
     : public RecordedEventDerived<RecordedUnscaledFontDestruction> {
  public:
   MOZ_IMPLICIT RecordedUnscaledFontDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(UNSCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "UnscaledFont Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "UnscaledFont Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedUnscaledFontDestruction(S &aStream);
@@ -1376,25 +1319,24 @@ class RecordedScaledFontCreation
                              UnscaledFont *aUnscaledFont)
       : RecordedEventDerived(SCALEDFONTCREATION),
         mRefPtr(aScaledFont),
         mUnscaledFont(aUnscaledFont),
         mGlyphSize(aScaledFont->GetSize()) {
     aScaledFont->GetFontInstanceData(FontInstanceDataProc, this);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "ScaledFont Creation"; }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "ScaledFont Creation"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
   void SetFontInstanceData(const uint8_t *aData, uint32_t aSize,
                            const FontVariation *aVariations,
                            uint32_t aNumVariations);
 
  private:
   friend class RecordedEvent;
 
@@ -1409,27 +1351,24 @@ class RecordedScaledFontCreation
 };
 
 class RecordedScaledFontDestruction
     : public RecordedEventDerived<RecordedScaledFontDestruction> {
  public:
   MOZ_IMPLICIT RecordedScaledFontDestruction(ReferencePtr aRefPtr)
       : RecordedEventDerived(SCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override {
-    return "ScaledFont Destruction";
-  }
-  virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "ScaledFont Destruction"; }
+  ReferencePtr GetObjectRef() const override { return mRefPtr; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mRefPtr;
 
   template <class S>
   MOZ_IMPLICIT RecordedScaledFontDestruction(S &aStream);
@@ -1443,24 +1382,23 @@ class RecordedMaskSurface : public Recor
       : RecordedDrawingEvent(MASKSURFACE, aDT),
         mPattern(),
         mRefMask(aRefMask),
         mOffset(aOffset),
         mOptions(aOptions) {
     StorePattern(mPattern, aPattern);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
 
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "MaskSurface"; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "MaskSurface"; }
 
  private:
   friend class RecordedEvent;
 
   template <class S>
   MOZ_IMPLICIT RecordedMaskSurface(S &aStream);
 
   PatternStorage mPattern;
@@ -1505,24 +1443,23 @@ class RecordedFilterNodeSetAttribute
       : RecordedEventDerived(FILTERNODESETATTRIBUTE),
         mNode(aNode),
         mIndex(aIndex),
         mArgType(ARGTYPE_FLOAT_ARRAY) {
     mPayload.resize(sizeof(Float) * aSize);
     memcpy(&mPayload.front(), aFloat, sizeof(Float) * aSize);
   }
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "SetAttribute"; }
-  virtual ReferencePtr GetObjectRef() const override { return mNode; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "SetAttribute"; }
+  ReferencePtr GetObjectRef() const override { return mNode; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mNode;
 
   uint32_t mIndex;
   ArgType mArgType;
@@ -1546,24 +1483,23 @@ class RecordedFilterNodeSetInput
   RecordedFilterNodeSetInput(FilterNode *aNode, uint32_t aIndex,
                              SourceSurface *aInputSurface)
       : RecordedEventDerived(FILTERNODESETINPUT),
         mNode(aNode),
         mIndex(aIndex),
         mInputFilter(nullptr),
         mInputSurface(aInputSurface) {}
 
-  virtual bool PlayEvent(Translator *aTranslator) const override;
+  bool PlayEvent(Translator *aTranslator) const override;
   template <class S>
   void Record(S &aStream) const;
-  virtual void OutputSimpleEventInfo(
-      std::stringstream &aStringStream) const override;
-
-  virtual std::string GetName() const override { return "SetInput"; }
-  virtual ReferencePtr GetObjectRef() const override { return mNode; }
+  void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
+
+  std::string GetName() const override { return "SetInput"; }
+  ReferencePtr GetObjectRef() const override { return mNode; }
 
  private:
   friend class RecordedEvent;
 
   ReferencePtr mNode;
   uint32_t mIndex;
   ReferencePtr mInputFilter;
   ReferencePtr mInputSurface;
--- a/gfx/2d/Rect.h
+++ b/gfx/2d/Rect.h
@@ -353,26 +353,26 @@ Maybe<Rect> UnionMaybeRects(const Maybe<
     return b;
   } else if (!b) {
     return a;
   } else {
     return Some(a->Union(*b));
   }
 }
 
-struct RectCornerRadii {
+struct RectCornerRadii final {
   Size radii[eCornerCount];
 
-  RectCornerRadii() {}
+  RectCornerRadii() = default;
 
   explicit RectCornerRadii(Float radius) {
     NS_FOR_CSS_FULL_CORNERS(i) { radii[i].SizeTo(radius, radius); }
   }
 
-  explicit RectCornerRadii(Float radiusX, Float radiusY) {
+  RectCornerRadii(Float radiusX, Float radiusY) {
     NS_FOR_CSS_FULL_CORNERS(i) { radii[i].SizeTo(radiusX, radiusY); }
   }
 
   RectCornerRadii(Float tl, Float tr, Float br, Float bl) {
     radii[eCornerTopLeft].SizeTo(tl, tl);
     radii[eCornerTopRight].SizeTo(tr, tr);
     radii[eCornerBottomRight].SizeTo(br, br);
     radii[eCornerBottomLeft].SizeTo(bl, bl);
--- a/gfx/2d/ScaledFontMac.cpp
+++ b/gfx/2d/ScaledFontMac.cpp
@@ -35,17 +35,17 @@ CGPathRef CGFontGetGlyphPath(CGFontRef f
 #endif
 
 namespace mozilla {
 namespace gfx {
 
 // Simple helper class to automatically release a CFObject when it goes out
 // of scope.
 template <class T>
-class AutoRelease {
+class AutoRelease final {
  public:
   explicit AutoRelease(T aObject) : mObject(aObject) {}
 
   ~AutoRelease() {
     if (mObject) {
       CFRelease(mObject);
     }
   }
@@ -225,17 +225,17 @@ static int maxPow2LessThan(int a) {
   int x = 1;
   int shift = 0;
   while ((x << (shift + 1)) < a) {
     shift++;
   }
   return shift;
 }
 
-struct writeBuf {
+struct writeBuf final {
   explicit writeBuf(int size) {
     this->data = new unsigned char[size];
     this->offset = 0;
   }
   ~writeBuf() { delete[] this->data; }
 
   template <class T>
   void writeElement(T a) {
--- a/gfx/2d/SourceSurfaceCairo.h
+++ b/gfx/2d/SourceSurfaceCairo.h
@@ -23,20 +23,20 @@ class SourceSurfaceCairo : public Source
   // If aDrawTarget is non-nullptr, it is assumed that this is a snapshot source
   // surface, and we'll call DrawTargetCairo::RemoveSnapshot(this) on it when
   // we're destroyed.
   SourceSurfaceCairo(cairo_surface_t* aSurface, const IntSize& aSize,
                      const SurfaceFormat& aFormat,
                      DrawTargetCairo* aDrawTarget = nullptr);
   virtual ~SourceSurfaceCairo();
 
-  virtual SurfaceType GetType() const override { return SurfaceType::CAIRO; }
-  virtual IntSize GetSize() const override;
-  virtual SurfaceFormat GetFormat() const override;
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
+  SurfaceType GetType() const override { return SurfaceType::CAIRO; }
+  IntSize GetSize() const override;
+  SurfaceFormat GetFormat() const override;
+  already_AddRefed<DataSourceSurface> GetDataSurface() override;
 
   cairo_surface_t* GetSurface() const;
 
  private:  // methods
   friend class DrawTargetCairo;
   void DrawTargetWillChange();
 
  private:  // data
@@ -47,24 +47,22 @@ class SourceSurfaceCairo : public Source
 };
 
 class DataSourceSurfaceCairo : public DataSourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCairo, override)
 
   explicit DataSourceSurfaceCairo(cairo_surface_t* imageSurf);
   virtual ~DataSourceSurfaceCairo();
-  virtual unsigned char* GetData() override;
-  virtual int32_t Stride() override;
+  unsigned char* GetData() override;
+  int32_t Stride() override;
 
-  virtual SurfaceType GetType() const override {
-    return SurfaceType::CAIRO_IMAGE;
-  }
-  virtual IntSize GetSize() const override;
-  virtual SurfaceFormat GetFormat() const override;
+  SurfaceType GetType() const override { return SurfaceType::CAIRO_IMAGE; }
+  IntSize GetSize() const override;
+  SurfaceFormat GetFormat() const override;
 
   cairo_surface_t* GetSurface() const;
 
  private:
   cairo_surface_t* mImageSurface;
 };
 
 }  // namespace gfx
--- a/gfx/2d/SourceSurfaceCapture.h
+++ b/gfx/2d/SourceSurfaceCapture.h
@@ -18,21 +18,21 @@ class DrawTargetCaptureImpl;
 
 class SourceSurfaceCapture : public SourceSurface {
   friend class DrawTargetCaptureImpl;
 
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceCapture, override)
 
   explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner);
-  explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
-                                LuminanceType aLuminanceType, float aOpacity);
-  explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
-                                SourceSurface* aSurfToOptimize);
-  ~SourceSurfaceCapture();
+  SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
+                       LuminanceType aLuminanceType, float aOpacity);
+  SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
+                       SourceSurface* aSurfToOptimize);
+  virtual ~SourceSurfaceCapture();
 
   SurfaceType GetType() const override { return SurfaceType::CAPTURE; }
   IntSize GetSize() const override { return mSize; }
   SurfaceFormat GetFormat() const override { return mFormat; }
 
   bool IsValid() const override;
   already_AddRefed<DataSourceSurface> GetDataSurface() override;
 
--- a/gfx/2d/SourceSurfaceD2D1.h
+++ b/gfx/2d/SourceSurfaceD2D1.h
@@ -22,23 +22,21 @@ class SourceSurfaceD2D1 : public SourceS
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceD2D1, override)
 
   SourceSurfaceD2D1(ID2D1Image *aImage, ID2D1DeviceContext *aDC,
                     SurfaceFormat aFormat, const IntSize &aSize,
                     DrawTargetD2D1 *aDT = nullptr);
   ~SourceSurfaceD2D1();
 
-  virtual SurfaceType GetType() const override {
-    return SurfaceType::D2D1_1_IMAGE;
-  }
-  virtual IntSize GetSize() const override { return mSize; }
-  virtual SurfaceFormat GetFormat() const override { return mFormat; }
-  virtual bool IsValid() const override;
-  virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
+  SurfaceType GetType() const override { return SurfaceType::D2D1_1_IMAGE; }
+  IntSize GetSize() const override { return mSize; }
+  SurfaceFormat GetFormat() const override { return mFormat; }
+  bool IsValid() const override;
+  already_AddRefed<DataSourceSurface> GetDataSurface() override;
 
   ID2D1Image *GetImage() { return mImage; }
 
   void EnsureIndependent() {
     if (!mDrawTarget) return;
     DrawTargetWillChange();
   }
 
@@ -72,24 +70,24 @@ class SourceSurfaceD2D1 : public SourceS
 
 class DataSourceSurfaceD2D1 : public DataSourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceD2D1, override)
 
   DataSourceSurfaceD2D1(ID2D1Bitmap1 *aMappableBitmap, SurfaceFormat aFormat);
   ~DataSourceSurfaceD2D1();
 
-  virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
-  virtual IntSize GetSize() const override;
-  virtual SurfaceFormat GetFormat() const override { return mFormat; }
-  virtual bool IsValid() const override { return !!mBitmap; }
-  virtual uint8_t *GetData() override;
-  virtual int32_t Stride() override;
-  virtual bool Map(MapType, MappedSurface *aMappedSurface) override;
-  virtual void Unmap() override;
+  SurfaceType GetType() const override { return SurfaceType::DATA; }
+  IntSize GetSize() const override;
+  SurfaceFormat GetFormat() const override { return mFormat; }
+  bool IsValid() const override { return !!mBitmap; }
+  uint8_t *GetData() override;
+  int32_t Stride() override;
+  bool Map(MapType, MappedSurface *aMappedSurface) override;
+  void Unmap() override;
 
  private:
   friend class SourceSurfaceD2DTarget;
   void EnsureMapped();
 
   mutable RefPtr<ID2D1Bitmap1> mBitmap;
   SurfaceFormat mFormat;
   D2D1_MAPPED_RECT mMap;
--- a/gfx/2d/SourceSurfaceSkia.h
+++ b/gfx/2d/SourceSurfaceSkia.h
@@ -20,21 +20,21 @@ namespace gfx {
 class DrawTargetSkia;
 class SnapshotLock;
 
 class SourceSurfaceSkia : public DataSourceSurface {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceSkia, override)
 
   SourceSurfaceSkia();
-  ~SourceSurfaceSkia();
+  virtual ~SourceSurfaceSkia();
 
-  virtual SurfaceType GetType() const override { return SurfaceType::SKIA; }
-  virtual IntSize GetSize() const override;
-  virtual SurfaceFormat GetFormat() const override;
+  SurfaceType GetType() const override { return SurfaceType::SKIA; }
+  IntSize GetSize() const override;
+  SurfaceFormat GetFormat() const override;
 
   // This is only ever called by the DT destructor, which can only ever happen
   // from one place at a time. Therefore it doesn't need to hold the ChangeMutex
   // as mSurface is never read to directly and is just there to keep the object
   // alive, which itself is refcounted in a thread-safe manner.
   void GiveSurface(sk_sp<SkSurface>& aSurface) {
     mSurface = aSurface;
     mDrawTarget = nullptr;
@@ -44,26 +44,26 @@ class SourceSurfaceSkia : public DataSou
 
   bool InitFromData(unsigned char* aData, const IntSize& aSize, int32_t aStride,
                     SurfaceFormat aFormat);
 
   bool InitFromImage(const sk_sp<SkImage>& aImage,
                      SurfaceFormat aFormat = SurfaceFormat::UNKNOWN,
                      DrawTargetSkia* aOwner = nullptr);
 
-  virtual uint8_t* GetData() override;
+  uint8_t* GetData() override;
 
   /**
    * The caller is responsible for ensuring aMappedSurface is not null.
    */
-  virtual bool Map(MapType, MappedSurface* aMappedSurface) override;
+  bool Map(MapType, MappedSurface* aMappedSurface) override;
 
-  virtual void Unmap() override;
+  void Unmap() override;
 
-  virtual int32_t Stride() override { return mStride; }
+  int32_t Stride() override { return mStride; }
 
  private:
   friend class DrawTargetSkia;
 
   void DrawTargetWillChange();
 
   sk_sp<SkImage> mImage;
   // This keeps a surface alive if needed because its DrawTarget has gone away.
--- a/gfx/2d/StackArray.h
+++ b/gfx/2d/StackArray.h
@@ -4,17 +4,17 @@
  * 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/. */
 
 /* A handy class that will allocate data for size*T objects on the stack and
  * otherwise allocate them on the heap. It is similar in purpose to AutoTArray
  */
 
 template <class T, size_t size>
-class StackArray {
+class StackArray final {
  public:
   explicit StackArray(size_t count) {
     if (count > size) {
       mData = new T[count];
     } else {
       mData = mStackData;
     }
   }
--- a/gfx/2d/Tools.h
+++ b/gfx/2d/Tools.h
@@ -71,17 +71,17 @@ static inline void NudgeToInteger(double
   *aVal = f;
 }
 
 static inline Float Distance(Point aA, Point aB) {
   return hypotf(aB.x - aA.x, aB.y - aA.y);
 }
 
 template <typename T, int alignment = 16>
-struct AlignedArray {
+struct AlignedArray final {
   typedef T value_type;
 
   AlignedArray() : mPtr(nullptr), mStorage(nullptr), mCount(0) {}
 
   explicit MOZ_ALWAYS_INLINE AlignedArray(size_t aCount, bool aZero = false)
       : mPtr(nullptr), mStorage(nullptr), mCount(0) {
     Realloc(aCount, aZero);
   }
--- a/gfx/2d/UnscaledFontFreeType.h
+++ b/gfx/2d/UnscaledFontFreeType.h
@@ -29,17 +29,17 @@ class UnscaledFontFreeType : public Unsc
         mOwnsFace(false),
         mFile(std::move(aFile)),
         mIndex(aIndex) {}
   UnscaledFontFreeType(FT_Face aFace, NativeFontResource* aNativeFontResource)
       : mFace(aFace),
         mOwnsFace(false),
         mIndex(0),
         mNativeFontResource(aNativeFontResource) {}
-  ~UnscaledFontFreeType() {
+  virtual ~UnscaledFontFreeType() {
     if (mOwnsFace) {
       Factory::ReleaseFTFace(mFace);
     }
   }
 
   FontType GetType() const override { return FontType::FREETYPE; }
 
   FT_Face GetFace() const { return mFace; }
--- a/gfx/2d/UnscaledFontMac.h
+++ b/gfx/2d/UnscaledFontMac.h
@@ -22,17 +22,17 @@ namespace gfx {
 class UnscaledFontMac final : public UnscaledFont {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(UnscaledFontMac, override)
   explicit UnscaledFontMac(CGFontRef aFont, bool aIsDataFont = false,
                            bool aNeedsCairo = false)
       : mFont(aFont), mIsDataFont(aIsDataFont), mNeedsCairo(aNeedsCairo) {
     CFRetain(mFont);
   }
-  ~UnscaledFontMac() { CFRelease(mFont); }
+  virtual ~UnscaledFontMac() { CFRelease(mFont); }
 
   FontType GetType() const override { return FontType::MAC; }
 
   CGFontRef GetFont() const { return mFont; }
 
   bool GetFontFileData(FontFileDataOutput aDataCallback, void* aBaton) override;
 
   bool IsDataFont() const { return mIsDataFont; }
--- a/gfx/gl/AndroidNativeWindow.h
+++ b/gfx/gl/AndroidNativeWindow.h
@@ -12,17 +12,17 @@
 #  include <android/native_window.h>
 #  include <android/native_window_jni.h>
 #  include "GeneratedJNIWrappers.h"
 #  include "SurfaceTexture.h"
 
 namespace mozilla {
 namespace gl {
 
-class AndroidNativeWindow {
+class AndroidNativeWindow final {
  public:
   AndroidNativeWindow() : mNativeWindow(nullptr) {}
 
   explicit AndroidNativeWindow(java::sdk::Surface::Param aSurface) {
     mNativeWindow =
         ANativeWindow_fromSurface(jni::GetEnvForThread(), aSurface.Get());
   }
 
--- a/gfx/gl/AndroidSurfaceTexture.cpp
+++ b/gfx/gl/AndroidSurfaceTexture.cpp
@@ -30,17 +30,17 @@ void AndroidSurfaceTexture::GetTransform
 
   jfloat* array = env->GetFloatArrayElements(jarray.Get(), nullptr);
 
   memcpy(&(outMatrix->_11), array, sizeof(float) * 16);
 
   env->ReleaseFloatArrayElements(jarray.Get(), array, 0);
 }
 
-class SharedGL {
+class SharedGL final {
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedGL);
 
   explicit SharedGL(AndroidNativeWindow& window) {
     MutexAutoLock lock(sMutex);
 
     if (!sContext) {
       MOZ_ASSERT(sInstanceCount == 0);
--- a/gfx/gl/GLContextGLX.h
+++ b/gfx/gl/GLContextGLX.h
@@ -28,40 +28,38 @@ class GLContextGLX : public GLContext {
                          bool useAlpha, int* const out_visualId);
 
   // Finds a GLXFBConfig compatible with the provided window.
   static bool FindFBConfigForWindow(
       Display* display, int screen, Window window,
       ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,
       GLXFBConfig* const out_config, int* const out_visid, bool aWebRender);
 
-  ~GLContextGLX() override;
+  virtual ~GLContextGLX();
 
-  virtual GLContextType GetContextType() const override {
-    return GLContextType::GLX;
-  }
+  GLContextType GetContextType() const override { return GLContextType::GLX; }
 
   static GLContextGLX* Cast(GLContext* gl) {
     MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
     return static_cast<GLContextGLX*>(gl);
   }
 
   bool Init() override;
 
-  virtual bool MakeCurrentImpl() const override;
+  bool MakeCurrentImpl() const override;
 
-  virtual bool IsCurrentImpl() const override;
+  bool IsCurrentImpl() const override;
 
   Maybe<SymbolLoader> GetSymbolLoader() const override;
 
-  virtual bool IsDoubleBuffered() const override;
+  bool IsDoubleBuffered() const override;
 
-  virtual bool SwapBuffers() override;
+  bool SwapBuffers() override;
 
-  virtual void GetWSIInfo(nsCString* const out) const override;
+  void GetWSIInfo(nsCString* const out) const override;
 
   // Overrides the current GLXDrawable backing the context and makes the
   // context current.
   bool OverrideDrawable(GLXDrawable drawable);
 
   // Undoes the effect of a drawable override.
   bool RestoreDrawable();
 
--- a/gfx/gl/GLTextureImage.h
+++ b/gfx/gl/GLTextureImage.h
@@ -172,26 +172,25 @@ class BasicTextureImage : public Texture
  public:
   virtual ~BasicTextureImage();
 
   BasicTextureImage(GLuint aTexture, const gfx::IntSize& aSize,
                     GLenum aWrapMode, ContentType aContentType,
                     GLContext* aContext,
                     TextureImage::Flags aFlags = TextureImage::NoFlags);
 
-  virtual void BindTexture(GLenum aTextureUnit) override;
+  void BindTexture(GLenum aTextureUnit) override;
 
-  virtual bool DirectUpdate(
-      gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
-      const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
-  virtual GLuint GetTextureID() override { return mTexture; }
+  bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
+                    const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
+  GLuint GetTextureID() override { return mTexture; }
 
-  virtual void MarkValid() override { mTextureState = Valid; }
+  void MarkValid() override { mTextureState = Valid; }
 
-  virtual void Resize(const gfx::IntSize& aSize) override;
+  void Resize(const gfx::IntSize& aSize) override;
 
  protected:
   GLuint mTexture;
   TextureState mTextureState;
   RefPtr<GLContext> mGLContext;
 };
 
 /**
@@ -200,35 +199,34 @@ class BasicTextureImage : public Texture
  */
 
 class TiledTextureImage final : public TextureImage {
  public:
   TiledTextureImage(
       GLContext* aGL, gfx::IntSize aSize, TextureImage::ContentType,
       TextureImage::Flags aFlags = TextureImage::NoFlags,
       TextureImage::ImageFormat aImageFormat = gfx::SurfaceFormat::UNKNOWN);
-  ~TiledTextureImage();
+  virtual ~TiledTextureImage();
   void DumpDiv();
-  virtual void Resize(const gfx::IntSize& aSize) override;
-  virtual uint32_t GetTileCount() override;
-  virtual void BeginBigImageIteration() override;
-  virtual bool NextTile() override;
-  virtual void SetIterationCallback(BigImageIterationCallback aCallback,
-                                    void* aCallbackData) override;
-  virtual gfx::IntRect GetTileRect() override;
-  virtual GLuint GetTextureID() override {
+  void Resize(const gfx::IntSize& aSize) override;
+  uint32_t GetTileCount() override;
+  void BeginBigImageIteration() override;
+  bool NextTile() override;
+  void SetIterationCallback(BigImageIterationCallback aCallback,
+                            void* aCallbackData) override;
+  gfx::IntRect GetTileRect() override;
+  GLuint GetTextureID() override {
     return mImages[mCurrentImage]->GetTextureID();
   }
-  virtual bool DirectUpdate(
-      gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
-      const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
-  virtual void BindTexture(GLenum) override;
+  bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
+                    const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
+  void BindTexture(GLenum) override;
 
  protected:
-  virtual gfx::IntRect GetSrcTileRect() override;
+  gfx::IntRect GetSrcTileRect() override;
 
   unsigned int mCurrentImage;
   BigImageIterationCallback mIterationCallback;
   void* mIterationCallbackData;
   nsTArray<RefPtr<TextureImage> > mImages;
   unsigned int mTileSize;
   unsigned int mRows, mColumns;
   GLContext* mGL;
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -283,17 +283,17 @@ class SurfaceFactory : public SupportsWe
       const gfx::IntSize& size);
 
   static void RecycleCallback(layers::TextureClient* tc, void* /*closure*/);
 
   // Auto-deletes surfs of the wrong type.
   bool Recycle(layers::SharedSurfaceTextureClient* texClient);
 };
 
-class ScopedReadbackFB {
+class ScopedReadbackFB final {
   GLContext* const mGL;
   ScopedBindFramebuffer mAutoFB;
   GLuint mTempFB = 0;
   GLuint mTempTex = 0;
   SharedSurface* mSurfToUnlock = nullptr;
   SharedSurface* mSurfToLock = nullptr;
 
  public:
--- a/gfx/gl/SharedSurfaceD3D11Interop.h
+++ b/gfx/gl/SharedSurfaceD3D11Interop.h
@@ -44,35 +44,35 @@ class SharedSurface_D3D11Interop : publi
  protected:
   SharedSurface_D3D11Interop(GLContext* gl, const gfx::IntSize& size,
                              bool hasAlpha, GLuint prodTex, GLuint interopFB,
                              GLuint interopRB, DXInterop2Device* interop,
                              HANDLE lockHandle, ID3D11Texture2D* texD3D,
                              HANDLE dxgiHandle);
 
  public:
-  virtual ~SharedSurface_D3D11Interop() override;
+  virtual ~SharedSurface_D3D11Interop();
 
-  virtual void LockProdImpl() override {}
-  virtual void UnlockProdImpl() override {}
+  void LockProdImpl() override {}
+  void UnlockProdImpl() override {}
 
-  virtual void ProducerAcquireImpl() override;
-  virtual void ProducerReleaseImpl() override;
+  void ProducerAcquireImpl() override;
+  void ProducerReleaseImpl() override;
 
-  virtual GLuint ProdRenderbuffer() override {
+  GLuint ProdRenderbuffer() override {
     MOZ_ASSERT(!mProdTex);
     return mInteropRB;
   }
 
-  virtual GLuint ProdTexture() override {
+  GLuint ProdTexture() override {
     MOZ_ASSERT(mProdTex);
     return mProdTex;
   }
 
-  virtual bool ToSurfaceDescriptor(
+  bool ToSurfaceDescriptor(
       layers::SurfaceDescriptor* const out_descriptor) override;
 };
 
 class SurfaceFactory_D3D11Interop : public SurfaceFactory {
  public:
   const RefPtr<DXInterop2Device> mInterop;
 
   static UniquePtr<SurfaceFactory_D3D11Interop> Create(
@@ -81,21 +81,20 @@ class SurfaceFactory_D3D11Interop : publ
 
  protected:
   SurfaceFactory_D3D11Interop(GLContext* gl, const SurfaceCaps& caps,
                               layers::LayersIPCChannel* allocator,
                               const layers::TextureFlags& flags,
                               DXInterop2Device* interop);
 
  public:
-  virtual ~SurfaceFactory_D3D11Interop() override;
+  virtual ~SurfaceFactory_D3D11Interop();
 
  protected:
-  virtual UniquePtr<SharedSurface> CreateShared(
-      const gfx::IntSize& size) override {
+  UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override {
     bool hasAlpha = mReadCaps.alpha;
     return SharedSurface_D3D11Interop::Create(mInterop, mGL, size, hasAlpha);
   }
 };
 
 } /* namespace gl */
 } /* namespace mozilla */
 
--- a/gfx/ipc/CompositorOptions.h
+++ b/gfx/ipc/CompositorOptions.h
@@ -30,17 +30,17 @@ class CompositorOptions {
  public:
   // This constructor needed for IPDL purposes, don't use it anywhere else.
   CompositorOptions()
       : mUseAPZ(false),
         mUseWebRender(false),
         mUseAdvancedLayers(false),
         mInitiallyPaused(false) {}
 
-  explicit CompositorOptions(bool aUseAPZ, bool aUseWebRender)
+  CompositorOptions(bool aUseAPZ, bool aUseWebRender)
       : mUseAPZ(aUseAPZ),
         mUseWebRender(aUseWebRender),
         mUseAdvancedLayers(false),
         mInitiallyPaused(false) {}
 
   bool UseAPZ() const { return mUseAPZ; }
   bool UseWebRender() const { return mUseWebRender; }
   bool UseAdvancedLayers() const { return mUseAdvancedLayers; }
--- a/gfx/ipc/CrossProcessPaint.h
+++ b/gfx/ipc/CrossProcessPaint.h
@@ -25,17 +25,17 @@ struct ParamTraits;
 namespace mozilla {
 namespace gfx {
 
 class CrossProcessPaint;
 
 /**
  * A fragment of a paint of a cross process document tree.
  */
-class PaintFragment {
+class PaintFragment final {
  public:
   /// Initializes an empty PaintFragment
   PaintFragment() = default;
 
   /**
    * Creates a paint fragment by recording the draw commands and dependent tabs
    * for an nsIDocShell.
    *
@@ -69,17 +69,17 @@ class PaintFragment {
   IntSize mSize;
   ByteBuf mRecording;
   nsTHashtable<nsUint64HashKey> mDependencies;
 };
 
 /**
  * An object for painting a cross process document tree.
  */
-class CrossProcessPaint {
+class CrossProcessPaint final {
   NS_INLINE_DECL_REFCOUNTING(CrossProcessPaint);
 
  public:
   /**
    * Begin an asynchronous paint of a cross process document tree starting at
    * a local document shell. The local document will be painted, then async
    * paints will be queued for remote subframes. Once all subframes have been
    * recorded, the final image will be resolved, and the promise will be
--- a/gfx/ipc/GPUChild.h
+++ b/gfx/ipc/GPUChild.h
@@ -23,17 +23,17 @@ namespace gfx {
 
 class GPUProcessHost;
 
 class GPUChild final : public PGPUChild, public gfxVarReceiver {
   typedef mozilla::dom::MemoryReportRequestHost MemoryReportRequestHost;
 
  public:
   explicit GPUChild(GPUProcessHost* aHost);
-  ~GPUChild();
+  virtual ~GPUChild();
 
   void Init();
 
   bool EnsureGPUReady();
   base::ProcessHandle GetChildProcessHandle();
 
   PAPZInputBridgeChild* AllocPAPZInputBridgeChild(const LayersId& aLayersId);
   bool DeallocPAPZInputBridgeChild(PAPZInputBridgeChild* aActor);
--- a/gfx/ipc/GPUProcessImpl.h
+++ b/gfx/ipc/GPUProcessImpl.h
@@ -16,17 +16,17 @@
 namespace mozilla {
 namespace gfx {
 
 // This class owns the subprocess instance of a PGPU - which in this case,
 // is a GPUParent. It is instantiated as a singleton in XRE_InitChildProcess.
 class GPUProcessImpl final : public ipc::ProcessChild {
  public:
   explicit GPUProcessImpl(ProcessId aParentPid);
-  ~GPUProcessImpl();
+  virtual ~GPUProcessImpl();
 
   bool Init(int aArgc, char* aArgv[]) override;
   void CleanUp() override;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(GPUProcessImpl);
 
   GPUParent mGPU;
--- a/gfx/ipc/GPUProcessListener.h
+++ b/gfx/ipc/GPUProcessListener.h
@@ -6,17 +6,17 @@
 #ifndef _include_mozilla_gfx_ipc_GPUProcessListener_h_
 #define _include_mozilla_gfx_ipc_GPUProcessListener_h_
 
 namespace mozilla {
 namespace gfx {
 
 class GPUProcessListener {
  public:
-  virtual ~GPUProcessListener() {}
+  virtual ~GPUProcessListener() = default;
 
   // Called when the compositor has died and the rendering stack must be
   // recreated.
   virtual void OnCompositorUnexpectedShutdown() {}
 
   // Called when devices have been reset and tabs must throw away their
   // layer managers.
   virtual void OnCompositorDeviceReset() {}
--- a/gfx/ipc/GPUProcessManager.h
+++ b/gfx/ipc/GPUProcessManager.h
@@ -243,17 +243,17 @@ class GPUProcessManager final : public G
 
   class Observer final : public nsIObserver {
    public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
     explicit Observer(GPUProcessManager* aManager);
 
    protected:
-    ~Observer() {}
+    virtual ~Observer() = default;
 
     GPUProcessManager* mManager;
   };
   friend class Observer;
 
  private:
   bool mDecodeVideoOnGpuProcess = true;
 
--- a/gfx/ipc/RemoteCompositorSession.h
+++ b/gfx/ipc/RemoteCompositorSession.h
@@ -14,17 +14,17 @@ namespace mozilla {
 namespace layers {
 
 class RemoteCompositorSession final : public CompositorSession {
  public:
   RemoteCompositorSession(nsBaseWidget* aWidget, CompositorBridgeChild* aChild,
                           CompositorWidgetDelegate* aWidgetDelegate,
                           APZCTreeManagerChild* aAPZ,
                           const LayersId& aRootLayerTreeId);
-  ~RemoteCompositorSession() override;
+  virtual ~RemoteCompositorSession();
 
   CompositorBridgeParent* GetInProcessBridge() const override;
   void SetContentController(GeckoContentController* aController) override;
   GeckoContentController* GetContentController();
   nsIWidget* GetWidget() const;
   RefPtr<IAPZCTreeManager> GetAPZCTreeManager() const override;
   void Shutdown() override;
 
--- a/gfx/ipc/VsyncBridgeChild.h
+++ b/gfx/ipc/VsyncBridgeChild.h
@@ -27,21 +27,21 @@ class VsyncBridgeChild final : public PV
   void Close();
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
   void DeallocPVsyncBridgeChild() override;
   void ProcessingError(Result aCode, const char* aReason) override;
 
   void NotifyVsync(const VsyncEvent& aVsync, const layers::LayersId& aLayersId);
 
-  virtual void HandleFatalError(const char* aMsg) const override;
+  void HandleFatalError(const char* aMsg) const override;
 
  private:
   VsyncBridgeChild(RefPtr<VsyncIOThreadHolder>, const uint64_t& aProcessToken);
-  ~VsyncBridgeChild();
+  virtual ~VsyncBridgeChild();
 
   void Open(Endpoint<PVsyncBridgeChild>&& aEndpoint);
 
   void NotifyVsyncImpl(const VsyncEvent& aVsync,
                        const layers::LayersId& aLayersId);
 
   bool IsOnVsyncIOThread() const;
 
--- a/gfx/layers/AnimationHelper.h
+++ b/gfx/layers/AnimationHelper.h
@@ -82,17 +82,17 @@ struct AnimationTransform {
   /*
    * This transform is calculated from frame and used by getOMTAStyle()
    * for OMTA testing.
    */
   gfx::Matrix4x4 mFrameTransform;
   TransformData mData;
 };
 
-struct AnimatedValue {
+struct AnimatedValue final {
   enum { TRANSFORM, OPACITY, COLOR, NONE } mType{NONE};
 
   union {
     AnimationTransform mTransform;
     float mOpacity;
     nscolor mColor;
   };
 
@@ -105,16 +105,19 @@ struct AnimatedValue {
   }
 
   explicit AnimatedValue(const float& aValue)
       : mType(AnimatedValue::OPACITY), mOpacity(aValue) {}
 
   explicit AnimatedValue(nscolor aValue)
       : mType(AnimatedValue::COLOR), mColor(aValue) {}
 
+  // Can't use = default as AnimatedValue contains a union and has a variant
+  // member with non-trivial destructor.
+  // Otherwise a Deleted implicitly-declared destructor error will occur.
   ~AnimatedValue() {}
 
  private:
   AnimatedValue() = delete;
 };
 
 // CompositorAnimationStorage stores the animations and animated values
 // keyed by a CompositorAnimationsId. The "animations" are a representation of
--- a/gfx/layers/AxisPhysicsMSDModel.h
+++ b/gfx/layers/AxisPhysicsMSDModel.h
@@ -17,17 +17,17 @@ namespace layers {
  * model.  A unit mass is assumed.
  */
 class AxisPhysicsMSDModel : public AxisPhysicsModel {
  public:
   AxisPhysicsMSDModel(double aInitialPosition, double aInitialDestination,
                       double aInitialVelocity, double aSpringConstant,
                       double aDampingRatio);
 
-  ~AxisPhysicsMSDModel();
+  virtual ~AxisPhysicsMSDModel();
 
   /**
    * Gets the raw destination of this axis at this moment.
    */
   double GetDestination() const;
 
   /**
    * Sets the raw destination of this axis at this moment.
@@ -36,17 +36,17 @@ class AxisPhysicsMSDModel : public AxisP
 
   /**
    * Returns true when the position is close to the destination and the
    * velocity is low.
    */
   bool IsFinished(double aSmallestVisibleIncrement);
 
  protected:
-  virtual double Acceleration(const State &aState) override;
+  double Acceleration(const State &aState) override;
 
  private:
   /**
    * mDestination represents the target position and the resting position of
    * the simulated spring.
    */
   double mDestination;
 
--- a/gfx/layers/AxisPhysicsModel.h
+++ b/gfx/layers/AxisPhysicsModel.h
@@ -20,17 +20,17 @@ namespace layers {
  * It performs frame-rate independent interpolation and RK4 integration for
  * smooth animation with stable, deterministic behavior.
  * Implementations are expected to subclass and override the Acceleration()
  * method.
  */
 class AxisPhysicsModel {
  public:
   AxisPhysicsModel(double aInitialPosition, double aInitialVelocity);
-  ~AxisPhysicsModel();
+  virtual ~AxisPhysicsModel();
 
   /**
    * Advance the physics simulation.
    * |aDelta| is the time since the last sample.
    */
   void Simulate(const TimeDuration &aDeltaTime);
 
   /**
--- a/gfx/layers/BSPTree.h
+++ b/gfx/layers/BSPTree.h
@@ -83,17 +83,17 @@ struct BSPTreeNode {
  * BSPTree class takes a list of layers as an input and uses binary space
  * partitioning algorithm to create a tree structure that can be used for
  * depth sorting.
 
  * Sources for more information:
  * https://en.wikipedia.org/wiki/Binary_space_partitioning
  * ftp://ftp.sgi.com/other/bspfaq/faq/bspfaq.html
  */
-class BSPTree {
+class BSPTree final {
  public:
   /**
    * The constructor modifies layers in the given list.
    */
   explicit BSPTree(std::list<LayerPolygon>& aLayers) {
     MOZ_ASSERT(!aLayers.empty());
 
     mRoot = new (mPool) BSPTreeNode(mListPointers);
--- a/gfx/layers/BufferTexture.h
+++ b/gfx/layers/BufferTexture.h
@@ -31,32 +31,32 @@ class BufferTextureData : public Texture
                                    LayersIPCChannel* aAllocator);
 
   static BufferTextureData* CreateForYCbCr(
       KnowsCompositor* aAllocator, gfx::IntSize aYSize, uint32_t aYStride,
       gfx::IntSize aCbCrSize, uint32_t aCbCrStride, StereoMode aStereoMode,
       gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
       TextureFlags aTextureFlags);
 
-  virtual bool Lock(OpenMode aMode) override { return true; }
+  bool Lock(OpenMode aMode) override { return true; }
 
-  virtual void Unlock() override {}
+  void Unlock() override {}
 
-  virtual void FillInfo(TextureData::Info& aInfo) const override;
+  void FillInfo(TextureData::Info& aInfo) const override;
 
-  virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
+  already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
 
-  virtual bool BorrowMappedData(MappedTextureData& aMap) override;
+  bool BorrowMappedData(MappedTextureData& aMap) override;
 
-  virtual bool BorrowMappedYCbCrData(MappedYCbCrTextureData& aMap) override;
+  bool BorrowMappedYCbCrData(MappedYCbCrTextureData& aMap) override;
 
   // use TextureClient's default implementation
-  virtual bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
+  bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
 
-  virtual BufferTextureData* AsBufferTextureData() override { return this; }
+  BufferTextureData* AsBufferTextureData() override { return this; }
 
   // Don't use this.
   void SetDescriptor(BufferDescriptor&& aDesc);
 
   Maybe<gfx::IntSize> GetCbCrSize() const;
 
   Maybe<gfx::YUVColorSpace> GetYUVColorSpace() const;
 
--- a/gfx/layers/CompositionRecorder.h
+++ b/gfx/layers/CompositionRecorder.h
@@ -25,17 +25,17 @@ class RecordedFrame {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RecordedFrame)
 
   // The resulting DataSourceSurface must not be kept alive beyond the lifetime
   // of the RecordedFrame object, since it may refer to data owned by the frame.
   virtual already_AddRefed<gfx::DataSourceSurface> GetSourceSurface() = 0;
   TimeStamp GetTimeStamp() { return mTimeStamp; }
 
  protected:
-  virtual ~RecordedFrame() {}
+  virtual ~RecordedFrame() = default;
   RecordedFrame(const TimeStamp& aTimeStamp) : mTimeStamp(aTimeStamp) {}
 
  private:
   TimeStamp mTimeStamp;
 };
 
 /**
  *
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -181,17 +181,17 @@ class Compositor : public TextureSourceP
  protected:
   virtual ~Compositor();
 
  public:
   explicit Compositor(widget::CompositorWidget* aWidget,
                       CompositorBridgeParent* aParent = nullptr);
 
   virtual bool Initialize(nsCString* const out_failureReason) = 0;
-  virtual void Destroy() override;
+  void Destroy() override;
   bool IsDestroyed() const { return mIsDestroyed; }
 
   virtual void DetachWidget() { mWidget = nullptr; }
 
   /**
    * Request a texture host identifier that may be used for creating textures
    * across process or thread boundaries that are compatible with this
    * compositor.
@@ -466,17 +466,17 @@ class Compositor : public TextureSourceP
   virtual const char* Name() const = 0;
 #endif  // MOZ_DUMP_PAINTING
 
   virtual LayersBackend GetBackendType() const = 0;
 
   virtual CompositorD3D11* AsCompositorD3D11() { return nullptr; }
   virtual BasicCompositor* AsBasicCompositor() { return nullptr; }
 
-  virtual Compositor* AsCompositor() override { return this; }
+  Compositor* AsCompositor() override { return this; }
 
   TimeStamp GetLastCompositionEndTime() const override {
     return mLastCompositionEndTime;
   }
 
   void UnlockAfterComposition(TextureHost* aTexture) override;
   bool NotifyNotUsedAfterComposition(TextureHost* aTextureHost) override;
 
@@ -513,17 +513,17 @@ class Compositor : public TextureSourceP
   ScreenRotation GetScreenRotation() const { return mScreenRotation; }
   void SetScreenRotation(ScreenRotation aRotation) {
     mScreenRotation = aRotation;
   }
 
   // A stale Compositor has no CompositorBridgeParent; it will not process
   // frames and should not be used.
   void SetInvalid();
-  virtual bool IsValid() const override;
+  bool IsValid() const override;
   CompositorBridgeParent* GetCompositorBridgeParent() const { return mParent; }
 
  protected:
   void DrawDiagnosticsInternal(DiagnosticFlags aFlags,
                                const gfx::Rect& aVisibleRect,
                                const gfx::IntRect& aClipRect,
                                const gfx::Matrix4x4& transform,
                                uint32_t aFlashCounter);
@@ -631,17 +631,17 @@ class AsyncReadbackBuffer {
   NS_INLINE_DECL_REFCOUNTING(AsyncReadbackBuffer)
 
   gfx::IntSize GetSize() const { return mSize; }
   virtual bool MapAndCopyInto(gfx::DataSourceSurface* aSurface,
                               const gfx::IntSize& aReadSize) const = 0;
 
  protected:
   explicit AsyncReadbackBuffer(const gfx::IntSize& aSize) : mSize(aSize) {}
-  virtual ~AsyncReadbackBuffer() {}
+  virtual ~AsyncReadbackBuffer() = default;
 
   gfx::IntSize mSize;
 };
 
 struct TexturedVertex {
   float position[2];
   float texCoords[2];
 };
--- a/gfx/layers/D3D11ShareHandleImage.h
+++ b/gfx/layers/D3D11ShareHandleImage.h
@@ -14,25 +14,24 @@
 #include "mozilla/layers/TextureD3D11.h"
 #include "mozilla/layers/TextureClientRecycleAllocator.h"
 
 namespace mozilla {
 namespace layers {
 
 class D3D11RecycleAllocator : public TextureClientRecycleAllocator {
  public:
-  explicit D3D11RecycleAllocator(KnowsCompositor* aAllocator,
-                                 ID3D11Device* aDevice)
+  D3D11RecycleAllocator(KnowsCompositor* aAllocator, ID3D11Device* aDevice)
       : TextureClientRecycleAllocator(aAllocator), mDevice(aDevice) {}
 
   already_AddRefed<TextureClient> CreateOrRecycleClient(
       gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize);
 
  protected:
-  virtual already_AddRefed<TextureClient> Allocate(
+  already_AddRefed<TextureClient> Allocate(
       gfx::SurfaceFormat aFormat, gfx::IntSize aSize, BackendSelector aSelector,
       TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) override;
 
   RefPtr<ID3D11Device> mDevice;
   /**
    * Used for checking if CompositorDevice/ContentDevice is updated.
    */
   RefPtr<ID3D11Device> mImageDevice;
@@ -41,17 +40,17 @@ class D3D11RecycleAllocator : public Tex
 // Image class that wraps a ID3D11Texture2D. This class copies the image
 // passed into SetData(), so that it can be accessed from other D3D devices.
 // This class also manages the synchronization of the copy, to ensure the
 // resource is ready to use.
 class D3D11ShareHandleImage final : public Image {
  public:
   D3D11ShareHandleImage(const gfx::IntSize& aSize, const gfx::IntRect& aRect,
                         const GUID& aSourceFormat);
-  virtual ~D3D11ShareHandleImage() {}
+  virtual ~D3D11ShareHandleImage() = default;
 
   bool AllocateTexture(D3D11RecycleAllocator* aAllocator,
                        ID3D11Device* aDevice);
 
   gfx::IntSize GetSize() const override;
   already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
   TextureClient* GetTextureClient(KnowsCompositor* aForwarder) override;
   gfx::IntRect GetPictureRect() const override { return mPictureRect; }
--- a/gfx/layers/D3D11YCbCrImage.cpp
+++ b/gfx/layers/D3D11YCbCrImage.cpp
@@ -265,17 +265,17 @@ already_AddRefed<SourceSurface> D3D11YCb
 
   ctx->Unmap(softTexY, 0);
   ctx->Unmap(softTexCb, 0);
   ctx->Unmap(softTexCr, 0);
 
   return surface.forget();
 }
 
-class AutoCheckLockD3D11Texture {
+class AutoCheckLockD3D11Texture final {
  public:
   explicit AutoCheckLockD3D11Texture(ID3D11Texture2D* aTexture)
       : mIsLocked(false) {
     aTexture->QueryInterface((IDXGIKeyedMutex**)getter_AddRefs(mMutex));
     if (!mMutex) {
       // If D3D11Texture does not have keyed mutex, we think that the
       // D3D11Texture could be locked.
       mIsLocked = true;
--- a/gfx/layers/D3D9SurfaceImage.h
+++ b/gfx/layers/D3D9SurfaceImage.h
@@ -14,25 +14,24 @@
 
 namespace mozilla {
 namespace layers {
 
 class TextureClient;
 
 class D3D9RecycleAllocator : public TextureClientRecycleAllocator {
  public:
-  explicit D3D9RecycleAllocator(KnowsCompositor* aAllocator,
-                                IDirect3DDevice9* aDevice)
+  D3D9RecycleAllocator(KnowsCompositor* aAllocator, IDirect3DDevice9* aDevice)
       : TextureClientRecycleAllocator(aAllocator), mDevice(aDevice) {}
 
   already_AddRefed<TextureClient> CreateOrRecycleClient(
       gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize);
 
  protected:
-  virtual already_AddRefed<TextureClient> Allocate(
+  already_AddRefed<TextureClient> Allocate(
       gfx::SurfaceFormat aFormat, gfx::IntSize aSize, BackendSelector aSelector,
       TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) override;
 
   RefPtr<IDirect3DDevice9> mDevice;
 };
 
 /**
  * Wraps a D3D9 texture, shared with the compositor though DXGI.
@@ -41,27 +40,27 @@ class D3D9RecycleAllocator : public Text
  */
 class DXGID3D9TextureData : public TextureData {
  public:
   static DXGID3D9TextureData* Create(gfx::IntSize aSize,
                                      gfx::SurfaceFormat aFormat,
                                      TextureFlags aFlags,
                                      IDirect3DDevice9* aDevice);
 
-  ~DXGID3D9TextureData();
+  virtual ~DXGID3D9TextureData();
 
-  virtual void FillInfo(TextureData::Info& aInfo) const override;
+  void FillInfo(TextureData::Info& aInfo) const override;
 
-  virtual bool Lock(OpenMode) override { return true; }
+  bool Lock(OpenMode) override { return true; }
 
-  virtual void Unlock() override {}
+  void Unlock() override {}
 
-  virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
+  bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
 
-  virtual void Deallocate(LayersIPCChannel* aAllocator) override {}
+  void Deallocate(LayersIPCChannel* aAllocator) override {}
 
   IDirect3DDevice9* GetD3D9Device() { return mDevice; }
   IDirect3DTexture9* GetD3D9Texture() { return mTexture; }
   HANDLE GetShareHandle() const { return mHandle; }
   already_AddRefed<IDirect3DSurface9> GetD3D9Surface() const;
 
   const D3DSURFACE_DESC& GetDesc() const { return mDesc; }
 
--- a/gfx/layers/Effects.h
+++ b/gfx/layers/Effects.h
@@ -48,150 +48,143 @@ struct Effect {
   explicit Effect(EffectTypes aType) : mType(aType) {}
 
   EffectTypes mType;
 
   virtual TexturedEffect* AsTexturedEffect() { return nullptr; }
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0;
 
  protected:
-  virtual ~Effect() {}
+  virtual ~Effect() = default;
 };
 
 // Render from a texture
 struct TexturedEffect : public Effect {
   TexturedEffect(EffectTypes aType, TextureSource* aTexture,
                  bool aPremultiplied, gfx::SamplingFilter aSamplingFilter)
       : Effect(aType),
         mTextureCoords(0, 0, 1.0f, 1.0f),
         mTexture(aTexture),
         mPremultiplied(aPremultiplied),
         mSamplingFilter(aSamplingFilter) {}
 
-  virtual TexturedEffect* AsTexturedEffect() override { return this; }
+  TexturedEffect* AsTexturedEffect() override { return this; }
   virtual const char* Name() = 0;
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
   gfx::Rect mTextureCoords;
   TextureSource* mTexture;
   bool mPremultiplied;
   gfx::SamplingFilter mSamplingFilter;
 };
 
 // Support an alpha mask.
 struct EffectMask : public Effect {
   EffectMask(TextureSource* aMaskTexture, gfx::IntSize aSize,
              const gfx::Matrix4x4& aMaskTransform)
       : Effect(EffectTypes::MASK),
         mMaskTexture(aMaskTexture),
         mSize(aSize),
         mMaskTransform(aMaskTransform) {}
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
   TextureSource* mMaskTexture;
   gfx::IntSize mSize;
   gfx::Matrix4x4 mMaskTransform;
 };
 
 struct EffectBlendMode : public Effect {
   explicit EffectBlendMode(gfx::CompositionOp aBlendMode)
       : Effect(EffectTypes::BLEND_MODE), mBlendMode(aBlendMode) {}
 
   virtual const char* Name() { return "EffectBlendMode"; }
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
   gfx::CompositionOp mBlendMode;
 };
 
 // Render to a render target rather than the screen.
 struct EffectRenderTarget : public TexturedEffect {
   explicit EffectRenderTarget(CompositingRenderTarget* aRenderTarget)
       : TexturedEffect(EffectTypes::RENDER_TARGET, aRenderTarget, true,
                        gfx::SamplingFilter::LINEAR),
         mRenderTarget(aRenderTarget) {}
 
-  virtual const char* Name() override { return "EffectRenderTarget"; }
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  const char* Name() override { return "EffectRenderTarget"; }
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
   RefPtr<CompositingRenderTarget> mRenderTarget;
 
  protected:
   EffectRenderTarget(EffectTypes aType, CompositingRenderTarget* aRenderTarget)
       : TexturedEffect(aType, aRenderTarget, true, gfx::SamplingFilter::LINEAR),
         mRenderTarget(aRenderTarget) {}
 };
 
 // Render to a render target rather than the screen.
 struct EffectColorMatrix : public Effect {
   explicit EffectColorMatrix(gfx::Matrix5x4 aMatrix)
       : Effect(EffectTypes::COLOR_MATRIX), mColorMatrix(aMatrix) {}
 
-  virtual const char* Name() { return "EffectColorMatrix"; }
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
   const gfx::Matrix5x4 mColorMatrix;
 };
 
 struct EffectRGB : public TexturedEffect {
   EffectRGB(TextureSource* aTexture, bool aPremultiplied,
             gfx::SamplingFilter aSamplingFilter, bool aFlipped = false)
       : TexturedEffect(EffectTypes::RGB, aTexture, aPremultiplied,
                        aSamplingFilter) {}
 
-  virtual const char* Name() override { return "EffectRGB"; }
+  const char* Name() override { return "EffectRGB"; }
 };
 
 struct EffectYCbCr : public TexturedEffect {
   EffectYCbCr(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
               gfx::ColorDepth aColorDepth, gfx::SamplingFilter aSamplingFilter)
       : TexturedEffect(EffectTypes::YCBCR, aSource, false, aSamplingFilter),
         mYUVColorSpace(aYUVColorSpace),
         mColorDepth(aColorDepth) {}
 
-  virtual const char* Name() override { return "EffectYCbCr"; }
+  const char* Name() override { return "EffectYCbCr"; }
 
   gfx::YUVColorSpace mYUVColorSpace;
   gfx::ColorDepth mColorDepth;
 };
 
 struct EffectNV12 : public EffectYCbCr {
   EffectNV12(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
              gfx::ColorDepth aColorDepth, gfx::SamplingFilter aSamplingFilter)
       : EffectYCbCr(aSource, aYUVColorSpace, aColorDepth, aSamplingFilter) {
     mType = EffectTypes::NV12;
   }
 
-  virtual const char* Name() override { return "EffectNV12"; }
+  const char* Name() override { return "EffectNV12"; }
 };
 
 struct EffectComponentAlpha : public TexturedEffect {
   EffectComponentAlpha(TextureSource* aOnBlack, TextureSource* aOnWhite,
                        gfx::SamplingFilter aSamplingFilter)
       : TexturedEffect(EffectTypes::COMPONENT_ALPHA, nullptr, false,
                        aSamplingFilter),
         mOnBlack(aOnBlack),
         mOnWhite(aOnWhite) {}
 
-  virtual const char* Name() override { return "EffectComponentAlpha"; }
+  const char* Name() override { return "EffectComponentAlpha"; }
 
   TextureSource* mOnBlack;
   TextureSource* mOnWhite;
 };
 
 struct EffectSolidColor : public Effect {
   explicit EffectSolidColor(const gfx::Color& aColor)
       : Effect(EffectTypes::SOLID_COLOR), mColor(aColor) {}
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
   gfx::Color mColor;
 };
 
 struct EffectChain {
   EffectChain() : mLayerRef(nullptr) {}
   explicit EffectChain(void* aLayerRef) : mLayerRef(aLayerRef) {}
 
--- a/gfx/layers/GPUVideoImage.h
+++ b/gfx/layers/GPUVideoImage.h
@@ -38,17 +38,17 @@ class GPUVideoImage final : public Image
     // TextureData (in the decoder thread of the GPU process) is using
     // it too, and we want to make sure we don't send the delete message
     // until we've stopped being used on the compositor.
     mTextureClient = TextureClient::CreateWithData(
         new GPUVideoTextureData(aManager, aSD, aSize), TextureFlags::RECYCLE,
         ImageBridgeChild::GetSingleton().get());
   }
 
-  virtual ~GPUVideoImage() {}
+  virtual ~GPUVideoImage() = default;
 
   gfx::IntSize GetSize() const override { return mSize; }
 
  private:
   GPUVideoTextureData* GetData() const {
     if (!mTextureClient) {
       return nullptr;
     }
--- a/gfx/layers/IPDLActor.h
+++ b/gfx/layers/IPDLActor.h
@@ -34,17 +34,17 @@ class ParentActor : public Protocol {
   mozilla::ipc::IPCResult RecvDestroy() final {
     DestroyIfNeeded();
     Unused << Protocol::Send__delete__(this);
     return IPC_OK();
   }
 
   typedef ipc::IProtocol::ActorDestroyReason Why;
 
-  virtual void ActorDestroy(Why) override { DestroyIfNeeded(); }
+  void ActorDestroy(Why) override { DestroyIfNeeded(); }
 
  protected:
   void DestroyIfNeeded() {
     if (!mDestroyed) {
       Destroy();
       mDestroyed = true;
     }
   }
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -156,17 +156,17 @@ class TextureClient;
 class KnowsCompositor;
 class NVImage;
 #ifdef XP_WIN
 class D3D11YCbCrRecycleAllocator;
 #endif
 class SurfaceDescriptorBuffer;
 
 struct ImageBackendData {
-  virtual ~ImageBackendData() {}
+  virtual ~ImageBackendData() = default;
 
  protected:
   ImageBackendData() {}
 };
 
 /* Forward declarations for Image derivatives. */
 class GLImage;
 class SharedRGBImage;
@@ -239,17 +239,17 @@ class Image {
 
   virtual NVImage* AsNVImage() { return nullptr; }
 
  protected:
   Image(void* aImplData, ImageFormat aFormat)
       : mImplData(aImplData), mSerial(++sSerialCounter), mFormat(aFormat) {}
 
   // Protected destructor, to discourage deletion outside of Release():
-  virtual ~Image() {}
+  virtual ~Image() = default;
 
   mozilla::EnumeratedArray<mozilla::layers::LayersBackend,
                            mozilla::layers::LayersBackend::LAYERS_LAST,
                            nsAutoPtr<ImageBackendData>>
       mBackendData;
 
   void* mImplData;
   int32_t mSerial;
@@ -312,17 +312,17 @@ class BufferRecycleBin final {
  */
 
 class ImageFactory {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageFactory)
  protected:
   friend class ImageContainer;
 
   ImageFactory() {}
-  virtual ~ImageFactory() {}
+  virtual ~ImageFactory() = default;
 
   virtual RefPtr<PlanarYCbCrImage> CreatePlanarYCbCrImage(
       const gfx::IntSize& aScaleHint, BufferRecycleBin* aRecycleBin);
 };
 
 // Used to notify ImageContainer::NotifyComposite()
 class ImageContainerListener final {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainerListener)
@@ -797,17 +797,17 @@ struct PlanarYCbCrData {
  *                mYSkip
  */
 class PlanarYCbCrImage : public Image {
  public:
   typedef PlanarYCbCrData Data;
 
   enum { MAX_DIMENSION = 16384 };
 
-  virtual ~PlanarYCbCrImage() {}
+  virtual ~PlanarYCbCrImage() = default;
 
   /**
    * This makes a copy of the data buffers, in order to support functioning
    * in all different layer managers.
    */
   virtual bool CopyData(const Data& aData) = 0;
 
   /**
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -61,33 +61,31 @@ class ImageLayer : public Layer {
 
   ImageContainer* GetContainer() { return mContainer; }
   gfx::SamplingFilter GetSamplingFilter() { return mSamplingFilter; }
   const gfx::IntSize& GetScaleToSize() { return mScaleToSize; }
   ScaleMode GetScaleMode() { return mScaleMode; }
 
   MOZ_LAYER_DECL_NAME("ImageLayer", TYPE_IMAGE)
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override;
 
-  virtual const gfx::Matrix4x4& GetEffectiveTransformForBuffer()
-      const override {
+  const gfx::Matrix4x4& GetEffectiveTransformForBuffer() const override {
     return mEffectiveTransformForBuffer;
   }
 
-  virtual ImageLayer* AsImageLayer() override { return this; }
+  ImageLayer* AsImageLayer() override { return this; }
 
  protected:
   ImageLayer(LayerManager* aManager, void* aImplData);
-  ~ImageLayer();
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket,
-                          const void* aParent) override;
+  virtual ~ImageLayer();
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
+  void DumpPacket(layerscope::LayersPacket* aPacket,
+                  const void* aParent) override;
 
   RefPtr<ImageContainer> mContainer;
   gfx::SamplingFilter mSamplingFilter;
   gfx::IntSize mScaleToSize;
   ScaleMode mScaleMode;
   gfx::Matrix4x4 mEffectiveTransformForBuffer;
 };
 
--- a/gfx/layers/LayerMetricsWrapper.h
+++ b/gfx/layers/LayerMetricsWrapper.h
@@ -115,17 +115,17 @@ namespace layers {
  *
  * The implementation may look like it special-cases mIndex == 0 and/or
  * GetScrollMetadataCount() == 0. This is an artifact of the fact that both
  * mIndex and GetScrollMetadataCount() are uint32_t and GetScrollMetadataCount()
  * can return 0 but mIndex cannot store -1. This seems better than the
  * alternative of making mIndex a int32_t that can store -1, but then having
  * to cast to uint32_t all over the place.
  */
-class MOZ_STACK_CLASS LayerMetricsWrapper {
+class MOZ_STACK_CLASS LayerMetricsWrapper final {
  public:
   enum StartAt {
     TOP,
     BOTTOM,
   };
 
   LayerMetricsWrapper() : mLayer(nullptr), mIndex(0) {}
 
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -142,17 +142,17 @@ class LayerScopeWebSocketManager {
     NS_IMETHOD OnSocketAccepted(nsIServerSocket* aServ,
                                 nsISocketTransport* aTransport) override;
     NS_IMETHOD OnStopListening(nsIServerSocket* aServ,
                                nsresult aStatus) override {
       return NS_OK;
     }
 
    private:
-    virtual ~SocketListener() {}
+    virtual ~SocketListener() = default;
   };
 
   /*
    * This class handle websocket protocol which included
    * handshake and data frame's header
    */
   class SocketHandler : public nsIInputStreamCallback {
    public:
@@ -375,17 +375,17 @@ static void DumpFilter(TexturePacket* aT
  * 3. DebugGLTextureData (Texture data packet)
  * 4. DebugGLLayersData (Layers Tree data packet)
  * 5. DebugGLMetaData (Meta data packet)
  */
 class DebugGLData : public LinkedListElement<DebugGLData> {
  public:
   explicit DebugGLData(Packet::DataType aDataType) : mDataType(aDataType) {}
 
-  virtual ~DebugGLData() {}
+  virtual ~DebugGLData() = default;
 
   virtual bool Write() = 0;
 
  protected:
   static bool WriteToStream(Packet& aPacket) {
     if (!gLayerScopeManager.GetSocketManager()) return true;
 
     uint32_t size = aPacket.ByteSize();
@@ -400,17 +400,17 @@ class DebugGLData : public LinkedListEle
 class DebugGLFrameStatusData final : public DebugGLData {
  public:
   DebugGLFrameStatusData(Packet::DataType aDataType, int64_t aValue)
       : DebugGLData(aDataType), mFrameStamp(aValue) {}
 
   explicit DebugGLFrameStatusData(Packet::DataType aDataType)
       : DebugGLData(aDataType), mFrameStamp(0) {}
 
-  virtual bool Write() override {
+  bool Write() override {
     Packet packet;
     packet.set_type(mDataType);
 
     FramePacket* fp = packet.mutable_frame();
     fp->set_value(static_cast<uint64_t>(mFrameStamp));
 
     fp->set_scale(gLayerScopeManager.GetPixelScale());
 
@@ -436,17 +436,17 @@ class DebugGLTextureData final : public 
         mPacket(std::move(aPacket)) {
     // pre-packing
     // DataSourceSurface may have locked buffer,
     // so we should compress now, and then it could
     // be unlocked outside.
     pack(img);
   }
 
-  virtual bool Write() override { return WriteToStream(*mPacket); }
+  bool Write() override { return WriteToStream(*mPacket); }
 
  private:
   void pack(DataSourceSurface* aImage) {
     mPacket->set_type(mDataType);
 
     TexturePacket* tp = mPacket->mutable_texture();
     tp->set_layerref(mLayerRef);
     tp->set_name(mName);
@@ -502,17 +502,17 @@ class DebugGLTextureData final : public 
 class DebugGLColorData final : public DebugGLData {
  public:
   DebugGLColorData(void* layerRef, const Color& color, int width, int height)
       : DebugGLData(Packet::COLOR),
         mLayerRef(reinterpret_cast<uint64_t>(layerRef)),
         mColor(color.ToABGR()),
         mSize(width, height) {}
 
-  virtual bool Write() override {
+  bool Write() override {
     Packet packet;
     packet.set_type(mDataType);
 
     ColorPacket* cp = packet.mutable_color();
     cp->set_layerref(mLayerRef);
     cp->set_color(mColor);
     cp->set_width(mSize.width);
     cp->set_height(mSize.height);
@@ -526,34 +526,34 @@ class DebugGLColorData final : public De
   IntSize mSize;
 };
 
 class DebugGLLayersData final : public DebugGLData {
  public:
   explicit DebugGLLayersData(UniquePtr<Packet> aPacket)
       : DebugGLData(Packet::LAYERS), mPacket(std::move(aPacket)) {}
 
-  virtual bool Write() override {
+  bool Write() override {
     mPacket->set_type(mDataType);
     return WriteToStream(*mPacket);
   }
 
  protected:
   UniquePtr<Packet> mPacket;
 };
 
 class DebugGLMetaData final : public DebugGLData {
  public:
   DebugGLMetaData(Packet::DataType aDataType, bool aValue)
       : DebugGLData(aDataType), mComposedByHwc(aValue) {}
 
   explicit DebugGLMetaData(Packet::DataType aDataType)
       : DebugGLData(aDataType), mComposedByHwc(false) {}
 
-  virtual bool Write() override {
+  bool Write() override {
     Packet packet;
     packet.set_type(mDataType);
 
     MetaPacket* mp = packet.mutable_meta();
     mp->set_composedbyhwc(mComposedByHwc);
 
     return WriteToStream(packet);
   }
@@ -576,17 +576,17 @@ class DebugGLDrawData final : public Deb
         mTexIDs(aTexIDs),
         mLayerRef(reinterpret_cast<uint64_t>(aLayerRef)) {
     for (size_t i = 0; i < mRects; i++) {
       mLayerRects[i] = aLayerRects[i];
       mTextureRects[i] = aTextureRects[i];
     }
   }
 
-  virtual bool Write() override {
+  bool Write() override {
     Packet packet;
     packet.set_type(mDataType);
 
     DrawPacket* dp = packet.mutable_draw();
     dp->set_layerref(mLayerRef);
 
     dp->set_offsetx(mOffsetX);
     dp->set_offsety(mOffsetY);
@@ -635,17 +635,17 @@ class DebugDataSender {
     AppendTask(DebugDataSender* host, DebugGLData* d) : mData(d), mHost(host) {}
 
     NS_IMETHOD Run() override {
       mHost->mList.insertBack(mData);
       return NS_OK;
     }
 
    private:
-    virtual ~AppendTask() {}
+    virtual ~AppendTask() = default;
 
     DebugGLData* mData;
     // Keep a strong reference to DebugDataSender to prevent this object
     // accessing mHost on mThread, when it's been destroyed on the main
     // thread.
     RefPtr<DebugDataSender> mHost;
   };
 
@@ -656,17 +656,17 @@ class DebugDataSender {
     explicit ClearTask(DebugDataSender* host) : mHost(host) {}
 
     NS_IMETHOD Run() override {
       mHost->RemoveData();
       return NS_OK;
     }
 
    private:
-    virtual ~ClearTask() {}
+    virtual ~ClearTask() = default;
 
     RefPtr<DebugDataSender> mHost;
   };
 
   // Send all DebugData in mList via websocket, and then, clean up
   // mList on mThread.
   class SendTask : public nsIRunnable {
    public:
@@ -686,33 +686,33 @@ class DebugDataSender {
       }
 
       // Cleanup.
       mHost->RemoveData();
       return NS_OK;
     }
 
    private:
-    virtual ~SendTask() {}
+    virtual ~SendTask() = default;
 
     RefPtr<DebugDataSender> mHost;
   };
 
   explicit DebugDataSender(nsIThread* thread) : mThread(thread) {}
 
   void Append(DebugGLData* d) {
     mThread->Dispatch(new AppendTask(this, d), NS_DISPATCH_NORMAL);
   }
 
   void Cleanup() { mThread->Dispatch(new ClearTask(this), NS_DISPATCH_NORMAL); }
 
   void Send() { mThread->Dispatch(new SendTask(this), NS_DISPATCH_NORMAL); }
 
  protected:
-  virtual ~DebugDataSender() {}
+  virtual ~DebugDataSender() = default;
   void RemoveData() {
     MOZ_ASSERT(mThread->SerialEventTarget()->IsOnCurrentThread());
     if (mList.isEmpty()) return;
 
     DebugGLData* d;
     while ((d = mList.popFirst()) != nullptr) delete d;
   }
 
--- a/gfx/layers/LayerScope.h
+++ b/gfx/layers/LayerScope.h
@@ -47,17 +47,17 @@ class LayerScope {
   static void SetPixelScale(double devPixelsPerCSSPixel);
   static void ContentChanged(TextureHost* host);
 
  private:
   static void Init();
 };
 
 // Perform BeginFrame and EndFrame automatically
-class LayerScopeAutoFrame {
+class LayerScopeAutoFrame final {
  public:
   explicit LayerScopeAutoFrame(int64_t aFrameStamp);
   ~LayerScopeAutoFrame();
 
  private:
   static void BeginFrame(int64_t aFrameStamp);
   static void EndFrame();
 };
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -168,17 +168,17 @@ struct LayerPropertiesBase : public Laye
       : mLayer(nullptr),
         mMaskLayer(nullptr),
         mPostXScale(0.0),
         mPostYScale(0.0),
         mOpacity(0.0),
         mUseClipRect(false) {
     MOZ_COUNT_CTOR(LayerPropertiesBase);
   }
-  ~LayerPropertiesBase() override { MOZ_COUNT_DTOR(LayerPropertiesBase); }
+  virtual ~LayerPropertiesBase() { MOZ_COUNT_DTOR(LayerPropertiesBase); }
 
  protected:
   LayerPropertiesBase(const LayerPropertiesBase& a) = delete;
   LayerPropertiesBase& operator=(const LayerPropertiesBase& a) = delete;
 
  public:
   bool ComputeDifferences(Layer* aRoot, nsIntRegion& aOutRegion,
                           NotifySubDocInvalidationFunc aCallback) override;
--- a/gfx/layers/LayerTreeInvalidation.h
+++ b/gfx/layers/LayerTreeInvalidation.h
@@ -28,23 +28,23 @@ typedef void (*NotifySubDocInvalidationF
                                              const nsIntRegion* aRegion);
 
 /**
  * A set of cached layer properties (including those of child layers),
  * used for comparing differences in layer trees.
  */
 struct LayerProperties {
  protected:
-  LayerProperties() {}
+  LayerProperties() = default;
 
   LayerProperties(const LayerProperties& a) = delete;
   LayerProperties& operator=(const LayerProperties& a) = delete;
 
  public:
-  virtual ~LayerProperties() {}
+  virtual ~LayerProperties() = default;
 
   /**
    * Copies the current layer tree properties into
    * a new LayerProperties object.
    *
    * @param Layer tree to copy, or nullptr if we have no
    * initial layer tree.
    */
--- a/gfx/layers/LayerUserData.h
+++ b/gfx/layers/LayerUserData.h
@@ -14,15 +14,15 @@ namespace layers {
  * Base class for userdata objects attached to layers and layer managers.
  *
  * We define it here in a separate header so clients only need to include
  * this header for their class definitions, rather than pulling in Layers.h.
  * Everything else in Layers.h should be forward-declarable.
  */
 class LayerUserData {
  public:
-  virtual ~LayerUserData() {}
+  virtual ~LayerUserData() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif /* GFX_LAYERUSERDATA_H */
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -107,19 +107,19 @@ class PersistentBufferProvider;
 class GlyphArray;
 class WebRenderLayerManager;
 struct AnimData;
 
 namespace layerscope {
 class LayersPacket;
 }  // namespace layerscope
 
-#define MOZ_LAYER_DECL_NAME(n, e)                          \
-  virtual const char* Name() const override { return n; }  \
-  virtual LayerType GetType() const override { return e; } \
+#define MOZ_LAYER_DECL_NAME(n, e)                  \
+  const char* Name() const override { return n; }  \
+  LayerType GetType() const override { return e; } \
   static LayerType Type() { return e; }
 
 // Defined in LayerUserData.h; please include that file instead.
 class LayerUserData;
 
 class DidCompositeObserver {
  public:
   virtual void DidComposite() = 0;
@@ -749,17 +749,17 @@ class LayerManager : public FrameRecorde
   RefPtr<Layer> mRoot;
   gfx::UserData mUserData;
   bool mDestroyed;
   bool mSnapEffectiveTransforms;
 
   nsIntRegion mRegionToClear;
 
   // Protected destructor, to discourage deletion outside of Release():
-  virtual ~LayerManager() {}
+  virtual ~LayerManager() = default;
 
   // Print interesting information about this into aStreamo.  Internally
   // used to implement Dump*() and Log*().
   virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
 
   // Print interesting information about this into layerscope packet.
   // Internally used to implement Dump().
   virtual void DumpPacket(layerscope::LayersPacket* aPacket);
@@ -2054,21 +2054,21 @@ class PaintedLayer : public Layer {
   void ClearInvalidRegion() override {
     // mInvalidRegion is about to be reset. This is the last chance to apply
     // any pending changes from it to mValidRegion. Do that by calling
     // EnsureValidRegionIsCurrent().
     EnsureValidRegionIsCurrent();
     mInvalidRegion.SetEmpty();
   }
 
-  virtual PaintedLayer* AsPaintedLayer() override { return this; }
+  PaintedLayer* AsPaintedLayer() override { return this; }
 
   MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_PAINTED)
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override {
     gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface;
     gfx::Matrix residual;
     mEffectiveTransform = SnapTransformTranslation(
         idealTransform, mAllowResidualTranslation ? &residual : nullptr);
     // The residual can only be a translation because SnapTransformTranslation
     // only changes the transform if it's a translation
     NS_ASSERTION(residual.IsTranslation(),
@@ -2123,21 +2123,20 @@ class PaintedLayer : public Layer {
       LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE)
       : Layer(aManager, aImplData),
         mValidRegion(),
         mValidRegionIsCurrent(true),
         mCreationHint(aCreationHint),
         mUsedForReadback(false),
         mAllowResidualTranslation(false) {}
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket,
-                          const void* aParent) override;
+  void DumpPacket(layerscope::LayersPacket* aPacket,
+                  const void* aParent) override;
 
   /**
    * ComputeEffectiveTransforms snaps the ideal transform to get
    * mEffectiveTransform. mResidualTranslation is the translation that should be
    * applied *before* mEffectiveTransform to get the ideal transform.
    */
   gfxPoint mResidualTranslation;
 
@@ -2187,17 +2186,17 @@ class PaintedLayer : public Layer {
 };
 
 /**
  * A Layer which other layers render into. It holds references to its
  * children.
  */
 class ContainerLayer : public Layer {
  public:
-  ~ContainerLayer();
+  virtual ~ContainerLayer();
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Insert aChild into the child list of this container. aChild must
    * not be currently in any child list or the root for the layer manager.
    * If aAfter is non-null, it must be a child of this container and
    * we insert after that layer. If it's null we insert at the start.
    */
@@ -2246,48 +2245,46 @@ class ContainerLayer : public Layer {
     }
 
     MOZ_LAYERS_LOG_IF_SHADOWABLE(
         this, ("Layer::Mutated(%p) ScaleToResolution", this));
     mPresShellResolution = aResolution;
     Mutated();
   }
 
-  virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
+  void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
 
   enum class SortMode {
     WITH_GEOMETRY,
     WITHOUT_GEOMETRY,
   };
 
   nsTArray<LayerPolygon> SortChildrenBy3DZOrder(SortMode aSortMode);
 
-  virtual ContainerLayer* AsContainerLayer() override { return this; }
-  virtual const ContainerLayer* AsContainerLayer() const override {
-    return this;
-  }
+  ContainerLayer* AsContainerLayer() override { return this; }
+  const ContainerLayer* AsContainerLayer() const override { return this; }
 
   // These getters can be used anytime.
-  virtual Layer* GetFirstChild() const override { return mFirstChild; }
-  virtual Layer* GetLastChild() const override { return mLastChild; }
+  Layer* GetFirstChild() const override { return mFirstChild; }
+  Layer* GetLastChild() const override { return mLastChild; }
   float GetPreXScale() const { return mPreXScale; }
   float GetPreYScale() const { return mPreYScale; }
   float GetInheritedXScale() const { return mInheritedXScale; }
   float GetInheritedYScale() const { return mInheritedYScale; }
   float GetPresShellResolution() const { return mPresShellResolution; }
 
   MOZ_LAYER_DECL_NAME("ContainerLayer", TYPE_CONTAINER)
 
   /**
    * ContainerLayer backends need to override ComputeEffectiveTransforms
    * since the decision about whether to use a temporary surface for the
    * container is backend-specific. ComputeEffectiveTransforms must also set
    * mUseIntermediateSurface.
    */
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override = 0;
 
   /**
    * Call this only after ComputeEffectiveTransforms has been invoked
    * on this layer.
    * Returns true if this will use an intermediate surface. This is largely
    * backend-dependent, but it affects the operation of GetEffectiveOpacity().
    */
@@ -2422,17 +2419,17 @@ class ContainerLayer : public Layer {
 
 /**
  * A Layer which just renders a solid color in its visible region. It actually
  * can fill any area that contains the visible region, so if you need to
  * restrict the area filled, set a clip region on this layer.
  */
 class ColorLayer : public Layer {
  public:
-  virtual ColorLayer* AsColorLayer() override { return this; }
+  ColorLayer* AsColorLayer() override { return this; }
 
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the color of the layer.
    */
   virtual void SetColor(const gfx::Color& aColor) {
     if (mColor != aColor) {
       MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Color", this));
@@ -2450,32 +2447,31 @@ class ColorLayer : public Layer {
 
   const gfx::IntRect& GetBounds() { return mBounds; }
 
   // This getter can be used anytime.
   virtual const gfx::Color& GetColor() { return mColor; }
 
   MOZ_LAYER_DECL_NAME("ColorLayer", TYPE_COLOR)
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override {
     gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface;
     mEffectiveTransform = SnapTransformTranslation(idealTransform, nullptr);
     ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
   }
 
  protected:
   ColorLayer(LayerManager* aManager, void* aImplData)
       : Layer(aManager, aImplData), mColor() {}
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket,
-                          const void* aParent) override;
+  void DumpPacket(layerscope::LayersPacket* aPacket,
+                  const void* aParent) override;
 
   gfx::IntRect mBounds;
   gfx::Color mColor;
 };
 
 /**
  * A Layer for HTML Canvas elements.  It's backed by either a
  * gfxASurface or a GLContext (for WebGL layers), and has some control
@@ -2485,17 +2481,17 @@ class ColorLayer : public Layer {
  *
  * After Initialize is called, the underlying canvas Surface/GLContext
  * must not be modified during a layer transaction.
  */
 class CanvasLayer : public Layer {
  public:
   void SetBounds(gfx::IntRect aBounds) { mBounds = aBounds; }
 
-  virtual CanvasLayer* AsCanvasLayer() override { return this; }
+  CanvasLayer* AsCanvasLayer() override { return this; }
 
   /**
    * Notify this CanvasLayer that the canvas surface contents have
    * changed (or will change) before the next transaction.
    */
   void Updated() {
     mCanvasRenderer->SetDirty();
     SetInvalidRectToVisibleRegion();
@@ -2535,17 +2531,17 @@ class CanvasLayer : public Layer {
       mSamplingFilter = aSamplingFilter;
       Mutated();
     }
   }
   gfx::SamplingFilter GetSamplingFilter() const { return mSamplingFilter; }
 
   MOZ_LAYER_DECL_NAME("CanvasLayer", TYPE_CANVAS)
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override {
     // Snap our local transform first, and snap the inherited transform as well.
     // This makes our snapping equivalent to what would happen if our content
     // was drawn into a PaintedLayer (gfxContext would snap using the local
     // transform, then we'd snap again when compositing the PaintedLayer).
     mEffectiveTransform =
         SnapTransform(GetLocalTransform(),
                       gfxRect(0, 0, mBounds.Width(), mBounds.Height()),
@@ -2553,21 +2549,20 @@ class CanvasLayer : public Layer {
         SnapTransformTranslation(aTransformToSurface, nullptr);
     ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
   }
 
  protected:
   CanvasLayer(LayerManager* aManager, void* aImplData);
   virtual ~CanvasLayer();
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket,
-                          const void* aParent) override;
+  void DumpPacket(layerscope::LayersPacket* aPacket,
+                  const void* aParent) override;
 
   virtual CanvasRenderer* CreateCanvasRendererInternal() = 0;
 
   UniquePtr<CanvasRenderer> mCanvasRenderer;
   gfx::SamplingFilter mSamplingFilter;
 
   /**
    * 0, 0, canvaswidth, canvasheight
@@ -2591,27 +2586,27 @@ class CanvasLayer : public Layer {
  *
  * Clients will usually want to Connect/Clear() on each transaction to
  * avoid difficulties managing memory across multiple layer subtrees.
  */
 class RefLayer : public ContainerLayer {
   friend class LayerManager;
 
  private:
-  virtual bool InsertAfter(Layer* aChild, Layer* aAfter) override {
+  bool InsertAfter(Layer* aChild, Layer* aAfter) override {
     MOZ_CRASH("GFX: RefLayer");
     return false;
   }
 
-  virtual bool RemoveChild(Layer* aChild) override {
+  bool RemoveChild(Layer* aChild) override {
     MOZ_CRASH("GFX: RefLayer");
     return false;
   }
 
-  virtual bool RepositionChild(Layer* aChild, Layer* aAfter) override {
+  bool RepositionChild(Layer* aChild, Layer* aAfter) override {
     MOZ_CRASH("GFX: RefLayer");
     return false;
   }
 
  public:
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the ID of the layer's referent.
@@ -2672,38 +2667,37 @@ class RefLayer : public ContainerLayer {
    * |aLayer| is the same as the argument to ConnectReferentLayer().
    */
   void DetachReferentLayer(Layer* aLayer) {
     mFirstChild = mLastChild = nullptr;
     aLayer->SetParent(nullptr);
   }
 
   // These getters can be used anytime.
-  virtual RefLayer* AsRefLayer() override { return this; }
+  RefLayer* AsRefLayer() override { return this; }
 
   virtual LayersId GetReferentId() { return mId; }
 
   /**
    * DRAWING PHASE ONLY
    */
-  virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
+  void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
 
   MOZ_LAYER_DECL_NAME("RefLayer", TYPE_REF)
 
  protected:
   RefLayer(LayerManager* aManager, void* aImplData)
       : ContainerLayer(aManager, aImplData),
         mId{0},
         mEventRegionsOverride(EventRegionsOverride::NoOverride) {}
 
-  virtual void PrintInfo(std::stringstream& aStream,
-                         const char* aPrefix) override;
+  void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
 
-  virtual void DumpPacket(layerscope::LayersPacket* aPacket,
-                          const void* aParent) override;
+  void DumpPacket(layerscope::LayersPacket* aPacket,
+                  const void* aParent) override;
 
   // 0 is a special value that means "no ID".
   LayersId mId;
   EventRegionsOverride mEventRegionsOverride;
 };
 
 void SetAntialiasingFlags(Layer* aLayer, gfx::DrawTarget* aTarget);
 
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -360,17 +360,17 @@ typedef Array<LayerSize, 4> BorderCorner
 typedef Array<LayerCoord, 4> BorderWidths;
 typedef Array<StyleBorderStyle, 4> BorderStyles;
 
 typedef Maybe<LayerRect> MaybeLayerRect;
 
 // This is used to communicate Layers across IPC channels. The Handle is valid
 // for layers in the same PLayerTransaction. Handles are created by
 // ClientLayerManager, and are cached in LayerTransactionParent on first use.
-class LayerHandle {
+class LayerHandle final {
   friend struct IPC::ParamTraits<mozilla::layers::LayerHandle>;
 
  public:
   LayerHandle() : mHandle(0) {}
   LayerHandle(const LayerHandle& aOther) : mHandle(aOther.mHandle) {}
   explicit LayerHandle(uint64_t aHandle) : mHandle(aHandle) {}
   bool IsValid() const { return mHandle != 0; }
   explicit operator bool() const { return IsValid(); }
@@ -382,17 +382,17 @@ class LayerHandle {
  private:
   uint64_t mHandle;
 };
 
 // This is used to communicate Compositables across IPC channels. The Handle is
 // valid for layers in the same PLayerTransaction or PImageBridge. Handles are
 // created by ClientLayerManager or ImageBridgeChild, and are cached in the
 // parent side on first use.
-class CompositableHandle {
+class CompositableHandle final {
   friend struct IPC::ParamTraits<mozilla::layers::CompositableHandle>;
 
  public:
   CompositableHandle() : mHandle(0) {}
   CompositableHandle(const CompositableHandle& aOther)
       : mHandle(aOther.mHandle) {}
   explicit CompositableHandle(uint64_t aHandle) : mHandle(aHandle) {}
   bool IsValid() const { return mHandle != 0; }
--- a/gfx/layers/PersistentBufferProvider.h
+++ b/gfx/layers/PersistentBufferProvider.h
@@ -33,17 +33,17 @@ class TextureClient;
  * DrawTarget, when they later need to continue drawing they get a DrawTarget
  * from the provider again, the provider will guarantee the contents of the
  * previously returned DrawTarget is persisted into the one newly returned.
  */
 class PersistentBufferProvider : public RefCounted<PersistentBufferProvider> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PersistentBufferProvider)
 
-  virtual ~PersistentBufferProvider() {}
+  virtual ~PersistentBufferProvider() = default;
 
   virtual LayersBackend GetType() { return LayersBackend::LAYERS_NONE; }
 
   /**
    * Get a DrawTarget from the PersistentBufferProvider.
    *
    * \param aPersistedRect This indicates the area of the DrawTarget that needs
    *                       to have remained the same since the call to
@@ -90,39 +90,36 @@ class PersistentBufferProviderBasic : pu
                                           override)
 
   static already_AddRefed<PersistentBufferProviderBasic> Create(
       gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
       gfx::BackendType aBackend);
 
   explicit PersistentBufferProviderBasic(gfx::DrawTarget* aTarget);
 
-  virtual LayersBackend GetType() override {
-    return LayersBackend::LAYERS_BASIC;
-  }
+  LayersBackend GetType() override { return LayersBackend::LAYERS_BASIC; }
 
-  virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
+  already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
       const gfx::IntRect& aPersistedRect) override;
 
-  virtual bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
+  bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
 
-  virtual already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
+  already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
 
-  virtual void ReturnSnapshot(
-      already_AddRefed<gfx::SourceSurface> aSnapshot) override;
+  void ReturnSnapshot(already_AddRefed<gfx::SourceSurface> aSnapshot) override;
 
-  virtual bool PreservesDrawingState() const override { return true; }
+  bool PreservesDrawingState() const override { return true; }
 
-  virtual void OnShutdown() override { Destroy(); }
+  void OnShutdown() override { Destroy(); }
 
  protected:
   void Destroy();
 
  private:
-  ~PersistentBufferProviderBasic();
+  virtual ~PersistentBufferProviderBasic();
 
   RefPtr<gfx::DrawTarget> mDrawTarget;
   RefPtr<gfx::SourceSurface> mSnapshot;
 };
 
 /**
  * Provides access to a buffer which can be sent to the compositor without
  * requiring a copy.
@@ -132,39 +129,38 @@ class PersistentBufferProviderShared : p
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PersistentBufferProviderShared,
                                           override)
 
   static already_AddRefed<PersistentBufferProviderShared> Create(
       gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
       KnowsCompositor* aKnowsCompositor);
 
-  virtual LayersBackend GetType() override;
+  LayersBackend GetType() override;
 
-  virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
+  already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
       const gfx::IntRect& aPersistedRect) override;
 
-  virtual bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
+  bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
 
-  virtual already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
+  already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
 
-  virtual void ReturnSnapshot(
-      already_AddRefed<gfx::SourceSurface> aSnapshot) override;
+  void ReturnSnapshot(already_AddRefed<gfx::SourceSurface> aSnapshot) override;
 
-  virtual TextureClient* GetTextureClient() override;
+  TextureClient* GetTextureClient() override;
 
-  virtual void NotifyInactive() override;
+  void NotifyInactive() override;
 
-  virtual void OnShutdown() override { Destroy(); }
+  void OnShutdown() override { Destroy(); }
 
-  virtual bool SetKnowsCompositor(KnowsCompositor* aKnowsCompositor) override;
+  bool SetKnowsCompositor(KnowsCompositor* aKnowsCompositor) override;
 
-  virtual void ClearCachedResources() override;
+  void ClearCachedResources() override;
 
-  virtual bool PreservesDrawingState() const override { return false; }
+  bool PreservesDrawingState() const override { return false; }
 
  protected:
   PersistentBufferProviderShared(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
                                  KnowsCompositor* aKnowsCompositor,
                                  RefPtr<TextureClient>& aTexture);
 
   ~PersistentBufferProviderShared();
 
@@ -181,17 +177,17 @@ class PersistentBufferProviderShared : p
   Maybe<uint32_t> mBack;
   // Offset of the texture in mTextures that is presented to the compositor.
   Maybe<uint32_t> mFront;
 
   RefPtr<gfx::DrawTarget> mDrawTarget;
   RefPtr<gfx::SourceSurface> mSnapshot;
 };
 
-struct AutoReturnSnapshot {
+struct AutoReturnSnapshot final {
   PersistentBufferProvider* mBufferProvider;
   RefPtr<gfx::SourceSurface>* mSnapshot;
 
   explicit AutoReturnSnapshot(PersistentBufferProvider* aProvider = nullptr)
       : mBufferProvider(aProvider), mSnapshot(nullptr) {}
 
   ~AutoReturnSnapshot() {
     if (mBufferProvider) {
--- a/gfx/layers/ReadbackLayer.h
+++ b/gfx/layers/ReadbackLayer.h
@@ -32,17 +32,17 @@ class LayersPacket;
 /**
  * A ReadbackSink receives a stream of updates to a rectangle of pixels.
  * These update callbacks are always called on the main thread, either during
  * EndTransaction or from the event loop.
  */
 class ReadbackSink {
  public:
   ReadbackSink() {}
-  virtual ~ReadbackSink() {}
+  virtual ~ReadbackSink() = default;
 
   /**
    * Sends an update to indicate that the background is currently unknown.
    */
   virtual void SetUnknown(uint64_t aSequenceNumber) = 0;
   /**
    * Called by the layer system to indicate that the contents of part of
    * the readback area are changing.
--- a/gfx/layers/SourceSurfaceSharedData.h
+++ b/gfx/layers/SourceSurfaceSharedData.h
@@ -274,17 +274,17 @@ class SourceSurfaceSharedData final : pu
 
    private:
     RefPtr<SourceSurfaceSharedData> mSurface;
   };
 
  private:
   friend class SourceSurfaceSharedDataWrapper;
 
-  ~SourceSurfaceSharedData() override {}
+  virtual ~SourceSurfaceSharedData() = default;
 
   void LockHandle() {
     MutexAutoLock lock(mMutex);
     ++mHandleCount;
   }
 
   void UnlockHandle() {
     MutexAutoLock lock(mMutex);
--- a/gfx/layers/SourceSurfaceVolatileData.h
+++ b/gfx/layers/SourceSurfaceVolatileData.h
@@ -79,17 +79,17 @@ class SourceSurfaceVolatileData : public
     MOZ_ASSERT(mMapCount > 0);
     MOZ_ASSERT(!mWasPurged);
     if (--mMapCount == 0) {
       mVBufPtr = nullptr;
     }
   }
 
  private:
-  ~SourceSurfaceVolatileData() override {}
+  virtual ~SourceSurfaceVolatileData() = default;
 
   Mutex mMutex;
   int32_t mStride;
   IntSize mSize;
   RefPtr<VolatileBuffer> mVBuf;
   VolatileBufferPtr<uint8_t> mVBufPtr;
   SurfaceFormat mFormat;
   bool mWasPurged;
--- a/gfx/layers/SyncObject.h
+++ b/gfx/layers/SyncObject.h
@@ -18,17 +18,17 @@ namespace layers {
 typedef void* SyncHandle;
 #else
 typedef uintptr_t SyncHandle;
 #endif  // XP_WIN
 
 class SyncObjectHost : public RefCounted<SyncObjectHost> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SyncObjectHost)
-  virtual ~SyncObjectHost() {}
+  virtual ~SyncObjectHost() = default;
 
   static already_AddRefed<SyncObjectHost> CreateSyncObjectHost(
 #ifdef XP_WIN
       ID3D11Device* aDevice = nullptr
 #endif
   );
 
   virtual bool Init() = 0;
@@ -40,17 +40,17 @@ class SyncObjectHost : public RefCounted
 
  protected:
   SyncObjectHost() {}
 };
 
 class SyncObjectClient : public external::AtomicRefCounted<SyncObjectClient> {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SyncObjectClient)
-  virtual ~SyncObjectClient() {}
+  virtual ~SyncObjectClient() = default;
 
   static already_AddRefed<SyncObjectClient> CreateSyncObjectClient(
       SyncHandle aHandle
 #ifdef XP_WIN
       ,
       ID3D11Device* aDevice = nullptr
 #endif
   );
--- a/gfx/layers/TextureDIB.h
+++ b/gfx/layers/TextureDIB.h
@@ -13,23 +13,23 @@
 #include "mozilla/GfxMessageUtils.h"
 #include "gfxWindowsPlatform.h"
 
 namespace mozilla {
 namespace layers {
 
 class DIBTextureData : public TextureData {
  public:
-  virtual bool Lock(OpenMode) override { return true; }
+  bool Lock(OpenMode) override { return true; }
 
-  virtual void Unlock() override {}
+  void Unlock() override {}
 
-  virtual void FillInfo(TextureData::Info& aInfo) const override;
+  void FillInfo(TextureData::Info& aInfo) const override;
 
-  virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
+  already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
 
   static DIBTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
                                 LayersIPCChannel* aAllocator);
 
  protected:
   DIBTextureData(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
                  gfxWindowsSurface* aSurface)
       : mSurface(aSurface), mSize(aSize), mFormat(aFormat) {
@@ -47,73 +47,70 @@ class DIBTextureData : public TextureDat
  * need any specific Lock/Unlock magic.
  */
 class TextureHostDirectUpload : public TextureHost {
  public:
   TextureHostDirectUpload(TextureFlags aFlags, gfx::SurfaceFormat aFormat,
                           gfx::IntSize aSize)
       : TextureHost(aFlags), mFormat(aFormat), mSize(aSize), mIsLocked(false) {}
 
-  virtual void DeallocateDeviceData() override;
+  void DeallocateDeviceData() override;
+
+  void SetTextureSourceProvider(TextureSourceProvider* aProvider) override;
 
-  virtual void SetTextureSourceProvider(
-      TextureSourceProvider* aProvider) override;
+  gfx::SurfaceFormat GetFormat() const override { return mFormat; }
 
-  virtual gfx::SurfaceFormat GetFormat() const override { return mFormat; }
-
-  virtual gfx::IntSize GetSize() const override { return mSize; }
+  gfx::IntSize GetSize() const override { return mSize; }
 
-  virtual bool Lock() override;
+  bool Lock() override;
 
-  virtual void Unlock() override;
+  void Unlock() override;
 
-  virtual bool HasIntermediateBuffer() const { return true; }
+  bool HasIntermediateBuffer() const { return true; }
 
-  virtual bool BindTextureSource(
-      CompositableTextureSourceRef& aTexture) override;
-  virtual bool AcquireTextureSource(
-      CompositableTextureSourceRef& aTexture) override;
+  bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
+  bool AcquireTextureSource(CompositableTextureSourceRef& aTexture) override;
 
  protected:
   RefPtr<TextureSourceProvider> mProvider;
   RefPtr<DataTextureSource> mTextureSource;
   gfx::SurfaceFormat mFormat;
   gfx::IntSize mSize;
   bool mIsLocked;
 };
 
 class DIBTextureHost : public TextureHostDirectUpload {
  public:
   DIBTextureHost(TextureFlags aFlags, const SurfaceDescriptorDIB& aDescriptor);
 
-  virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
+  already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
     return nullptr;  // TODO: cf bug 872568
   }
 
  protected:
-  virtual void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
+  void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
 
   RefPtr<gfxWindowsSurface> mSurface;
 };
 
 class TextureHostFileMapping : public TextureHostDirectUpload {
  public:
   TextureHostFileMapping(TextureFlags aFlags,
                          const SurfaceDescriptorFileMapping& aDescriptor);
   ~TextureHostFileMapping();
 
-  virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
+  already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
     MOZ_CRASH("GFX: TextureHostFileMapping::GetAsSurface not implemented");
     // Not implemented! It would be tricky to keep track of the
     // scope of the file mapping. We could do this through UserData
     // on the DataSourceSurface but we don't need this right now.
   }
 
  protected:
-  virtual void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
+  void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
 
   HANDLE mFileMapping;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_TEXTUREDIB_H */
--- a/gfx/layers/TextureSourceProvider.h
+++ b/gfx/layers/TextureSourceProvider.h
@@ -100,17 +100,17 @@ class TextureSourceProvider {
 
   virtual int32_t GetMaxTextureSize() const = 0;
 
   // Return whether or not this provider is still valid (i.e., is still being
   // used to composite).
   virtual bool IsValid() const = 0;
 
  public:
-  class MOZ_STACK_CLASS AutoReadUnlockTextures {
+  class MOZ_STACK_CLASS AutoReadUnlockTextures final {
    public:
     explicit AutoReadUnlockTextures(TextureSourceProvider* aProvider)
         : mProvider(aProvider) {}
     ~AutoReadUnlockTextures() { mProvider->ReadUnlockTextures(); }
 
    private:
     RefPtr<TextureSourceProvider> mProvider;
   };
--- a/gfx/layers/TransactionIdAllocator.h
+++ b/gfx/layers/TransactionIdAllocator.h
@@ -12,17 +12,17 @@
 #include "mozilla/TimeStamp.h"
 #include "mozilla/VsyncDispatcher.h"
 
 namespace mozilla {
 namespace layers {
 
 class TransactionIdAllocator {
  protected:
-  virtual ~TransactionIdAllocator() {}
+  virtual ~TransactionIdAllocator() = default;
 
  public:
   NS_INLINE_DECL_REFCOUNTING(TransactionIdAllocator)
 
   /**
    * Allocate a unique id number for the current refresh tick, can
    * only be called while IsInRefresh().
    *
--- a/gfx/layers/apz/public/APZInputBridge.h
+++ b/gfx/layers/apz/public/APZInputBridge.h
@@ -106,15 +106,15 @@ class APZInputBridge {
   virtual void ProcessUnhandledEvent(LayoutDeviceIntPoint* aRefPoint,
                                      ScrollableLayerGuid* aOutTargetGuid,
                                      uint64_t* aOutFocusSequenceNumber,
                                      LayersId* aOutLayersId) = 0;
 
   virtual void UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint,
                                       EventMessage aEventMessage) = 0;
 
-  virtual ~APZInputBridge() {}
+  virtual ~APZInputBridge() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_layers_APZInputBridge_h
--- a/gfx/layers/apz/public/CompositorController.h
+++ b/gfx/layers/apz/public/CompositorController.h
@@ -19,15 +19,15 @@ class CompositorController {
   NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 
   virtual void ScheduleRenderOnCompositorThread(
       const Maybe<wr::RenderRoot>& aRenderRootid = Nothing()) = 0;
   virtual void ScheduleHideAllPluginWindows() = 0;
   virtual void ScheduleShowAllPluginWindows() = 0;
 
  protected:
-  virtual ~CompositorController() {}
+  virtual ~CompositorController() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_layers_CompositorController_h
--- a/gfx/layers/apz/public/GeckoContentController.h
+++ b/gfx/layers/apz/public/GeckoContentController.h
@@ -204,15 +204,15 @@ class GeckoContentController {
 
   /**
    * Whether this is RemoteContentController.
    */
   virtual bool IsRemote() { return false; }
 
  protected:
   // Protected destructor, to discourage deletion outside of Release():
-  virtual ~GeckoContentController() {}
+  virtual ~GeckoContentController() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_layers_GeckoContentController_h
--- a/gfx/layers/apz/public/IAPZCTreeManager.h
+++ b/gfx/layers/apz/public/IAPZCTreeManager.h
@@ -130,15 +130,15 @@ class IAPZCTreeManager {
    * IAPZCTreeManager implementation.
    * It is only valid to call this function in the UI process.
    */
   virtual APZInputBridge* InputBridge() = 0;
 
  protected:
   // Discourage destruction outside of decref
 
-  virtual ~IAPZCTreeManager() {}
+  virtual ~IAPZCTreeManager() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_layers_IAPZCTreeManager_h
--- a/gfx/layers/apz/public/MetricsSharingController.h
+++ b/gfx/layers/apz/public/MetricsSharingController.h
@@ -23,15 +23,15 @@ class MetricsSharingController {
   virtual bool StartSharingMetrics(
       mozilla::ipc::SharedMemoryBasic::Handle aHandle,
       CrossProcessMutexHandle aMutexHandle, LayersId aLayersId,
       uint32_t aApzcId) = 0;
   virtual bool StopSharingMetrics(ScrollableLayerGuid::ViewID aScrollId,
                                   uint32_t aApzcId) = 0;
 
  protected:
-  virtual ~MetricsSharingController() {}
+  virtual ~MetricsSharingController() = default;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif  // mozilla_layers_MetricsSharingController_h
--- a/gfx/layers/apz/src/APZUtils.h
+++ b/gfx/layers/apz/src/APZUtils.h
@@ -101,17 +101,17 @@ static bool IsZero(const gfx::PointTyped
 // one or more AsyncTransformComponentMatrix objects) as constituting a
 // complete async transform.
 inline AsyncTransformMatrix CompleteAsyncTransform(
     const AsyncTransformComponentMatrix& aMatrix) {
   return ViewAs<AsyncTransformMatrix>(
       aMatrix, PixelCastJustification::MultipleAsyncTransforms);
 }
 
-struct TargetConfirmationFlags {
+struct TargetConfirmationFlags final {
   explicit TargetConfirmationFlags(bool aTargetConfirmed)
       : mTargetConfirmed(aTargetConfirmed),
         mRequiresTargetConfirmation(false) {}
 
   explicit TargetConfirmationFlags(
       const gfx::CompositorHitTestInfo& aHitTestInfo)
       : mTargetConfirmed(
             (aHitTestInfo != gfx::CompositorHitTestInvisibleToHit) &&
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -543,17 +543,17 @@ UniquePtr<VelocityTracker> PlatformSpeci
   return MakeUnique<SimpleVelocityTracker>(aAxis);
 }
 
 TimeStamp AsyncPanZoomController::GetFrameTime() const {
   APZCTreeManager* treeManagerLocal = GetApzcTreeManager();
   return treeManagerLocal ? treeManagerLocal->GetFrameTime() : TimeStamp::Now();
 }
 
-class MOZ_STACK_CLASS StateChangeNotificationBlocker {
+class MOZ_STACK_CLASS StateChangeNotificationBlocker final {
  public:
   explicit StateChangeNotificationBlocker(AsyncPanZoomController* aApzc)
       : mApzc(aApzc) {
     RecursiveMutexAutoLock lock(mApzc->mRecursiveMutex);
     mInitialState = mApzc->mState;
     mApzc->mNotificationBlockers++;
   }
 
@@ -576,17 +576,17 @@ class MOZ_STACK_CLASS StateChangeNotific
  * An RAII class to temporarily apply async test attributes to the provided
  * AsyncPanZoomController.
  *
  * This class should be used in the implementation of any AsyncPanZoomController
  * method that queries the async scroll offset or async zoom (this includes
  * the async layout viewport offset, since modifying the async scroll offset
  * may result in the layout viewport moving as well).
  */
-class MOZ_RAII AutoApplyAsyncTestAttributes {
+class MOZ_RAII AutoApplyAsyncTestAttributes final {
  public:
   explicit AutoApplyAsyncTestAttributes(const AsyncPanZoomController*);
   ~AutoApplyAsyncTestAttributes();
 
  private:
   AsyncPanZoomController* mApzc;
   FrameMetrics mPrevFrameMetrics;
 };
--- a/gfx/layers/apz/src/AutoDirWheelDeltaAdjuster.h
+++ b/gfx/layers/apz/src/AutoDirWheelDeltaAdjuster.h
@@ -42,20 +42,19 @@ class MOZ_STACK_CLASS APZAutoDirWheelDel
    *                           Indicates whether the horizontal content starts
    *                           at rightside. This value will decide which edge
    *                           the adjusted scroll goes towards, in other words,
    *                           it will decide the sign of the adjusted delta
    *                           values). For detailed information, see
    *                           IsHorizontalContentRightToLeft() in
    *                           the base class AutoDirWheelDeltaAdjuster.
    */
-  explicit APZAutoDirWheelDeltaAdjuster(double& aDeltaX, double& aDeltaY,
-                                        const AxisX& aAxisX,
-                                        const AxisY& aAxisY,
-                                        bool aIsHorizontalContentRightToLeft)
+  APZAutoDirWheelDeltaAdjuster(double& aDeltaX, double& aDeltaY,
+                               const AxisX& aAxisX, const AxisY& aAxisY,
+                               bool aIsHorizontalContentRightToLeft)
       : AutoDirWheelDeltaAdjuster(aDeltaX, aDeltaY),
         mAxisX(aAxisX),
         mAxisY(aAxisY),
         mIsHorizontalContentRightToLeft(aIsHorizontalContentRightToLeft) {}
 
  private:
   virtual bool CanScrollAlongXAxis() const override {
     return mAxisX.CanScroll();
--- a/gfx/layers/apz/src/Axis.h
+++ b/gfx/layers/apz/src/Axis.h
@@ -339,47 +339,43 @@ class Axis {
 
   // Helper function for SampleOverscrollAnimation().
   void StepOverscrollAnimation(double aStepDurationMilliseconds);
 };
 
 class AxisX : public Axis {
  public:
   explicit AxisX(AsyncPanZoomController* mAsyncPanZoomController);
-  virtual ParentLayerCoord GetPointOffset(
+  ParentLayerCoord GetPointOffset(
       const ParentLayerPoint& aPoint) const override;
-  virtual ParentLayerCoord GetRectLength(
-      const ParentLayerRect& aRect) const override;
-  virtual ParentLayerCoord GetRectOffset(
-      const ParentLayerRect& aRect) const override;
-  virtual CSSToParentLayerScale GetScaleForAxis(
+  ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const override;
+  ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const override;
+  CSSToParentLayerScale GetScaleForAxis(
       const CSSToParentLayerScale2D& aScale) const override;
-  virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
-  virtual const char* Name() const override;
+  ScreenPoint MakePoint(ScreenCoord aCoord) const override;
+  const char* Name() const override;
   bool CanScrollTo(Side aSide) const;
 
  private:
-  virtual OverscrollBehavior GetOverscrollBehavior() const override;
+  OverscrollBehavior GetOverscrollBehavior() const override;
 };
 
 class AxisY : public Axis {
  public:
   explicit AxisY(AsyncPanZoomController* mAsyncPanZoomController);
-  virtual ParentLayerCoord GetPointOffset(
+  ParentLayerCoord GetPointOffset(
       const ParentLayerPoint& aPoint) const override;
-  virtual ParentLayerCoord GetRectLength(
-      const ParentLayerRect& aRect) const override;
-  virtual ParentLayerCoord GetRectOffset(
-      const ParentLayerRect& aRect) const override;
-  virtual CSSToParentLayerScale GetScaleForAxis(
+  ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const override;
+  ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const override;
+  CSSToParentLayerScale GetScaleForAxis(
       const CSSToParentLayerScale2D& aScale) const override;
-  virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
-  virtual const char* Name() const override;
+  ScreenPoint MakePoint(ScreenCoord aCoord) const override;
+  const char* Name() const override;
   bool CanScrollTo(Side aSide) const;
 
  private:
-  virtual OverscrollBehavior GetOverscrollBehavior() const override;
+  OverscrollBehavior GetOverscrollBehavior() const override;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif
--- a/gfx/layers/apz/src/CheckerboardEvent.h
+++ b/gfx/layers/apz/src/CheckerboardEvent.h
@@ -20,17 +20,17 @@ namespace layers {
 /**
  * This class records information relevant to one "checkerboard event", which is
  * a contiguous set of frames where a given APZC was checkerboarding. The intent
  * of this class is to record enough information that it can provide actionable
  * steps to reduce the occurrence of checkerboarding. Furthermore, it records
  * information about the severity of the checkerboarding so as to allow
  * prioritizing the debugging of some checkerboarding events over others.
  */
-class CheckerboardEvent {
+class CheckerboardEvent final {
  public:
   // clang-format off
   MOZ_DEFINE_ENUM_AT_CLASS_SCOPE(
     RendertraceProperty, (
       Page,
       PaintedCriticalDisplayPort,
       PaintedDisplayPort,
       RequestedDisplayPort,
--- a/gfx/layers/apz/src/HitTestingTreeNode.h
+++ b/gfx/layers/apz/src/HitTestingTreeNode.h
@@ -216,17 +216,17 @@ class HitTestingTreeNode {
 /**
  * A class that allows safe usage of a HitTestingTreeNode outside of the APZ
  * tree lock. In general, this class should be Initialize()'d inside the tree
  * lock (enforced by the proof-of-lock to Initialize), and then can be returned
  * to a scope outside the tree lock and used safely. Upon destruction or
  * Clear() being called, it unlocks the underlying node at which point it can
  * be recycled or freed.
  */
-class MOZ_RAII HitTestingTreeNodeAutoLock {
+class MOZ_RAII HitTestingTreeNodeAutoLock final {
  public:
   HitTestingTreeNodeAutoLock();
   HitTestingTreeNodeAutoLock(const HitTestingTreeNodeAutoLock&) = delete;
   HitTestingTreeNodeAutoLock& operator=(const HitTestingTreeNodeAutoLock&) =
       delete;
   HitTestingTreeNodeAutoLock(HitTestingTreeNodeAutoLock&&) = delete;
   ~HitTestingTreeNodeAutoLock();
 
--- a/gfx/layers/apz/src/InputBlockState.h
+++ b/gfx/layers/apz/src/InputBlockState.h
@@ -44,18 +44,18 @@ class InputBlockState : public RefCounte
 
   enum class TargetConfirmationState : uint8_t {
     eUnconfirmed,
     eTimedOut,
     eTimedOutAndMainThreadResponded,
     eConfirmed
   };
 
-  explicit InputBlockState(const RefPtr<AsyncPanZoomController>& aTargetApzc,
-                           TargetConfirmationFlags aFlags);
+  InputBlockState(const RefPtr<AsyncPanZoomController>& aTargetApzc,
+                  TargetConfirmationFlags aFlags);
   virtual ~InputBlockState() = default;
 
   virtual CancelableBlockState* AsCancelableBlock() { return nullptr; }
   virtual TouchBlockState* AsTouchBlock() { return nullptr; }
   virtual WheelBlockState* AsWheelBlock() { return nullptr; }
   virtual DragBlockState* AsDragBlock() { return nullptr; }
   virtual PanGestureBlockState* AsPanGestureBlock() { return nullptr; }
   virtual KeyboardBlockState* AsKeyboardBlock() { return nullptr; }
--- a/gfx/layers/apz/src/InputQueue.h
+++ b/gfx/layers/apz/src/InputQueue.h
@@ -139,17 +139,17 @@ class InputQueue {
    */
   bool IsDragOnScrollbar(bool aOnScrollbar);
 
  private:
   ~InputQueue();
 
   // RAII class for automatically running a timeout task that may
   // need to be run immediately after an event has been queued.
-  class AutoRunImmediateTimeout {
+  class AutoRunImmediateTimeout final {
    public:
     explicit AutoRunImmediateTimeout(InputQueue* aQueue);
     ~AutoRunImmediateTimeout();
 
    private:
     InputQueue* mQueue;
   };
 
--- a/gfx/layers/apz/src/Overscroll.h
+++ b/gfx/layers/apz/src/Overscroll.h
@@ -13,23 +13,23 @@
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace layers {
 
 // Animation used by GenericOverscrollEffect.
 class OverscrollAnimation : public AsyncPanZoomAnimation {
  public:
-  explicit OverscrollAnimation(AsyncPanZoomController& aApzc,
-                               const ParentLayerPoint& aVelocity)
+  OverscrollAnimation(AsyncPanZoomController& aApzc,
+                      const ParentLayerPoint& aVelocity)
       : mApzc(aApzc) {
     mApzc.mX.StartOverscrollAnimation(aVelocity.x);
     mApzc.mY.StartOverscrollAnimation(aVelocity.y);
   }
-  ~OverscrollAnimation() {
+  virtual ~OverscrollAnimation() {
     mApzc.mX.EndOverscrollAnimation();
     mApzc.mY.EndOverscrollAnimation();
   }
 
   virtual bool DoSample(FrameMetrics& aFrameMetrics,
                         const TimeDuration& aDelta) override {
     // Can't inline these variables due to short-circuit evaluation.
     bool continueX = mApzc.mX.SampleOverscrollAnimation(aDelta);
--- a/gfx/layers/apz/util/APZEventState.h
+++ b/gfx/layers/apz/util/APZEventState.h
@@ -36,17 +36,17 @@ typedef std::function<void(const Scrolla
                            uint64_t /* input block id */,
                            bool /* prevent default */)>
     ContentReceivedInputBlockCallback;
 
 /**
  * A content-side component that keeps track of state for handling APZ
  * gestures and sending APZ notifications.
  */
-class APZEventState {
+class APZEventState final {
   typedef GeckoContentController::APZStateChange APZStateChange;
   typedef ScrollableLayerGuid::ViewID ViewID;
 
  public:
   APZEventState(nsIWidget* aWidget,
                 ContentReceivedInputBlockCallback&& aCallback);
 
   NS_INLINE_DECL_REFCOUNTING(APZEventState);
--- a/gfx/layers/apz/util/APZThreadUtils.h
+++ b/gfx/layers/apz/util/APZThreadUtils.h
@@ -55,26 +55,25 @@ class APZThreadUtils {
 // A base class for GenericNamedTimerCallback<Function>.
 // This is necessary because NS_IMPL_ISUPPORTS doesn't work for a class
 // template.
 class GenericNamedTimerCallbackBase : public nsITimerCallback, public nsINamed {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
  protected:
-  virtual ~GenericNamedTimerCallbackBase() {}
+  virtual ~GenericNamedTimerCallbackBase() = default;
 };
 
 // An nsITimerCallback implementation with nsINamed that can be used with any
 // function object that's callable with no arguments.
 template <typename Function>
 class GenericNamedTimerCallback final : public GenericNamedTimerCallbackBase {
  public:
-  explicit GenericNamedTimerCallback(const Function& aFunction,
-                                     const char* aName)
+  GenericNamedTimerCallback(const Function& aFunction, const char* aName)
       : mFunction(aFunction), mName(aName) {}
 
   NS_IMETHOD Notify(nsITimer*) override {
     mFunction();
     return NS_OK;
   }
 
   NS_IMETHOD GetName(nsACString& aName) override {
--- a/gfx/layers/apz/util/ActiveElementManager.h
+++ b/gfx/layers/apz/util/ActiveElementManager.h
@@ -20,17 +20,17 @@ class EventTarget;
 }  // namespace dom
 
 namespace layers {
 
 /**
  * Manages setting and clearing the ':active' CSS pseudostate in the presence
  * of touch input.
  */
-class ActiveElementManager {
+class ActiveElementManager final {
   ~ActiveElementManager();
 
  public:
   NS_INLINE_DECL_REFCOUNTING(ActiveElementManager)
 
   ActiveElementManager();
 
   /**
--- a/gfx/layers/apz/util/CheckerboardReportService.h
+++ b/gfx/layers/apz/util/CheckerboardReportService.h
@@ -46,17 +46,17 @@ class CheckerboardEventStorage {
    * Save a checkerboard event log, optionally dropping older ones that were
    * less severe or less recent. Zero-severity reports may be ignored entirely.
    */
   static void Report(uint32_t aSeverity, const std::string& aLog);
 
  private:
   /* Stuff for refcounted singleton */
   CheckerboardEventStorage() {}
-  virtual ~CheckerboardEventStorage() {}
+  virtual ~CheckerboardEventStorage() = default;
 
   static StaticRefPtr<CheckerboardEventStorage> sInstance;
 
   void ReportCheckerboard(uint32_t aSeverity, const std::string& aLog);
 
  private:
   /**
    * Struct that this class uses internally to store a checkerboard report.
@@ -122,17 +122,17 @@ class CheckerboardReportService : public
    * The methods exposed via the webidl.
    */
   void GetReports(nsTArray<dom::CheckerboardReport>& aOutReports);
   bool IsRecordingEnabled() const;
   void SetRecordingEnabled(bool aEnabled);
   void FlushActiveReports();
 
  private:
-  virtual ~CheckerboardReportService() {}
+  virtual ~CheckerboardReportService() = default;
 
   nsCOMPtr<nsISupports> mParent;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif /* mozilla_layers_CheckerboardReportService_h */
--- a/gfx/layers/apz/util/ChromeProcessController.h
+++ b/gfx/layers/apz/util/ChromeProcessController.h
@@ -41,51 +41,47 @@ class ChromeProcessController : public m
  protected:
   typedef mozilla::layers::FrameMetrics FrameMetrics;
   typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
 
  public:
   explicit ChromeProcessController(nsIWidget* aWidget,
                                    APZEventState* aAPZEventState,
                                    IAPZCTreeManager* aAPZCTreeManager);
-  ~ChromeProcessController();
-  virtual void Destroy() override;
+  virtual ~ChromeProcessController();
+  void Destroy() override;
 
   // GeckoContentController interface
-  virtual void NotifyLayerTransforms(
+  void NotifyLayerTransforms(
       const nsTArray<MatrixMessage>& aTransforms) override;
-  virtual void RequestContentRepaint(const RepaintRequest& aRequest) override;
-  virtual void PostDelayedTask(already_AddRefed<Runnable> aTask,
-                               int aDelayMs) override;
-  virtual bool IsRepaintThread() override;
-  virtual void DispatchToRepaintThread(
-      already_AddRefed<Runnable> aTask) override;
+  void RequestContentRepaint(const RepaintRequest& aRequest) override;
+  void PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) override;
+  bool IsRepaintThread() override;
+  void DispatchToRepaintThread(already_AddRefed<Runnable> aTask) override;
   MOZ_CAN_RUN_SCRIPT
-  virtual void HandleTap(TapType aType,
-                         const mozilla::LayoutDevicePoint& aPoint,
-                         Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
-                         uint64_t aInputBlockId) override;
-  virtual void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
-                                  const ScrollableLayerGuid& aGuid,
-                                  LayoutDeviceCoord aSpanChange,
-                                  Modifiers aModifiers) override;
-  virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
-                                    APZStateChange aChange, int aArg) override;
-  virtual void NotifyMozMouseScrollEvent(
-      const ScrollableLayerGuid::ViewID& aScrollId,
-      const nsString& aEvent) override;
-  virtual void NotifyFlushComplete() override;
-  virtual void NotifyAsyncScrollbarDragInitiated(
+  void HandleTap(TapType aType, const mozilla::LayoutDevicePoint& aPoint,
+                 Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
+                 uint64_t aInputBlockId) override;
+  void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
+                          const ScrollableLayerGuid& aGuid,
+                          LayoutDeviceCoord aSpanChange,
+                          Modifiers aModifiers) override;
+  void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
+                            APZStateChange aChange, int aArg) override;
+  void NotifyMozMouseScrollEvent(const ScrollableLayerGuid::ViewID& aScrollId,
+                                 const nsString& aEvent) override;
+  void NotifyFlushComplete() override;
+  void NotifyAsyncScrollbarDragInitiated(
       uint64_t aDragBlockId, const ScrollableLayerGuid::ViewID& aScrollId,
       ScrollDirection aDirection) override;
-  virtual void NotifyAsyncScrollbarDragRejected(
+  void NotifyAsyncScrollbarDragRejected(
       const ScrollableLayerGuid::ViewID& aScrollId) override;
-  virtual void NotifyAsyncAutoscrollRejected(
+  void NotifyAsyncAutoscrollRejected(
       const ScrollableLayerGuid::ViewID& aScrollId) override;
-  virtual void CancelAutoscroll(const ScrollableLayerGuid& aGuid) override;
+  void CancelAutoscroll(const ScrollableLayerGuid& aGuid) override;
 
  private:
   nsCOMPtr<nsIWidget> mWidget;
   RefPtr<APZEventState> mAPZEventState;
   RefPtr<IAPZCTreeManager> mAPZCTreeManager;
   MessageLoop* mUILoop;
 
   void InitializeRoot();
--- a/gfx/layers/apz/util/ScrollLinkedEffectDetector.h
+++ b/gfx/layers/apz/util/ScrollLinkedEffectDetector.h
@@ -15,17 +15,17 @@ namespace layers {
 // ScrollLinkedEffectDetector is used to detect the existence of a scroll-linked
 // effect on a webpage. Generally speaking, a scroll-linked effect is something
 // on the page that animates or changes with respect to the scroll position.
 // Content authors usually rely on running some JS in response to the scroll
 // event in order to implement such effects, and therefore it tends to be laggy
 // or work improperly with APZ enabled. This class helps us detect such an
 // effect so that we can warn the author and/or take other preventative
 // measures.
-class MOZ_STACK_CLASS ScrollLinkedEffectDetector {
+class MOZ_STACK_CLASS ScrollLinkedEffectDetector final {
  private:
   static uint32_t sDepth;
   static bool sFoundScrollLinkedEffect;
 
  public:
   static void PositioningPropertyMutated();
 
   explicit ScrollLinkedEffectDetector(dom::Document*);
--- a/gfx/layers/basic/BasicCanvasLayer.h
+++ b/gfx/layers/basic/BasicCanvasLayer.h
@@ -16,24 +16,24 @@
 namespace mozilla {
 namespace layers {
 
 class BasicCanvasLayer : public CanvasLayer, public BasicImplData {
  public:
   explicit BasicCanvasLayer(BasicLayerManager* aLayerManager)
       : CanvasLayer(aLayerManager, static_cast<BasicImplData*>(this)) {}
 
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override {
+  void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     CanvasLayer::SetVisibleRegion(aRegion);
   }
 
-  virtual void Paint(gfx::DrawTarget* aDT, const gfx::Point& aDeviceOffset,
-                     Layer* aMaskLayer) override;
+  void Paint(gfx::DrawTarget* aDT, const gfx::Point& aDeviceOffset,
+             Layer* aMaskLayer) override;
 
  protected:
   BasicLayerManager* BasicManager() {
     return static_cast<BasicLayerManager*>(mManager);
   }
 
   CanvasRenderer* CreateCanvasRendererInternal() override;
 };
--- a/gfx/layers/basic/BasicColorLayer.cpp
+++ b/gfx/layers/basic/BasicColorLayer.cpp
@@ -30,24 +30,24 @@ class BasicColorLayer : public ColorLaye
       : ColorLayer(aLayerManager, static_cast<BasicImplData*>(this)) {
     MOZ_COUNT_CTOR(BasicColorLayer);
   }
 
  protected:
   virtual ~BasicColorLayer() { MOZ_COUNT_DTOR(BasicColorLayer); }
 
  public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override {
+  void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     ColorLayer::SetVisibleRegion(aRegion);
   }
 
-  virtual void Paint(DrawTarget* aDT, const gfx::Point& aDeviceOffset,
-                     Layer* aMaskLayer) override {
+  void Paint(DrawTarget* aDT, const gfx::Point& aDeviceOffset,
+             Layer* aMaskLayer) override {
     if (IsHidden()) {
       return;
     }
 
     Rect snapped(mBounds.X(), mBounds.Y(), mBounds.Width(), mBounds.Height());
     MaybeSnapToDevicePixels(snapped, *aDT, true);
 
     // Clip drawing in case we're using (unbounded) operator source.
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -29,88 +29,88 @@
 namespace mozilla {
 using namespace mozilla::gfx;
 
 namespace layers {
 
 class DataTextureSourceBasic : public DataTextureSource,
                                public TextureSourceBasic {
  public:
-  virtual const char* Name() const override { return "DataTextureSourceBasic"; }
+  const char* Name() const override { return "DataTextureSourceBasic"; }
 
   explicit DataTextureSourceBasic(DataSourceSurface* aSurface)
       : mSurface(aSurface), mWrappingExistingData(!!aSurface) {}
 
-  virtual DataTextureSource* AsDataTextureSource() override {
+  DataTextureSource* AsDataTextureSource() override {
     // If the texture wraps someone else's memory we'd rather not use it as
     // a DataTextureSource per say (that is call Update on it).
     return mWrappingExistingData ? nullptr : this;
   }
 
-  virtual TextureSourceBasic* AsSourceBasic() override { return this; }
+  TextureSourceBasic* AsSourceBasic() override { return this; }
 
-  virtual gfx::SourceSurface* GetSurface(DrawTarget* aTarget) override {
+  gfx::SourceSurface* GetSurface(DrawTarget* aTarget) override {
     return mSurface;
   }
 
   SurfaceFormat GetFormat() const override {
     return mSurface ? mSurface->GetFormat() : gfx::SurfaceFormat::UNKNOWN;
   }
 
-  virtual IntSize GetSize() const override {
+  IntSize GetSize() const override {
     return mSurface ? mSurface->GetSize() : gfx::IntSize(0, 0);
   }
 
-  virtual bool Update(gfx::DataSourceSurface* aSurface,
-                      nsIntRegion* aDestRegion = nullptr,
-                      gfx::IntPoint* aSrcOffset = nullptr) override {
+  bool Update(gfx::DataSourceSurface* aSurface,
+              nsIntRegion* aDestRegion = nullptr,
+              gfx::IntPoint* aSrcOffset = nullptr) override {
     MOZ_ASSERT(!mWrappingExistingData);
     if (mWrappingExistingData) {
       return false;
     }
     mSurface = aSurface;
     return true;
   }
 
-  virtual void DeallocateDeviceData() override {
+  void DeallocateDeviceData() override {
     mSurface = nullptr;
     SetUpdateSerial(0);
   }
 
  public:
   RefPtr<gfx::DataSourceSurface> mSurface;
   bool mWrappingExistingData;
 };
 
 /**
  * WrappingTextureSourceYCbCrBasic wraps YUV format BufferTextureHost to defer
  * yuv->rgb conversion. The conversion happens when GetSurface is called.
  */
 class WrappingTextureSourceYCbCrBasic : public DataTextureSource,
                                         public TextureSourceBasic {
  public:
-  virtual const char* Name() const override {
+  const char* Name() const override {
     return "WrappingTextureSourceYCbCrBasic";
   }
 
   explicit WrappingTextureSourceYCbCrBasic(BufferTextureHost* aTexture)
       : mTexture(aTexture), mSize(aTexture->GetSize()), mNeedsUpdate(true) {
     mFromYCBCR = true;
   }
 
-  virtual DataTextureSource* AsDataTextureSource() override { return this; }
+  DataTextureSource* AsDataTextureSource() override { return this; }
 
-  virtual TextureSourceBasic* AsSourceBasic() override { return this; }
+  TextureSourceBasic* AsSourceBasic() override { return this; }
 
-  virtual WrappingTextureSourceYCbCrBasic* AsWrappingTextureSourceYCbCrBasic()
+  WrappingTextureSourceYCbCrBasic* AsWrappingTextureSourceYCbCrBasic()
       override {
     return this;
   }
 
-  virtual gfx::SourceSurface* GetSurface(DrawTarget* aTarget) override {
+  gfx::SourceSurface* GetSurface(DrawTarget* aTarget) override {
     if (mSurface && !mNeedsUpdate) {
       return mSurface;
     }
     MOZ_ASSERT(mTexture);
     if (!mTexture) {
       return nullptr;
     }
 
@@ -131,31 +131,31 @@ class WrappingTextureSourceYCbCrBasic : 
     mNeedsUpdate = false;
     return mSurface;
   }
 
   SurfaceFormat GetFormat() const override {
     return gfx::SurfaceFormat::B8G8R8X8;
   }
 
-  virtual IntSize GetSize() const override { return mSize; }
+  IntSize GetSize() const override { return mSize; }
 
   virtual bool Update(gfx::DataSourceSurface* aSurface,
                       nsIntRegion* aDestRegion = nullptr,
                       gfx::IntPoint* aSrcOffset = nullptr) override {
     return false;
   }
 
-  virtual void DeallocateDeviceData() override {
+  void DeallocateDeviceData() override {
     mTexture = nullptr;
     mSurface = nullptr;
     SetUpdateSerial(0);
   }
 
-  virtual void Unbind() override { mNeedsUpdate = true; }
+  void Unbind() override { mNeedsUpdate = true; }
 
   void SetBufferTextureHost(BufferTextureHost* aTexture) override {
     mTexture = aTexture;
     mNeedsUpdate = true;
   }
 
   void ConvertAndScale(const SurfaceFormat& aDestFormat,
                        const IntSize& aDestSize, unsigned char* aDestBuffer,
--- a/gfx/layers/basic/BasicCompositor.h
+++ b/gfx/layers/basic/BasicCompositor.h
@@ -19,155 +19,150 @@ namespace layers {
 class BasicCompositingRenderTarget : public CompositingRenderTarget {
  public:
   BasicCompositingRenderTarget(gfx::DrawTarget* aDrawTarget,
                                const gfx::IntRect& aRect)
       : CompositingRenderTarget(aRect.TopLeft()),
         mDrawTarget(aDrawTarget),
         mSize(aRect.Size()) {}
 
-  virtual const char* Name() const override {
-    return "BasicCompositingRenderTarget";
-  }
+  const char* Name() const override { return "BasicCompositingRenderTarget"; }
 
-  virtual gfx::IntSize GetSize() const override { return mSize; }
+  gfx::IntSize GetSize() const override { return mSize; }
 
   void BindRenderTarget();
 
-  virtual gfx::SurfaceFormat GetFormat() const override {
+  gfx::SurfaceFormat GetFormat() const override {
     return mDrawTarget ? mDrawTarget->GetFormat()
                        : gfx::SurfaceFormat(gfx::SurfaceFormat::UNKNOWN);
   }
 
   RefPtr<gfx::DrawTarget> mDrawTarget;
   gfx::IntSize mSize;
 };
 
 class BasicCompositor : public Compositor {
  public:
-  explicit BasicCompositor(CompositorBridgeParent* aParent,
-                           widget::CompositorWidget* aWidget);
+  BasicCompositor(CompositorBridgeParent* aParent,
+                  widget::CompositorWidget* aWidget);
 
  protected:
   virtual ~BasicCompositor();
 
  public:
-  virtual BasicCompositor* AsBasicCompositor() override { return this; }
+  BasicCompositor* AsBasicCompositor() override { return this; }
 
-  virtual bool Initialize(nsCString* const out_failureReason) override;
+  bool Initialize(nsCString* const out_failureReason) override;
 
-  virtual void DetachWidget() override;
+  void DetachWidget() override;
 
-  virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override;
+  TextureFactoryIdentifier GetTextureFactoryIdentifier() override;
 
-  virtual already_AddRefed<CompositingRenderTarget> CreateRenderTarget(
+  already_AddRefed<CompositingRenderTarget> CreateRenderTarget(
       const gfx::IntRect& aRect, SurfaceInitMode aInit) override;
 
-  virtual already_AddRefed<CompositingRenderTarget>
-  CreateRenderTargetFromSource(const gfx::IntRect& aRect,
-                               const CompositingRenderTarget* aSource,
-                               const gfx::IntPoint& aSourcePoint) override;
+  already_AddRefed<CompositingRenderTarget> CreateRenderTargetFromSource(
+      const gfx::IntRect& aRect, const CompositingRenderTarget* aSource,
+      const gfx::IntPoint& aSourcePoint) override;
 
   virtual already_AddRefed<CompositingRenderTarget> CreateRenderTargetForWindow(
       const LayoutDeviceIntRect& aRect, const LayoutDeviceIntRect& aClearRect,
       BufferMode aBufferMode);
 
-  virtual already_AddRefed<DataTextureSource> CreateDataTextureSource(
+  already_AddRefed<DataTextureSource> CreateDataTextureSource(
       TextureFlags aFlags = TextureFlags::NO_FLAGS) override;
 
-  virtual already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(
+  already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(
       gfx::DataSourceSurface* aSurface) override;
 
-  virtual already_AddRefed<DataTextureSource>
-  CreateDataTextureSourceAroundYCbCr(TextureHost* aTexture) override;
+  already_AddRefed<DataTextureSource> CreateDataTextureSourceAroundYCbCr(
+      TextureHost* aTexture) override;
 
-  virtual bool SupportsEffect(EffectTypes aEffect) override;
+  bool SupportsEffect(EffectTypes aEffect) override;
 
   bool SupportsLayerGeometry() const override;
 
-  virtual bool ReadbackRenderTarget(CompositingRenderTarget* aSource,
-                                    AsyncReadbackBuffer* aDest) override;
+  bool ReadbackRenderTarget(CompositingRenderTarget* aSource,
+                            AsyncReadbackBuffer* aDest) override;
 
-  virtual already_AddRefed<AsyncReadbackBuffer> CreateAsyncReadbackBuffer(
+  already_AddRefed<AsyncReadbackBuffer> CreateAsyncReadbackBuffer(
       const gfx::IntSize& aSize) override;
 
-  virtual bool BlitRenderTarget(CompositingRenderTarget* aSource,
-                                const gfx::IntSize& aSourceSize,
-                                const gfx::IntSize& aDestSize) override;
+  bool BlitRenderTarget(CompositingRenderTarget* aSource,
+                        const gfx::IntSize& aSourceSize,
+                        const gfx::IntSize& aDestSize) override;
 
-  virtual void SetRenderTarget(CompositingRenderTarget* aSource) override {
+  void SetRenderTarget(CompositingRenderTarget* aSource) override {
     mRenderTarget = static_cast<BasicCompositingRenderTarget*>(aSource);
     mRenderTarget->BindRenderTarget();
   }
 
-  virtual already_AddRefed<CompositingRenderTarget> GetWindowRenderTarget()
+  already_AddRefed<CompositingRenderTarget> GetWindowRenderTarget()
       const override {
     return do_AddRef(mFullWindowRenderTarget);
   }
 
-  virtual already_AddRefed<CompositingRenderTarget> GetCurrentRenderTarget()
+  already_AddRefed<CompositingRenderTarget> GetCurrentRenderTarget()
       const override {
     return do_AddRef(mRenderTarget);
   }
 
-  virtual void DrawQuad(const gfx::Rect& aRect, const gfx::IntRect& aClipRect,
-                        const EffectChain& aEffectChain, gfx::Float aOpacity,
-                        const gfx::Matrix4x4& aTransform,
-                        const gfx::Rect& aVisibleRect) override;
+  void DrawQuad(const gfx::Rect& aRect, const gfx::IntRect& aClipRect,
+                const EffectChain& aEffectChain, gfx::Float aOpacity,
+                const gfx::Matrix4x4& aTransform,
+                const gfx::Rect& aVisibleRect) override;
 
-  virtual void ClearRect(const gfx::Rect& aRect) override;
+  void ClearRect(const gfx::Rect& aRect) override;
 
-  virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
-                          const gfx::IntRect* aClipRectIn,
-                          const gfx::IntRect& aRenderBounds,
-                          const nsIntRegion& aOpaqueRegion,
-                          gfx::IntRect* aClipRectOut = nullptr,
-                          gfx::IntRect* aRenderBoundsOut = nullptr) override;
-  virtual void EndFrame() override;
+  void BeginFrame(const nsIntRegion& aInvalidRegion,
+                  const gfx::IntRect* aClipRectIn,
+                  const gfx::IntRect& aRenderBounds,
+                  const nsIntRegion& aOpaqueRegion,
+                  gfx::IntRect* aClipRectOut = nullptr,
+                  gfx::IntRect* aRenderBoundsOut = nullptr) override;
+  void EndFrame() override;
 
-  virtual bool SupportsPartialTextureUpdate() override { return true; }
-  virtual bool CanUseCanvasLayerForSize(const gfx::IntSize& aSize) override {
+  bool SupportsPartialTextureUpdate() override { return true; }
+  bool CanUseCanvasLayerForSize(const gfx::IntSize& aSize) override {
     return true;
   }
-  virtual int32_t GetMaxTextureSize() const override;
-  virtual void SetDestinationSurfaceSize(const gfx::IntSize& aSize) override {}
+  int32_t GetMaxTextureSize() const override;
+  void SetDestinationSurfaceSize(const gfx::IntSize& aSize) override {}
 
-  virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) override {}
+  void SetScreenRenderOffset(const ScreenPoint& aOffset) override {}
 
-  virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) override {}
+  void MakeCurrent(MakeCurrentFlags aFlags = 0) override {}
 
 #ifdef MOZ_DUMP_PAINTING
-  virtual const char* Name() const override { return "Basic"; }
+  const char* Name() const override { return "Basic"; }
 #endif  // MOZ_DUMP_PAINTING
 
-  virtual LayersBackend GetBackendType() const override {
+  LayersBackend GetBackendType() const override {
     return LayersBackend::LAYERS_BASIC;
   }
 
   gfx::DrawTarget* GetDrawTarget() { return mDrawTarget; }
 
-  virtual bool IsPendingComposite() override {
-    return mIsPendingEndRemoteDrawing;
-  }
+  bool IsPendingComposite() override { return mIsPendingEndRemoteDrawing; }
 
-  virtual void FinishPendingComposite() override;
+  void FinishPendingComposite() override;
 
  private:
   template <typename Geometry>
   void DrawGeometry(const Geometry& aGeometry, const gfx::Rect& aRect,
                     const gfx::IntRect& aClipRect,
                     const EffectChain& aEffectChain, gfx::Float aOpacity,
                     const gfx::Matrix4x4& aTransform,
                     const gfx::Rect& aVisibleRect, const bool aEnableAA);
 
-  virtual void DrawPolygon(const gfx::Polygon& aPolygon, const gfx::Rect& aRect,
-                           const gfx::IntRect& aClipRect,
-                           const EffectChain& aEffectChain, gfx::Float aOpacity,
-                           const gfx::Matrix4x4& aTransform,
-                           const gfx::Rect& aVisibleRect) override;
+  void DrawPolygon(const gfx::Polygon& aPolygon, const gfx::Rect& aRect,
+                   const gfx::IntRect& aClipRect,
+                   const EffectChain& aEffectChain, gfx::Float aOpacity,
+                   const gfx::Matrix4x4& aTransform,
+                   const gfx::Rect& aVisibleRect) override;
 
   void TryToEndRemoteDrawing(bool aForceToEnd = false);
 
   bool NeedsToDeferEndRemoteDrawing();
 
   // The final destination surface
   RefPtr<gfx::DrawTarget> mDrawTarget;
   // The current render target for drawing
--- a/gfx/layers/basic/BasicContainerLayer.h
+++ b/gfx/layers/basic/BasicContainerLayer.h
@@ -25,46 +25,46 @@ class BasicContainerLayer : public Conta
     MOZ_COUNT_CTOR(BasicContainerLayer);
     mSupportsComponentAlphaChildren = true;
   }
 
  protected:
   virtual ~BasicContainerLayer();
 
  public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override {
+  void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     ContainerLayer::SetVisibleRegion(aRegion);
   }
-  virtual bool InsertAfter(Layer* aChild, Layer* aAfter) override {
+  bool InsertAfter(Layer* aChild, Layer* aAfter) override {
     if (!BasicManager()->InConstruction()) {
       NS_ERROR("Can only set properties in construction phase");
       return false;
     }
     return ContainerLayer::InsertAfter(aChild, aAfter);
   }
 
-  virtual bool RemoveChild(Layer* aChild) override {
+  bool RemoveChild(Layer* aChild) override {
     if (!BasicManager()->InConstruction()) {
       NS_ERROR("Can only set properties in construction phase");
       return false;
     }
     return ContainerLayer::RemoveChild(aChild);
   }
 
-  virtual bool RepositionChild(Layer* aChild, Layer* aAfter) override {
+  bool RepositionChild(Layer* aChild, Layer* aAfter) override {
     if (!BasicManager()->InConstruction()) {
       NS_ERROR("Can only set properties in construction phase");
       return false;
     }
     return ContainerLayer::RepositionChild(aChild, aAfter);
   }
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override;
 
   /**
    * Returns true when:
    * a) no (non-hidden) childrens' visible areas overlap in
    * (aInRect intersected with this layer's visible region).
    * b) the (non-hidden) childrens' visible areas cover
    * (aInRect intersected with this layer's visible region).
@@ -77,25 +77,24 @@ class BasicContainerLayer : public Conta
   bool ChildrenPartitionVisibleRegion(const gfx::IntRect& aInRect);
 
   void ForceIntermediateSurface() { mUseIntermediateSurface = true; }
 
   void SetSupportsComponentAlphaChildren(bool aSupports) {
     mSupportsComponentAlphaChildren = aSupports;
   }
 
-  virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
-                        void* aCallbackData,
-                        ReadbackProcessor* aReadback) override;
+  void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
+                void* aCallbackData, ReadbackProcessor* aReadback) override;
 
   /**
    * We don't really have a hard restriction for max layer size, but we pick
    * 4096 to avoid excessive memory usage.
    */
-  virtual int32_t GetMaxLayerSize() override { return 4096; }
+  int32_t GetMaxLayerSize() override { return 4096; }
 
  protected:
   BasicLayerManager* BasicManager() {
     return static_cast<BasicLayerManager*>(mManager);
   }
 };
 
 }  // namespace layers
--- a/gfx/layers/basic/BasicImageLayer.cpp
+++ b/gfx/layers/basic/BasicImageLayer.cpp
@@ -27,17 +27,17 @@ class BasicImageLayer : public ImageLaye
  public:
   explicit BasicImageLayer(BasicLayerManager* aLayerManager)
       : ImageLayer(aLayerManager, static_cast<BasicImplData*>(this)),
         mSize(-1, -1) {
     MOZ_COUNT_CTOR(BasicImageLayer);
   }
 
  protected:
-  ~BasicImageLayer() override { MOZ_COUNT_DTOR(BasicImageLayer); }
+  virtual ~BasicImageLayer() { MOZ_COUNT_DTOR(BasicImageLayer); }
 
  public:
   void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     ImageLayer::SetVisibleRegion(aRegion);
   }
 
--- a/gfx/layers/basic/BasicLayersImpl.h
+++ b/gfx/layers/basic/BasicLayersImpl.h
@@ -53,17 +53,17 @@ class BasicReadbackLayer : public Readba
       : ReadbackLayer(aLayerManager, static_cast<BasicImplData*>(this)) {
     MOZ_COUNT_CTOR(BasicReadbackLayer);
   }
 
  protected:
   virtual ~BasicReadbackLayer() { MOZ_COUNT_DTOR(BasicReadbackLayer); }
 
  public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override {
+  void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     ReadbackLayer::SetVisibleRegion(aRegion);
   }
 
  protected:
   BasicLayerManager* BasicManager() {
     return static_cast<BasicLayerManager*>(mManager);
--- a/gfx/layers/basic/BasicPaintedLayer.h
+++ b/gfx/layers/basic/BasicPaintedLayer.h
@@ -26,56 +26,54 @@ namespace layers {
 
 class ReadbackProcessor;
 
 class BasicPaintedLayer : public PaintedLayer, public BasicImplData {
  public:
   typedef ContentClient::PaintState PaintState;
   typedef ContentClient::ContentType ContentType;
 
-  explicit BasicPaintedLayer(BasicLayerManager* aLayerManager,
-                             gfx::BackendType aBackend)
+  BasicPaintedLayer(BasicLayerManager* aLayerManager, gfx::BackendType aBackend)
       : PaintedLayer(aLayerManager, static_cast<BasicImplData*>(this)),
         mContentClient(nullptr),
         mBackend(aBackend) {
     MOZ_COUNT_CTOR(BasicPaintedLayer);
   }
 
  protected:
   virtual ~BasicPaintedLayer() { MOZ_COUNT_DTOR(BasicPaintedLayer); }
 
  public:
-  virtual void SetVisibleRegion(const LayerIntRegion& aRegion) override {
+  void SetVisibleRegion(const LayerIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     PaintedLayer::SetVisibleRegion(aRegion);
   }
-  virtual void InvalidateRegion(const nsIntRegion& aRegion) override {
+  void InvalidateRegion(const nsIntRegion& aRegion) override {
     NS_ASSERTION(BasicManager()->InConstruction(),
                  "Can only set properties in construction phase");
     mInvalidRegion.Add(aRegion);
     UpdateValidRegionAfterInvalidRegionChanged();
   }
 
-  virtual void PaintThebes(gfxContext* aContext, Layer* aMaskLayer,
-                           LayerManager::DrawPaintedLayerCallback aCallback,
-                           void* aCallbackData) override;
+  void PaintThebes(gfxContext* aContext, Layer* aMaskLayer,
+                   LayerManager::DrawPaintedLayerCallback aCallback,
+                   void* aCallbackData) override;
 
-  virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
-                        void* aCallbackData,
-                        ReadbackProcessor* aReadback) override;
+  void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
+                void* aCallbackData, ReadbackProcessor* aReadback) override;
 
-  virtual void ClearCachedResources() override {
+  void ClearCachedResources() override {
     if (mContentClient) {
       mContentClient->Clear();
     }
     ClearValidRegion();
   }
 
-  virtual void ComputeEffectiveTransforms(
+  void ComputeEffectiveTransforms(
       const gfx::Matrix4x4& aTransformToSurface) override {
     if (!BasicManager()->IsRetained()) {
       // Don't do any snapping of our transform, since we're just going to
       // draw straight through without intermediate buffers.
       mEffectiveTransform = GetLocalTransform() * aTransformToSurface;
       if (gfxPoint(0, 0) != mResidualTranslation) {
         mResidualTranslation = gfxPoint(0, 0);
         ClearValidRegion();
--- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
+++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
@@ -24,27 +24,25 @@ class BasicCompositor;
  * the compositor's temporary textures when binding.
  */
 class MacIOSurfaceTextureSourceBasic : public TextureSourceBasic,
                                        public TextureSource {
  public:
   explicit MacIOSurfaceTextureSourceBasic(MacIOSurface* aSurface);
   virtual ~MacIOSurfaceTextureSourceBasic();
 
-  virtual const char* Name() const override {
-    return "MacIOSurfaceTextureSourceBasic";
-  }
+  const char* Name() const override { return "MacIOSurfaceTextureSourceBasic"; }
 
-  virtual TextureSourceBasic* AsSourceBasic() override { return this; }
+  TextureSourceBasic* AsSourceBasic() override { return this; }
 
-  virtual gfx::IntSize GetSize() const override;
-  virtual gfx::SurfaceFormat GetFormat() const override;
-  virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
+  gfx::IntSize GetSize() const override;
+  gfx::SurfaceFormat GetFormat() const override;
+  gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
 
-  virtual void DeallocateDeviceData() override {}
+  void DeallocateDeviceData() override {}
 
  protected:
   RefPtr<MacIOSurface> mSurface;
   RefPtr<gfx::SourceSurface> mSourceSurface;
 };
 
 /**
  * A TextureHost for shared MacIOSurface
@@ -54,35 +52,35 @@ class MacIOSurfaceTextureSourceBasic : p
 class MacIOSurfaceTextureHostBasic : public TextureHost {
  public:
   MacIOSurfaceTextureHostBasic(
       TextureFlags aFlags, const SurfaceDescriptorMacIOSurface& aDescriptor);
 
   virtual void SetTextureSourceProvider(
       TextureSourceProvider* aProvider) override;
 
-  virtual bool Lock() override;
+  bool Lock() override;
 
-  virtual gfx::SurfaceFormat GetFormat() const override;
+  gfx::SurfaceFormat GetFormat() const override;
 
   virtual bool BindTextureSource(
       CompositableTextureSourceRef& aTexture) override {
     aTexture = mTextureSource;
     return !!aTexture;
   }
 
-  virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
+  already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
     return nullptr;  // XXX - implement this (for MOZ_DUMP_PAINTING)
   }
 
-  virtual gfx::IntSize GetSize() const override;
-  virtual MacIOSurface* GetMacIOSurface() override { return mSurface; }
+  gfx::IntSize GetSize() const override;
+  MacIOSurface* GetMacIOSurface() override { return mSurface; }
 
 #ifdef MOZ_LAYERS_HAVE_LOG
-  virtual const char* Name() override { return "MacIOSurfaceTextureHostBasic"; }
+  const char* Name() override { return "MacIOSurfaceTextureHostBasic"; }
 #endif
 
  protected:
   RefPtr<MacIOSurfaceTextureSourceBasic> mTextureSource;
   RefPtr<MacIOSurface> mSurface;
 };
 
 }  // namespace layers
--- a/gfx/layers/basic/TextureHostBasic.h
+++ b/gfx/layers/basic/TextureHostBasic.h
@@ -20,17 +20,17 @@ already_AddRefed<TextureHost> CreateText
     LayersBackend aBackend, TextureFlags aFlags);
 
 /**
  * A texture source interface that can be used by the software Compositor.
  */
 class TextureSourceBasic {
  public:
   TextureSourceBasic() : mFromYCBCR(false) {}
-  virtual ~TextureSourceBasic() {}
+  virtual ~TextureSourceBasic() = default;
   virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) = 0;
   virtual void SetBufferTextureHost(BufferTextureHost* aTexture) {}
   bool mFromYCBCR;  // we to track sources from YCBCR so we can use a less
                     // accurate fast path for video
 };
 
 }  // namespace layers
 }  // namespace mozilla
--- a/gfx/layers/basic/X11BasicCompositor.h
+++ b/gfx/layers/basic/X11BasicCompositor.h
@@ -17,52 +17,50 @@ namespace mozilla {
 namespace layers {
 
 // TextureSource for Image-backed surfaces.
 class X11DataTextureSourceBasic : public DataTextureSource,
                                   public TextureSourceBasic {
  public:
   X11DataTextureSourceBasic(){};
 
-  virtual const char* Name() const override {
-    return "X11DataTextureSourceBasic";
-  }
+  const char* Name() const override { return "X11DataTextureSourceBasic"; }
 
-  virtual bool Update(gfx::DataSourceSurface* aSurface,
-                      nsIntRegion* aDestRegion = nullptr,
-                      gfx::IntPoint* aSrcOffset = nullptr) override;
+  bool Update(gfx::DataSourceSurface* aSurface,
+              nsIntRegion* aDestRegion = nullptr,
+              gfx::IntPoint* aSrcOffset = nullptr) override;
+
+  TextureSourceBasic* AsSourceBasic() override;
 
-  virtual TextureSourceBasic* AsSourceBasic() override;
+  gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
 
-  virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
+  void DeallocateDeviceData() override;
 
-  virtual void DeallocateDeviceData() override;
+  gfx::IntSize GetSize() const override;
 
-  virtual gfx::IntSize GetSize() const override;
-
-  virtual gfx::SurfaceFormat GetFormat() const override;
+  gfx::SurfaceFormat GetFormat() const override;
 
  private:
   // We are going to buffer layer content on this xlib draw target
   RefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget;
 };
 
 class X11BasicCompositor : public BasicCompositor {
  public:
   explicit X11BasicCompositor(CompositorBridgeParent* aParent,
                               widget::CompositorWidget* aWidget)
       : BasicCompositor(aParent, aWidget) {}
 
-  virtual already_AddRefed<DataTextureSource> CreateDataTextureSource(
+  already_AddRefed<DataTextureSource> CreateDataTextureSource(
       TextureFlags aFlags = TextureFlags::NO_FLAGS) override;
 
-  virtual already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(
+  already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(
       gfx::DataSourceSurface* aSurface) override {
     return nullptr;
   }
 
-  virtual void EndFrame() override;
+  void EndFrame() override;
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_X11BASICCOMPOSITOR_H */
--- a/gfx/layers/client/CanvasClient.h
+++ b/gfx/layers/client/CanvasClient.h
@@ -53,25 +53,25 @@ class CanvasClient : public Compositable
   static already_AddRefed<CanvasClient> CreateCanvasClient(
       CanvasClientType aType, CompositableForwarder* aFwd, TextureFlags aFlags);
 
   CanvasClient(CompositableForwarder* aFwd, TextureFlags aFlags)
       : CompositableClient(aFwd, aFlags), mFrameID(0) {
     mTextureFlags = aFlags;
   }
 
-  virtual ~CanvasClient() {}
+  virtual ~CanvasClient() = default;
 
   virtual void Clear(){};
 
   virtual void Update(gfx::IntSize aSize,
                       ShareableCanvasRenderer* aCanvasRenderer,
                       wr::RenderRoot aRenderRoot) = 0;
 
-  virtual bool AddTextureClient(TextureClient* aTexture) override {
+  bool AddTextureClient(TextureClient* aTexture) override {
     ++mFrameID;
     return CompositableClient::AddTextureClient(aTexture);
   }
 
   virtual void UpdateAsync(AsyncCanvasRenderer* aRenderer) {}
 
   virtual void UpdateFromTexture(TextureClient* aTexture,
                                  wr::RenderRoot aRenderRoot) {}
@@ -88,32 +88,31 @@ class CanvasClient2D : public CanvasClie
  public:
   CanvasClient2D(CompositableForwarder* aLayerForwarder, TextureFlags aFlags)
       : CanvasClient(aLayerForwarder, aFlags) {}
 
   TextureInfo GetTextureInfo() const override {
     return TextureInfo(CompositableType::IMAGE, mTextureFlags);
   }
 
-  virtual void Clear() override {
+  void Clear() override {
     mBackBuffer = mFrontBuffer = mBufferProviderTexture = nullptr;
   }
 
-  virtual void Update(gfx::IntSize aSize,
-                      ShareableCanvasRenderer* aCanvasRenderer,
-                      wr::RenderRoot aRenderRoot) override;
+  void Update(gfx::IntSize aSize, ShareableCanvasRenderer* aCanvasRenderer,
+              wr::RenderRoot aRenderRoot) override;
 
-  virtual void UpdateFromTexture(TextureClient* aBuffer,
-                                 wr::RenderRoot aRenderRoot) override;
+  void UpdateFromTexture(TextureClient* aBuffer,
+                         wr::RenderRoot aRenderRoot) override;
 
-  virtual bool AddTextureClient(TextureClient* aTexture) override {
+  bool AddTextureClient(TextureClient* aTexture) override {
     return CanvasClient::AddTextureClient(aTexture);
   }
 
-  virtual void OnDetach() override { mBackBuffer = mFrontBuffer = nullptr; }
+  void OnDetach() override { mBackBuffer = mFrontBuffer = nullptr; }
 
  private:
   already_AddRefed<TextureClient> CreateTextureClientForCanvas(
       gfx::SurfaceFormat aFormat, gfx::IntSize aSize, TextureFlags aFlags,
       ShareableCanvasRenderer* aCanvasRenderer);
 
   RefPtr<TextureClient> mBackBuffer;
   RefPtr<TextureClient> mFrontBuffer;
@@ -137,32 +136,31 @@ class CanvasClientSharedSurface : public
   void ClearSurfaces();
 
  public:
   CanvasClientSharedSurface(CompositableForwarder* aLayerForwarder,
                             TextureFlags aFlags);
 
   ~CanvasClientSharedSurface();
 
-  virtual TextureInfo GetTextureInfo() const override {
+  TextureInfo GetTextureInfo() const override {
     return TextureInfo(CompositableType::IMAGE);
   }
 
-  virtual void Clear() override { ClearSurfaces(); }
+  void Clear() override { ClearSurfaces(); }
 
-  virtual void Update(gfx::IntSize aSize,
-                      ShareableCanvasRenderer* aCanvasRenderer,
-                      wr::RenderRoot aRenderRoot) override;
+  void Update(gfx::IntSize aSize, ShareableCanvasRenderer* aCanvasRenderer,
+              wr::RenderRoot aRenderRoot) override;
   void UpdateRenderer(gfx::IntSize aSize, Renderer& aRenderer);
 
-  virtual void UpdateAsync(AsyncCanvasRenderer* aRenderer) override;
+  void UpdateAsync(AsyncCanvasRenderer* aRenderer) override;
 
-  virtual void Updated(wr::RenderRoot aRenderRoot) override;
+  void Updated(wr::RenderRoot aRenderRoot) override;
 
-  virtual void OnDetach() override;
+  void OnDetach() override;
 };
 
 /**
  * Used for OMT<canvas> uploads using the image bridge protocol.
  * Actual CanvasClient is on the ImageBridgeChild thread, so we
  * only forward its AsyncID here
  */
 class CanvasClientBridge final : public CanvasClient {
@@ -170,21 +168,20 @@ class CanvasClientBridge final : public 
   CanvasClientBridge(CompositableForwarder* aLayerForwarder,
                      TextureFlags aFlags)
       : CanvasClient(aLayerForwarder, aFlags), mLayer(nullptr) {}
 
   TextureInfo GetTextureInfo() const override {
     return TextureInfo(CompositableType::IMAGE);
   }
 
-  virtual void Update(gfx::IntSize aSize,
-                      ShareableCanvasRenderer* aCanvasRenderer,
-                      wr::RenderRoot aRenderRoot) override {}
+  void Update(gfx::IntSize aSize, ShareableCanvasRenderer* aCanvasRenderer,
+              wr::RenderRoot aRenderRoot) override {}
 
-  virtual void UpdateAsync(AsyncCanvasRenderer* aRenderer) override;
+  void UpdateAsync(AsyncCanvasRenderer* aRenderer) override;
 
   void SetLayer(ShadowableLayer* aLayer) { mLayer = aLayer; }
 
  protected:
   CompositableHandle mAsyncHandle;
   ShadowableLayer* mLayer;
 };
 
--- a/gfx/layers/client/ClientCanvasLayer.h
+++ b/gfx/layers/client/ClientCanvasLayer.h
@@ -31,43 +31,42 @@ class ClientCanvasLayer : public CanvasL
   }
 
   CanvasRenderer* CreateCanvasRendererInternal() override;
 
  protected: