From 015ce119861cacdda9500ddfa42ec0198a8970f1 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 20 Aug 2014 00:55:14 -0400 Subject: [PATCH] Bug 1050609 - Fix more bad implicit constructors in gfx/layers; r=roc --- gfx/layers/Compositor.h | 2 +- gfx/layers/Effects.h | 8 ++++---- gfx/layers/ImageContainer.h | 8 ++++---- gfx/layers/LayerScope.cpp | 6 +++--- gfx/layers/LayerScope.h | 2 +- gfx/layers/LayerTreeInvalidation.cpp | 8 ++++---- gfx/layers/RotatedBuffer.h | 2 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 2 +- gfx/layers/apz/src/AsyncPanZoomController.h | 4 ++-- gfx/layers/apz/src/Axis.h | 6 +++--- gfx/layers/apz/src/GestureEventListener.h | 2 +- gfx/layers/basic/BasicCanvasLayer.h | 2 +- gfx/layers/basic/BasicColorLayer.cpp | 2 +- gfx/layers/basic/BasicCompositor.h | 2 +- gfx/layers/basic/BasicContainerLayer.h | 2 +- gfx/layers/basic/BasicImageLayer.cpp | 2 +- gfx/layers/basic/BasicLayers.h | 4 ++-- gfx/layers/basic/BasicLayersImpl.h | 2 +- gfx/layers/basic/BasicThebesLayer.h | 2 +- gfx/layers/client/ClientCanvasLayer.h | 2 +- gfx/layers/client/ClientColorLayer.cpp | 2 +- gfx/layers/client/ClientContainerLayer.h | 4 ++-- gfx/layers/client/ClientImageLayer.cpp | 2 +- gfx/layers/client/ClientLayerManager.h | 2 +- gfx/layers/client/ClientReadbackLayer.h | 2 +- gfx/layers/client/ClientThebesLayer.h | 4 ++-- gfx/layers/client/ClientTiledThebesLayer.h | 4 ++-- gfx/layers/client/CompositableClient.h | 6 +++--- gfx/layers/client/ContentClient.h | 12 ++++++------ gfx/layers/client/SimpleTiledContentClient.h | 4 ++-- gfx/layers/client/TextureClient.h | 10 +++++----- gfx/layers/client/TiledContentClient.h | 2 +- gfx/layers/composite/AsyncCompositionManager.h | 8 ++++---- gfx/layers/composite/CanvasLayerComposite.h | 2 +- gfx/layers/composite/ColorLayerComposite.h | 2 +- gfx/layers/composite/CompositableHost.h | 4 ++-- gfx/layers/composite/ContainerLayerComposite.h | 4 ++-- gfx/layers/composite/ContentHost.h | 12 ++++++------ gfx/layers/composite/FPSCounter.h | 2 +- gfx/layers/composite/ImageHost.h | 2 +- gfx/layers/composite/ImageLayerComposite.h | 2 +- gfx/layers/composite/LayerManagerComposite.h | 4 ++-- gfx/layers/composite/TextRenderer.h | 2 +- gfx/layers/composite/TextureHost.cpp | 2 +- gfx/layers/composite/TextureHost.h | 6 +++--- gfx/layers/composite/ThebesLayerComposite.h | 2 +- gfx/layers/composite/TiledContentHost.h | 2 +- gfx/layers/ipc/AsyncTransactionTracker.h | 2 +- gfx/layers/ipc/CompositorChild.h | 2 +- gfx/layers/ipc/CompositorParent.h | 6 +++--- gfx/layers/ipc/FenceUtils.h | 4 ++-- gfx/layers/ipc/ImageBridgeChild.cpp | 4 ++-- gfx/layers/ipc/ShadowLayerChild.h | 2 +- gfx/layers/ipc/ShadowLayers.cpp | 2 +- gfx/layers/ipc/SharedBufferManagerParent.cpp | 2 +- gfx/layers/ipc/SharedPlanarYCbCrImage.h | 2 +- gfx/layers/ipc/SharedRGBImage.h | 2 +- gfx/layers/opengl/CompositorOGL.h | 8 ++++---- gfx/layers/opengl/GLManager.cpp | 2 +- gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h | 2 +- gfx/layers/opengl/TextureClientOGL.h | 2 +- gfx/layers/opengl/TextureHostOGL.h | 4 ++-- 62 files changed, 113 insertions(+), 113 deletions(-) diff --git a/gfx/layers/Compositor.h b/gfx/layers/Compositor.h index d3901b9c068b..c9b0aa6ffbe9 100644 --- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -197,7 +197,7 @@ protected: public: NS_INLINE_DECL_REFCOUNTING(Compositor) - Compositor(PCompositorParent* aParent = nullptr) + explicit Compositor(PCompositorParent* aParent = nullptr) : mCompositorID(0) , mDiagnosticTypes(DiagnosticTypes::NO_DIAGNOSTIC) , mParent(aParent) diff --git a/gfx/layers/Effects.h b/gfx/layers/Effects.h index e52ecdc41f1b..24272b18be74 100644 --- a/gfx/layers/Effects.h +++ b/gfx/layers/Effects.h @@ -42,7 +42,7 @@ struct Effect { NS_INLINE_DECL_REFCOUNTING(Effect) - Effect(EffectTypes aType) : mType(aType) {} + explicit Effect(EffectTypes aType) : mType(aType) {} EffectTypes mType; @@ -98,7 +98,7 @@ struct EffectMask : public Effect struct EffectBlendMode : public Effect { - EffectBlendMode(gfx::CompositionOp aBlendMode) + explicit EffectBlendMode(gfx::CompositionOp aBlendMode) : Effect(EffectTypes::BLEND_MODE) , mBlendMode(aBlendMode) { } @@ -112,7 +112,7 @@ struct EffectBlendMode : public Effect // Render to a render target rather than the screen. struct EffectRenderTarget : public TexturedEffect { - EffectRenderTarget(CompositingRenderTarget *aRenderTarget) + explicit EffectRenderTarget(CompositingRenderTarget *aRenderTarget) : TexturedEffect(EffectTypes::RENDER_TARGET, aRenderTarget, true, gfx::Filter::LINEAR) , mRenderTarget(aRenderTarget) {} @@ -183,7 +183,7 @@ struct EffectComponentAlpha : public TexturedEffect struct EffectSolidColor : public Effect { - EffectSolidColor(const gfx::Color &aColor) + explicit EffectSolidColor(const gfx::Color &aColor) : Effect(EffectTypes::SOLID_COLOR) , mColor(aColor) {} diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 0be6b5b0c2f5..53f97c8ebd95 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -57,7 +57,7 @@ public: */ class SurfaceReleaser : public nsRunnable { public: - SurfaceReleaser(RawRef aRef) : mRef(aRef) {} + explicit SurfaceReleaser(RawRef aRef) : mRef(aRef) {} NS_IMETHOD Run() { mRef->Release(); return NS_OK; @@ -350,7 +350,7 @@ public: enum { DISABLE_ASYNC = 0x0, ENABLE_ASYNC = 0x01 }; - ImageContainer(int flag = 0); + explicit ImageContainer(int flag = 0); /** * Create an Image in one of the given formats. @@ -666,7 +666,7 @@ private: class AutoLockImage { public: - AutoLockImage(ImageContainer *aContainer) : mContainer(aContainer) { mImage = mContainer->LockCurrentImage(); } + explicit AutoLockImage(ImageContainer *aContainer) : mContainer(aContainer) { mImage = mContainer->LockCurrentImage(); } AutoLockImage(ImageContainer *aContainer, RefPtr *aSurface) : mContainer(aContainer) { *aSurface = mContainer->LockCurrentAsSourceSurface(&mSize, getter_AddRefs(mImage)); } @@ -821,7 +821,7 @@ public: virtual gfx::IntSize GetSize() { return mSize; } - PlanarYCbCrImage(BufferRecycleBin *aRecycleBin); + explicit PlanarYCbCrImage(BufferRecycleBin *aRecycleBin); virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; } diff --git a/gfx/layers/LayerScope.cpp b/gfx/layers/LayerScope.cpp index 461188e6930d..649dbbdf702e 100644 --- a/gfx/layers/LayerScope.cpp +++ b/gfx/layers/LayerScope.cpp @@ -366,7 +366,7 @@ StaticAutoPtr WebSocketHelper::sWebSocketManager; */ class DebugGLData: public LinkedListElement { public: - DebugGLData(Packet::DataType aDataType) + explicit DebugGLData(Packet::DataType aDataType) : mDataType(aDataType) { } @@ -399,7 +399,7 @@ public: mFrameStamp(aValue) { } - DebugGLFrameStatusData(Packet::DataType aDataType) + explicit DebugGLFrameStatusData(Packet::DataType aDataType) : DebugGLData(aDataType), mFrameStamp(0) { } @@ -547,7 +547,7 @@ protected: class DebugGLLayersData : public DebugGLData { public: - DebugGLLayersData(UniquePtr aPacket) + explicit DebugGLLayersData(UniquePtr aPacket) : DebugGLData(Packet::LAYERS), mPacket(Move(aPacket)) { } diff --git a/gfx/layers/LayerScope.h b/gfx/layers/LayerScope.h index 75af91851525..420370ab714c 100644 --- a/gfx/layers/LayerScope.h +++ b/gfx/layers/LayerScope.h @@ -41,7 +41,7 @@ public: // Perform BeginFrame and EndFrame automatically class LayerScopeAutoFrame { public: - LayerScopeAutoFrame(int64_t aFrameStamp); + explicit LayerScopeAutoFrame(int64_t aFrameStamp); ~LayerScopeAutoFrame(); private: diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index d2bba6b3db30..f5b676a1745f 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -98,7 +98,7 @@ NotifySubdocumentInvalidationRecursive(Layer* aLayer, NotifySubDocInvalidationFu struct LayerPropertiesBase : public LayerProperties { - LayerPropertiesBase(Layer* aLayer) + explicit LayerPropertiesBase(Layer* aLayer) : mLayer(aLayer) , mMaskLayer(nullptr) , mVisibleRegion(aLayer->GetVisibleRegion()) @@ -212,7 +212,7 @@ struct LayerPropertiesBase : public LayerProperties struct ContainerLayerProperties : public LayerPropertiesBase { - ContainerLayerProperties(ContainerLayer* aLayer) + explicit ContainerLayerProperties(ContainerLayer* aLayer) : LayerPropertiesBase(aLayer) , mPreXScale(aLayer->GetPreXScale()) , mPreYScale(aLayer->GetPreYScale()) @@ -322,7 +322,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase struct ColorLayerProperties : public LayerPropertiesBase { - ColorLayerProperties(ColorLayer *aLayer) + explicit ColorLayerProperties(ColorLayer *aLayer) : LayerPropertiesBase(aLayer) , mColor(aLayer->GetColor()) { } @@ -345,7 +345,7 @@ struct ColorLayerProperties : public LayerPropertiesBase struct ImageLayerProperties : public LayerPropertiesBase { - ImageLayerProperties(ImageLayer* aImage) + explicit ImageLayerProperties(ImageLayer* aImage) : LayerPropertiesBase(aImage) , mContainer(aImage->GetContainer()) , mFilter(aImage->GetFilter()) diff --git a/gfx/layers/RotatedBuffer.h b/gfx/layers/RotatedBuffer.h index 0c7c4ba9ade2..c2e098ee6bd2 100644 --- a/gfx/layers/RotatedBuffer.h +++ b/gfx/layers/RotatedBuffer.h @@ -190,7 +190,7 @@ public: ContainsVisibleBounds }; - RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy) + explicit RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy) : mBufferProvider(nullptr) , mBufferProviderOnWhite(nullptr) , mBufferSizePolicy(aBufferSizePolicy) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 38011932c949..1af97417d311 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -646,7 +646,7 @@ private: class OverscrollSnapBackAnimation: public AsyncPanZoomAnimation { public: - OverscrollSnapBackAnimation(AsyncPanZoomController& aApzc) + explicit OverscrollSnapBackAnimation(AsyncPanZoomController& aApzc) : mApzc(aApzc) { // Make sure the initial velocity is zero. This is normally the case diff --git a/gfx/layers/apz/src/AsyncPanZoomController.h b/gfx/layers/apz/src/AsyncPanZoomController.h index a8d578a14ebf..3bc6eb857482 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.h +++ b/gfx/layers/apz/src/AsyncPanZoomController.h @@ -1074,8 +1074,8 @@ class AsyncPanZoomAnimation { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AsyncPanZoomAnimation) public: - AsyncPanZoomAnimation(const TimeDuration& aRepaintInterval = - TimeDuration::Forever()) + explicit AsyncPanZoomAnimation(const TimeDuration& aRepaintInterval = + TimeDuration::Forever()) : mRepaintInterval(aRepaintInterval) { } diff --git a/gfx/layers/apz/src/Axis.h b/gfx/layers/apz/src/Axis.h index 1aa37e0410c9..d365f754b3a2 100644 --- a/gfx/layers/apz/src/Axis.h +++ b/gfx/layers/apz/src/Axis.h @@ -35,7 +35,7 @@ class AsyncPanZoomController; */ class Axis { public: - Axis(AsyncPanZoomController* aAsyncPanZoomController); + explicit Axis(AsyncPanZoomController* aAsyncPanZoomController); enum Overscroll { // Overscroll is not happening at all. @@ -246,7 +246,7 @@ protected: class AxisX : public Axis { public: - AxisX(AsyncPanZoomController* mAsyncPanZoomController); + explicit AxisX(AsyncPanZoomController* mAsyncPanZoomController); virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const; virtual CSSCoord GetRectLength(const CSSRect& aRect) const; virtual CSSCoord GetRectOffset(const CSSRect& aRect) const; @@ -254,7 +254,7 @@ public: class AxisY : public Axis { public: - AxisY(AsyncPanZoomController* mAsyncPanZoomController); + explicit AxisY(AsyncPanZoomController* mAsyncPanZoomController); virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const; virtual CSSCoord GetRectLength(const CSSRect& aRect) const; virtual CSSCoord GetRectOffset(const CSSRect& aRect) const; diff --git a/gfx/layers/apz/src/GestureEventListener.h b/gfx/layers/apz/src/GestureEventListener.h index 5a12417eca67..fc5e31049994 100644 --- a/gfx/layers/apz/src/GestureEventListener.h +++ b/gfx/layers/apz/src/GestureEventListener.h @@ -40,7 +40,7 @@ class GestureEventListener MOZ_FINAL { public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GestureEventListener) - GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController); + explicit GestureEventListener(AsyncPanZoomController* aAsyncPanZoomController); // -------------------------------------------------------------------------- // These methods must only be called on the controller/UI thread. diff --git a/gfx/layers/basic/BasicCanvasLayer.h b/gfx/layers/basic/BasicCanvasLayer.h index d3fb3a7ce187..f76e593912bf 100644 --- a/gfx/layers/basic/BasicCanvasLayer.h +++ b/gfx/layers/basic/BasicCanvasLayer.h @@ -22,7 +22,7 @@ class BasicCanvasLayer : public CopyableCanvasLayer, public BasicImplData { public: - BasicCanvasLayer(BasicLayerManager* aLayerManager) : + explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) : CopyableCanvasLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { } diff --git a/gfx/layers/basic/BasicColorLayer.cpp b/gfx/layers/basic/BasicColorLayer.cpp index d5633efd717d..bcca4656a712 100644 --- a/gfx/layers/basic/BasicColorLayer.cpp +++ b/gfx/layers/basic/BasicColorLayer.cpp @@ -26,7 +26,7 @@ namespace layers { class BasicColorLayer : public ColorLayer, public BasicImplData { public: - BasicColorLayer(BasicLayerManager* aLayerManager) : + explicit BasicColorLayer(BasicLayerManager* aLayerManager) : ColorLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { diff --git a/gfx/layers/basic/BasicCompositor.h b/gfx/layers/basic/BasicCompositor.h index 0c0c5ef25342..f09192ee0294 100644 --- a/gfx/layers/basic/BasicCompositor.h +++ b/gfx/layers/basic/BasicCompositor.h @@ -40,7 +40,7 @@ public: class BasicCompositor : public Compositor { public: - BasicCompositor(nsIWidget *aWidget); + explicit BasicCompositor(nsIWidget *aWidget); protected: virtual ~BasicCompositor(); diff --git a/gfx/layers/basic/BasicContainerLayer.h b/gfx/layers/basic/BasicContainerLayer.h index f18d635dc363..7cc2f6dbcab8 100644 --- a/gfx/layers/basic/BasicContainerLayer.h +++ b/gfx/layers/basic/BasicContainerLayer.h @@ -19,7 +19,7 @@ namespace layers { class BasicContainerLayer : public ContainerLayer, public BasicImplData { public: - BasicContainerLayer(BasicLayerManager* aManager) : + explicit BasicContainerLayer(BasicLayerManager* aManager) : ContainerLayer(aManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { diff --git a/gfx/layers/basic/BasicImageLayer.cpp b/gfx/layers/basic/BasicImageLayer.cpp index 32220b35a105..8f027f88fb8f 100644 --- a/gfx/layers/basic/BasicImageLayer.cpp +++ b/gfx/layers/basic/BasicImageLayer.cpp @@ -25,7 +25,7 @@ namespace layers { class BasicImageLayer : public ImageLayer, public BasicImplData { public: - BasicImageLayer(BasicLayerManager* aLayerManager) : + explicit BasicImageLayer(BasicLayerManager* aLayerManager) : ImageLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())), mSize(-1, -1) diff --git a/gfx/layers/basic/BasicLayers.h b/gfx/layers/basic/BasicLayers.h index d95f93fb6fd0..215c8279580d 100644 --- a/gfx/layers/basic/BasicLayers.h +++ b/gfx/layers/basic/BasicLayers.h @@ -56,7 +56,7 @@ public: * must be called for any rendering to happen. ThebesLayers will not * be retained. */ - BasicLayerManager(BasicLayerManagerType aType); + explicit BasicLayerManager(BasicLayerManagerType aType); /** * Construct a BasicLayerManager which will have no default * target context. SetDefaultTarget or BeginTransactionWithTarget @@ -72,7 +72,7 @@ public: * must ensure that the widget outlives the layer manager or call * ClearWidget before the widget dies. */ - BasicLayerManager(nsIWidget* aWidget); + explicit BasicLayerManager(nsIWidget* aWidget); protected: virtual ~BasicLayerManager(); diff --git a/gfx/layers/basic/BasicLayersImpl.h b/gfx/layers/basic/BasicLayersImpl.h index 2fba7224f738..7a5926b4475e 100644 --- a/gfx/layers/basic/BasicLayersImpl.h +++ b/gfx/layers/basic/BasicLayersImpl.h @@ -49,7 +49,7 @@ class BasicReadbackLayer : public ReadbackLayer, public BasicImplData { public: - BasicReadbackLayer(BasicLayerManager* aLayerManager) : + explicit BasicReadbackLayer(BasicLayerManager* aLayerManager) : ReadbackLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { diff --git a/gfx/layers/basic/BasicThebesLayer.h b/gfx/layers/basic/BasicThebesLayer.h index 0a2b0a0b85ec..ffbbe8259b27 100644 --- a/gfx/layers/basic/BasicThebesLayer.h +++ b/gfx/layers/basic/BasicThebesLayer.h @@ -30,7 +30,7 @@ public: typedef RotatedContentBuffer::PaintState PaintState; typedef RotatedContentBuffer::ContentType ContentType; - BasicThebesLayer(BasicLayerManager* aLayerManager) : + explicit BasicThebesLayer(BasicLayerManager* aLayerManager) : ThebesLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())), mContentClient(nullptr) diff --git a/gfx/layers/client/ClientCanvasLayer.h b/gfx/layers/client/ClientCanvasLayer.h index 591319f4bce0..b9de0fce0da7 100644 --- a/gfx/layers/client/ClientCanvasLayer.h +++ b/gfx/layers/client/ClientCanvasLayer.h @@ -36,7 +36,7 @@ class ClientCanvasLayer : public CopyableCanvasLayer, { typedef CanvasClient::CanvasClientType CanvasClientType; public: - ClientCanvasLayer(ClientLayerManager* aLayerManager) : + explicit ClientCanvasLayer(ClientLayerManager* aLayerManager) : CopyableCanvasLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) , mTextureSurface(nullptr) diff --git a/gfx/layers/client/ClientColorLayer.cpp b/gfx/layers/client/ClientColorLayer.cpp index 1b49c07f2129..29038de37e7f 100644 --- a/gfx/layers/client/ClientColorLayer.cpp +++ b/gfx/layers/client/ClientColorLayer.cpp @@ -21,7 +21,7 @@ using namespace mozilla::gfx; class ClientColorLayer : public ColorLayer, public ClientLayer { public: - ClientColorLayer(ClientLayerManager* aLayerManager) : + explicit ClientColorLayer(ClientLayerManager* aLayerManager) : ColorLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { diff --git a/gfx/layers/client/ClientContainerLayer.h b/gfx/layers/client/ClientContainerLayer.h index 23329689c0a2..f82e65f166b6 100644 --- a/gfx/layers/client/ClientContainerLayer.h +++ b/gfx/layers/client/ClientContainerLayer.h @@ -27,7 +27,7 @@ class ClientContainerLayer : public ContainerLayer, public ClientLayer { public: - ClientContainerLayer(ClientLayerManager* aManager) : + explicit ClientContainerLayer(ClientLayerManager* aManager) : ContainerLayer(aManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { @@ -150,7 +150,7 @@ protected: class ClientRefLayer : public RefLayer, public ClientLayer { public: - ClientRefLayer(ClientLayerManager* aManager) : + explicit ClientRefLayer(ClientLayerManager* aManager) : RefLayer(aManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) { diff --git a/gfx/layers/client/ClientImageLayer.cpp b/gfx/layers/client/ClientImageLayer.cpp index e016ba521134..2d348d7d3691 100644 --- a/gfx/layers/client/ClientImageLayer.cpp +++ b/gfx/layers/client/ClientImageLayer.cpp @@ -26,7 +26,7 @@ using namespace mozilla::gfx; class ClientImageLayer : public ImageLayer, public ClientLayer { public: - ClientImageLayer(ClientLayerManager* aLayerManager) + explicit ClientImageLayer(ClientLayerManager* aLayerManager) : ImageLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST())) , mImageClientTypeContainer(CompositableType::BUFFER_UNKNOWN) diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index f5dd326738ae..dfdfa39724f9 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -43,7 +43,7 @@ class ClientLayerManager : public LayerManager typedef nsTArray > LayerRefArray; public: - ClientLayerManager(nsIWidget* aWidget); + explicit ClientLayerManager(nsIWidget* aWidget); protected: virtual ~ClientLayerManager(); diff --git a/gfx/layers/client/ClientReadbackLayer.h b/gfx/layers/client/ClientReadbackLayer.h index f3046fea8115..89e673306088 100644 --- a/gfx/layers/client/ClientReadbackLayer.h +++ b/gfx/layers/client/ClientReadbackLayer.h @@ -17,7 +17,7 @@ class ClientReadbackLayer : public ClientLayer { public: - ClientReadbackLayer(ClientLayerManager *aManager) + explicit ClientReadbackLayer(ClientLayerManager *aManager) : ReadbackLayer(aManager, nullptr) { mImplData = static_cast(this); diff --git a/gfx/layers/client/ClientThebesLayer.h b/gfx/layers/client/ClientThebesLayer.h index b5864ef448f4..01b7513973d7 100644 --- a/gfx/layers/client/ClientThebesLayer.h +++ b/gfx/layers/client/ClientThebesLayer.h @@ -33,8 +33,8 @@ public: typedef RotatedContentBuffer::PaintState PaintState; typedef RotatedContentBuffer::ContentType ContentType; - ClientThebesLayer(ClientLayerManager* aLayerManager, - LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) : + explicit ClientThebesLayer(ClientLayerManager* aLayerManager, + LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) : ThebesLayer(aLayerManager, static_cast(MOZ_THIS_IN_INITIALIZER_LIST()), aCreationHint), diff --git a/gfx/layers/client/ClientTiledThebesLayer.h b/gfx/layers/client/ClientTiledThebesLayer.h index da3fe6a75913..f4539ee3fc49 100644 --- a/gfx/layers/client/ClientTiledThebesLayer.h +++ b/gfx/layers/client/ClientTiledThebesLayer.h @@ -41,8 +41,8 @@ class ClientTiledThebesLayer : public ThebesLayer, typedef ThebesLayer Base; public: - ClientTiledThebesLayer(ClientLayerManager* const aManager, - ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE); + explicit ClientTiledThebesLayer(ClientLayerManager* const aManager, + ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE); protected: ~ClientTiledThebesLayer(); diff --git a/gfx/layers/client/CompositableClient.h b/gfx/layers/client/CompositableClient.h index 63293c88f66e..9efa601865ef 100644 --- a/gfx/layers/client/CompositableClient.h +++ b/gfx/layers/client/CompositableClient.h @@ -123,7 +123,7 @@ protected: public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositableClient) - CompositableClient(CompositableForwarder* aForwarder, TextureFlags aFlags = TextureFlags::NO_FLAGS); + explicit CompositableClient(CompositableForwarder* aForwarder, TextureFlags aFlags = TextureFlags::NO_FLAGS); virtual TextureInfo GetTextureInfo() const = 0; @@ -246,8 +246,8 @@ protected: */ struct AutoRemoveTexture { - AutoRemoveTexture(CompositableClient* aCompositable, - TextureClient* aTexture = nullptr) + explicit AutoRemoveTexture(CompositableClient* aCompositable, + TextureClient* aTexture = nullptr) : mTexture(aTexture) , mCompositable(aCompositable) {} diff --git a/gfx/layers/client/ContentClient.h b/gfx/layers/client/ContentClient.h index a31a3eaea474..0fd083c15190 100644 --- a/gfx/layers/client/ContentClient.h +++ b/gfx/layers/client/ContentClient.h @@ -83,7 +83,7 @@ public: */ static TemporaryRef CreateContentClient(CompositableForwarder* aFwd); - ContentClient(CompositableForwarder* aForwarder) + explicit ContentClient(CompositableForwarder* aForwarder) : CompositableClient(aForwarder) {} virtual ~ContentClient() @@ -113,7 +113,7 @@ public: class ContentClientRemote : public ContentClient { public: - ContentClientRemote(CompositableForwarder* aForwarder) + explicit ContentClientRemote(CompositableForwarder* aForwarder) : ContentClient(aForwarder) {} @@ -190,7 +190,7 @@ class ContentClientRemoteBuffer : public ContentClientRemote using RotatedContentBuffer::BufferRect; using RotatedContentBuffer::BufferRotation; public: - ContentClientRemoteBuffer(CompositableForwarder* aForwarder) + explicit ContentClientRemoteBuffer(CompositableForwarder* aForwarder) : ContentClientRemote(aForwarder) , RotatedContentBuffer(ContainsVisibleBounds) , mIsNewBuffer(false) @@ -315,7 +315,7 @@ protected: class ContentClientDoubleBuffered : public ContentClientRemoteBuffer { public: - ContentClientDoubleBuffered(CompositableForwarder* aFwd) + explicit ContentClientDoubleBuffered(CompositableForwarder* aFwd) : ContentClientRemoteBuffer(aFwd) { mTextureInfo.mCompositableType = CompositableType::CONTENT_DOUBLE; @@ -374,7 +374,7 @@ private: class ContentClientSingleBuffered : public ContentClientRemoteBuffer { public: - ContentClientSingleBuffered(CompositableForwarder* aFwd) + explicit ContentClientSingleBuffered(CompositableForwarder* aFwd) : ContentClientRemoteBuffer(aFwd) { mTextureInfo.mCompositableType = CompositableType::CONTENT_SINGLE; @@ -394,7 +394,7 @@ class ContentClientIncremental : public ContentClientRemote , public BorrowDrawTarget { public: - ContentClientIncremental(CompositableForwarder* aFwd) + explicit ContentClientIncremental(CompositableForwarder* aFwd) : ContentClientRemote(aFwd) , mContentType(gfxContentType::COLOR_ALPHA) , mHasBuffer(false) diff --git a/gfx/layers/client/SimpleTiledContentClient.h b/gfx/layers/client/SimpleTiledContentClient.h index 0eea5458199d..31d43d9f68f9 100644 --- a/gfx/layers/client/SimpleTiledContentClient.h +++ b/gfx/layers/client/SimpleTiledContentClient.h @@ -163,8 +163,8 @@ class SimpleClientTiledThebesLayer : public ThebesLayer, typedef ThebesLayer Base; public: - SimpleClientTiledThebesLayer(ClientLayerManager* const aManager, - ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE); + explicit SimpleClientTiledThebesLayer(ClientLayerManager* const aManager, + ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE); protected: ~SimpleClientTiledThebesLayer(); diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index f87152d57782..5c344caea826 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -137,7 +137,7 @@ class TextureClient : public AtomicRefCountedWithFinalize { public: - TextureClient(TextureFlags aFlags = TextureFlags::DEFAULT); + explicit TextureClient(TextureFlags aFlags = TextureFlags::DEFAULT); virtual ~TextureClient(); // Creates and allocates a TextureClient usable with Moz2D. @@ -465,7 +465,7 @@ protected: class TextureClientReleaseTask : public Task { public: - TextureClientReleaseTask(TextureClient* aClient) + explicit TextureClientReleaseTask(TextureClient* aClient) : mTextureClient(aClient) { } @@ -620,7 +620,7 @@ protected: class StreamTextureClient : public TextureClient { public: - StreamTextureClient(TextureFlags aFlags); + explicit StreamTextureClient(TextureFlags aFlags); protected: ~StreamTextureClient(); @@ -669,7 +669,7 @@ struct TextureClientAutoUnlock { TextureClient* mTexture; - TextureClientAutoUnlock(TextureClient* aTexture) + explicit TextureClientAutoUnlock(TextureClient* aTexture) : mTexture(aTexture) {} ~TextureClientAutoUnlock() @@ -688,7 +688,7 @@ template class TKeepAlive : public KeepAlive { public: - TKeepAlive(T* aData) : mData(aData) {} + explicit TKeepAlive(T* aData) : mData(aData) {} protected: RefPtr mData; }; diff --git a/gfx/layers/client/TiledContentClient.h b/gfx/layers/client/TiledContentClient.h index cf62128274a5..dba6a3836ced 100644 --- a/gfx/layers/client/TiledContentClient.h +++ b/gfx/layers/client/TiledContentClient.h @@ -97,7 +97,7 @@ private: }; public: - gfxShmSharedReadLock(ISurfaceAllocator* aAllocator); + explicit gfxShmSharedReadLock(ISurfaceAllocator* aAllocator); protected: ~gfxShmSharedReadLock(); diff --git a/gfx/layers/composite/AsyncCompositionManager.h b/gfx/layers/composite/AsyncCompositionManager.h index 1253badfb8e4..17af6acf27c6 100644 --- a/gfx/layers/composite/AsyncCompositionManager.h +++ b/gfx/layers/composite/AsyncCompositionManager.h @@ -28,8 +28,8 @@ class AutoResolveRefLayers; // Represents (affine) transforms that are calculated from a content view. struct ViewTransform { - ViewTransform(ParentLayerToScreenScale aScale = ParentLayerToScreenScale(), - ScreenPoint aTranslation = ScreenPoint()) + explicit ViewTransform(ParentLayerToScreenScale aScale = ParentLayerToScreenScale(), + ScreenPoint aTranslation = ScreenPoint()) : mScale(aScale) , mTranslation(aTranslation) {} @@ -76,7 +76,7 @@ class AsyncCompositionManager MOZ_FINAL public: NS_INLINE_DECL_REFCOUNTING(AsyncCompositionManager) - AsyncCompositionManager(LayerManagerComposite* aManager) + explicit AsyncCompositionManager(LayerManagerComposite* aManager) : mLayerManager(aManager) , mIsFirstPaint(false) , mLayersUpdated(false) @@ -207,7 +207,7 @@ private: class MOZ_STACK_CLASS AutoResolveRefLayers { public: - AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager) + explicit AutoResolveRefLayers(AsyncCompositionManager* aManager) : mManager(aManager) { if (mManager) { mManager->ResolveRefLayers(); diff --git a/gfx/layers/composite/CanvasLayerComposite.h b/gfx/layers/composite/CanvasLayerComposite.h index 70f54fa223d4..6051d974ae1f 100644 --- a/gfx/layers/composite/CanvasLayerComposite.h +++ b/gfx/layers/composite/CanvasLayerComposite.h @@ -28,7 +28,7 @@ class CanvasLayerComposite : public CanvasLayer, public LayerComposite { public: - CanvasLayerComposite(LayerManagerComposite* aManager); + explicit CanvasLayerComposite(LayerManagerComposite* aManager); protected: virtual ~CanvasLayerComposite(); diff --git a/gfx/layers/composite/ColorLayerComposite.h b/gfx/layers/composite/ColorLayerComposite.h index 31ec0459d709..8414e8a30363 100644 --- a/gfx/layers/composite/ColorLayerComposite.h +++ b/gfx/layers/composite/ColorLayerComposite.h @@ -23,7 +23,7 @@ class ColorLayerComposite : public ColorLayer, public LayerComposite { public: - ColorLayerComposite(LayerManagerComposite *aManager) + explicit ColorLayerComposite(LayerManagerComposite *aManager) : ColorLayer(aManager, nullptr) , LayerComposite(aManager) { diff --git a/gfx/layers/composite/CompositableHost.h b/gfx/layers/composite/CompositableHost.h index 33a2f4b16efe..f4613c3b0c38 100644 --- a/gfx/layers/composite/CompositableHost.h +++ b/gfx/layers/composite/CompositableHost.h @@ -88,7 +88,7 @@ protected: public: NS_INLINE_DECL_REFCOUNTING(CompositableHost) - CompositableHost(const TextureInfo& aTextureInfo); + explicit CompositableHost(const TextureInfo& aTextureInfo); static TemporaryRef Create(const TextureInfo& aTextureInfo); @@ -304,7 +304,7 @@ protected: class AutoLockCompositableHost MOZ_FINAL { public: - AutoLockCompositableHost(CompositableHost* aHost) + explicit AutoLockCompositableHost(CompositableHost* aHost) : mHost(aHost) { mSucceeded = mHost->Lock(); diff --git a/gfx/layers/composite/ContainerLayerComposite.h b/gfx/layers/composite/ContainerLayerComposite.h index c3cbc594f301..15518617de35 100644 --- a/gfx/layers/composite/ContainerLayerComposite.h +++ b/gfx/layers/composite/ContainerLayerComposite.h @@ -53,7 +53,7 @@ class ContainerLayerComposite : public ContainerLayer, const nsIntRect& aClipRect); public: - ContainerLayerComposite(LayerManagerComposite *aManager); + explicit ContainerLayerComposite(LayerManagerComposite *aManager); protected: ~ContainerLayerComposite(); @@ -117,7 +117,7 @@ class RefLayerComposite : public RefLayer, const nsIntRect& aClipRect); public: - RefLayerComposite(LayerManagerComposite *aManager); + explicit RefLayerComposite(LayerManagerComposite *aManager); protected: ~RefLayerComposite(); diff --git a/gfx/layers/composite/ContentHost.h b/gfx/layers/composite/ContentHost.h index e5aa7156aa9d..8270e79d18f1 100644 --- a/gfx/layers/composite/ContentHost.h +++ b/gfx/layers/composite/ContentHost.h @@ -68,7 +68,7 @@ public: bool PaintWillResample() { return mPaintWillResample; } protected: - ContentHost(const TextureInfo& aTextureInfo) + explicit ContentHost(const TextureInfo& aTextureInfo) : CompositableHost(aTextureInfo) , mPaintWillResample(false) {} @@ -93,7 +93,7 @@ public: typedef RotatedContentBuffer::ContentType ContentType; typedef RotatedContentBuffer::PaintState PaintState; - ContentHostBase(const TextureInfo& aTextureInfo); + explicit ContentHostBase(const TextureInfo& aTextureInfo); virtual ~ContentHostBase(); virtual void Composite(EffectChain& aEffectChain, @@ -127,7 +127,7 @@ protected: class ContentHostTexture : public ContentHostBase { public: - ContentHostTexture(const TextureInfo& aTextureInfo) + explicit ContentHostTexture(const TextureInfo& aTextureInfo) : ContentHostBase(aTextureInfo) , mLocked(false) { } @@ -201,7 +201,7 @@ protected: class ContentHostDoubleBuffered : public ContentHostTexture { public: - ContentHostDoubleBuffered(const TextureInfo& aTextureInfo) + explicit ContentHostDoubleBuffered(const TextureInfo& aTextureInfo) : ContentHostTexture(aTextureInfo) {} @@ -225,7 +225,7 @@ protected: class ContentHostSingleBuffered : public ContentHostTexture { public: - ContentHostSingleBuffered(const TextureInfo& aTextureInfo) + explicit ContentHostSingleBuffered(const TextureInfo& aTextureInfo) : ContentHostTexture(aTextureInfo) {} virtual ~ContentHostSingleBuffered() {} @@ -251,7 +251,7 @@ public: class ContentHostIncremental : public ContentHostBase { public: - ContentHostIncremental(const TextureInfo& aTextureInfo); + explicit ContentHostIncremental(const TextureInfo& aTextureInfo); ~ContentHostIncremental(); virtual CompositableType GetType() { return CompositableType::BUFFER_CONTENT_INC; } diff --git a/gfx/layers/composite/FPSCounter.h b/gfx/layers/composite/FPSCounter.h index e07b9d6df821..2a493d3e4f01 100644 --- a/gfx/layers/composite/FPSCounter.h +++ b/gfx/layers/composite/FPSCounter.h @@ -58,7 +58,7 @@ const int kMaxFrames = 2400; */ class FPSCounter { public: - FPSCounter(const char* aName); + explicit FPSCounter(const char* aName); ~FPSCounter(); void AddFrame(TimeStamp aTimestamp); diff --git a/gfx/layers/composite/ImageHost.h b/gfx/layers/composite/ImageHost.h index bae8ed772072..79f249b7a90f 100644 --- a/gfx/layers/composite/ImageHost.h +++ b/gfx/layers/composite/ImageHost.h @@ -40,7 +40,7 @@ struct EffectChain; class ImageHost : public CompositableHost { public: - ImageHost(const TextureInfo& aTextureInfo); + explicit ImageHost(const TextureInfo& aTextureInfo); ~ImageHost(); virtual CompositableType GetType() { return mTextureInfo.mCompositableType; } diff --git a/gfx/layers/composite/ImageLayerComposite.h b/gfx/layers/composite/ImageLayerComposite.h index 50dd30a12b31..faded30bbac2 100644 --- a/gfx/layers/composite/ImageLayerComposite.h +++ b/gfx/layers/composite/ImageLayerComposite.h @@ -31,7 +31,7 @@ class ImageLayerComposite : public ImageLayer, typedef gl::TextureImage TextureImage; public: - ImageLayerComposite(LayerManagerComposite* aManager); + explicit ImageLayerComposite(LayerManagerComposite* aManager); protected: virtual ~ImageLayerComposite(); diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index b7589c635984..901c8bf6fdda 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -73,7 +73,7 @@ class LayerManagerComposite : public LayerManager typedef mozilla::gfx::SurfaceFormat SurfaceFormat; public: - LayerManagerComposite(Compositor* aCompositor); + explicit LayerManagerComposite(Compositor* aCompositor); ~LayerManagerComposite(); virtual void Destroy() MOZ_OVERRIDE; @@ -315,7 +315,7 @@ private: class LayerComposite { public: - LayerComposite(LayerManagerComposite* aManager); + explicit LayerComposite(LayerManagerComposite* aManager); virtual ~LayerComposite(); diff --git a/gfx/layers/composite/TextRenderer.h b/gfx/layers/composite/TextRenderer.h index 97031c9ecfb1..30cb22cfccfa 100644 --- a/gfx/layers/composite/TextRenderer.h +++ b/gfx/layers/composite/TextRenderer.h @@ -22,7 +22,7 @@ class TextRenderer public: NS_INLINE_DECL_REFCOUNTING(TextRenderer) - TextRenderer(Compositor *aCompositor) + explicit TextRenderer(Compositor *aCompositor) : mCompositor(aCompositor) { } diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index ed22f1fa7dab..a0b2044f5770 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -71,7 +71,7 @@ namespace layers { class TextureParent : public PTextureParent { public: - TextureParent(CompositableParentManager* aManager); + explicit TextureParent(CompositableParentManager* aManager); ~TextureParent(); diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index e22f0b2963c8..4cb8455fc7b8 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -286,7 +286,7 @@ class TextureHost friend class AtomicRefCountedWithFinalize; public: - TextureHost(TextureFlags aFlags); + explicit TextureHost(TextureFlags aFlags); protected: virtual ~TextureHost(); @@ -652,7 +652,7 @@ protected: class MOZ_STACK_CLASS AutoLockTextureHost { public: - AutoLockTextureHost(TextureHost* aTexture) + explicit AutoLockTextureHost(TextureHost* aTexture) : mTexture(aTexture) { mLocked = mTexture ? mTexture->Lock() : false; @@ -679,7 +679,7 @@ private: class CompositingRenderTarget : public TextureSource { public: - CompositingRenderTarget(const gfx::IntPoint& aOrigin) + explicit CompositingRenderTarget(const gfx::IntPoint& aOrigin) : mOrigin(aOrigin) {} virtual ~CompositingRenderTarget() {} diff --git a/gfx/layers/composite/ThebesLayerComposite.h b/gfx/layers/composite/ThebesLayerComposite.h index 0a09112cf82a..5d64fbc4c863 100644 --- a/gfx/layers/composite/ThebesLayerComposite.h +++ b/gfx/layers/composite/ThebesLayerComposite.h @@ -37,7 +37,7 @@ class ThebesLayerComposite : public ThebesLayer, public LayerComposite { public: - ThebesLayerComposite(LayerManagerComposite *aManager); + explicit ThebesLayerComposite(LayerManagerComposite *aManager); protected: virtual ~ThebesLayerComposite(); diff --git a/gfx/layers/composite/TiledContentHost.h b/gfx/layers/composite/TiledContentHost.h index 1c29651a4551..dfeb45070272 100644 --- a/gfx/layers/composite/TiledContentHost.h +++ b/gfx/layers/composite/TiledContentHost.h @@ -189,7 +189,7 @@ class TiledContentHost : public ContentHost, public TiledLayerComposer { public: - TiledContentHost(const TextureInfo& aTextureInfo); + explicit TiledContentHost(const TextureInfo& aTextureInfo); protected: ~TiledContentHost(); diff --git a/gfx/layers/ipc/AsyncTransactionTracker.h b/gfx/layers/ipc/AsyncTransactionTracker.h index 5fb6cd6eebd0..8ea40e58b7f1 100644 --- a/gfx/layers/ipc/AsyncTransactionTracker.h +++ b/gfx/layers/ipc/AsyncTransactionTracker.h @@ -190,7 +190,7 @@ protected: */ class FenceDeliveryTracker : public AsyncTransactionTracker { public: - FenceDeliveryTracker(FenceHandle& aFenceHandle) + explicit FenceDeliveryTracker(FenceHandle& aFenceHandle) : mFenceHandle(aFenceHandle) { MOZ_COUNT_CTOR(FenceDeliveryTracker); diff --git a/gfx/layers/ipc/CompositorChild.h b/gfx/layers/ipc/CompositorChild.h index 602d44bcbd61..e4d091caaa46 100644 --- a/gfx/layers/ipc/CompositorChild.h +++ b/gfx/layers/ipc/CompositorChild.h @@ -41,7 +41,7 @@ class CompositorChild MOZ_FINAL : public PCompositorChild NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorChild) public: - CompositorChild(ClientLayerManager *aLayerManager); + explicit CompositorChild(ClientLayerManager *aLayerManager); void Destroy(); diff --git a/gfx/layers/ipc/CompositorParent.h b/gfx/layers/ipc/CompositorParent.h index 5bbaa2d1dd95..2dc7e73efe40 100644 --- a/gfx/layers/ipc/CompositorParent.h +++ b/gfx/layers/ipc/CompositorParent.h @@ -93,9 +93,9 @@ class CompositorParent : public PCompositorParent, NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorParent) public: - CompositorParent(nsIWidget* aWidget, - bool aUseExternalSurfaceSize = false, - int aSurfaceWidth = -1, int aSurfaceHeight = -1); + explicit CompositorParent(nsIWidget* aWidget, + bool aUseExternalSurfaceSize = false, + int aSurfaceWidth = -1, int aSurfaceHeight = -1); // IToplevelProtocol::CloneToplevel() virtual IToplevelProtocol* diff --git a/gfx/layers/ipc/FenceUtils.h b/gfx/layers/ipc/FenceUtils.h index 63f58436ea58..82c2498aaf54 100644 --- a/gfx/layers/ipc/FenceUtils.h +++ b/gfx/layers/ipc/FenceUtils.h @@ -23,14 +23,14 @@ struct FenceHandleFromChild; struct FenceHandle { FenceHandle() {} - FenceHandle(const FenceHandleFromChild& aFenceHandle) {} + explicit FenceHandle(const FenceHandleFromChild& aFenceHandle) {} bool operator==(const FenceHandle&) const { return false; } bool IsValid() const { return false; } }; struct FenceHandleFromChild { FenceHandleFromChild() {} - FenceHandleFromChild(const FenceHandle& aFence) {} + explicit FenceHandleFromChild(const FenceHandle& aFence) {} bool operator==(const FenceHandle&) const { return false; } bool operator==(const FenceHandleFromChild&) const { return false; } bool IsValid() const { return false; } diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index a2172c537dba..85cc57696768 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -101,7 +101,7 @@ struct CompositableTransaction }; struct AutoEndTransaction { - AutoEndTransaction(CompositableTransaction* aTxn) : mTxn(aTxn) {} + explicit AutoEndTransaction(CompositableTransaction* aTxn) : mTxn(aTxn) {} ~AutoEndTransaction() { mTxn->End(); } CompositableTransaction* mTxn; }; @@ -464,7 +464,7 @@ ImageBridgeChild::BeginTransaction() class MOZ_STACK_CLASS AutoRemoveTextures { public: - AutoRemoveTextures(ImageBridgeChild* aImageBridge) + explicit AutoRemoveTextures(ImageBridgeChild* aImageBridge) : mImageBridge(aImageBridge) {} ~AutoRemoveTextures() diff --git a/gfx/layers/ipc/ShadowLayerChild.h b/gfx/layers/ipc/ShadowLayerChild.h index 71b36931ed57..ea7317a08d4e 100644 --- a/gfx/layers/ipc/ShadowLayerChild.h +++ b/gfx/layers/ipc/ShadowLayerChild.h @@ -20,7 +20,7 @@ class ShadowableLayer; class ShadowLayerChild : public PLayerChild { public: - ShadowLayerChild(ShadowableLayer* aLayer); + explicit ShadowLayerChild(ShadowableLayer* aLayer); virtual ~ShadowLayerChild(); ShadowableLayer* layer() const { return mLayer; } diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index c9a15a4287cc..166660f6eba8 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -154,7 +154,7 @@ private: Transaction& operator=(const Transaction&); }; struct AutoTxnEnd { - AutoTxnEnd(Transaction* aTxn) : mTxn(aTxn) {} + explicit AutoTxnEnd(Transaction* aTxn) : mTxn(aTxn) {} ~AutoTxnEnd() { mTxn->End(); } Transaction* mTxn; }; diff --git a/gfx/layers/ipc/SharedBufferManagerParent.cpp b/gfx/layers/ipc/SharedBufferManagerParent.cpp index d1a3e022be93..69c2e1a9a32b 100644 --- a/gfx/layers/ipc/SharedBufferManagerParent.cpp +++ b/gfx/layers/ipc/SharedBufferManagerParent.cpp @@ -108,7 +108,7 @@ void InitGralloc() { class DeleteSharedBufferManagerParentTask : public Task { public: - DeleteSharedBufferManagerParentTask(UniquePtr aSharedBufferManager) + explicit DeleteSharedBufferManagerParentTask(UniquePtr aSharedBufferManager) : mSharedBufferManager(Move(aSharedBufferManager)) { } virtual void Run() MOZ_OVERRIDE {} diff --git a/gfx/layers/ipc/SharedPlanarYCbCrImage.h b/gfx/layers/ipc/SharedPlanarYCbCrImage.h index 23f03a3a4147..483e40c1c586 100644 --- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h +++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h @@ -28,7 +28,7 @@ class SharedPlanarYCbCrImage : public PlanarYCbCrImage , public ISharedImage { public: - SharedPlanarYCbCrImage(ImageClient* aCompositable); + explicit SharedPlanarYCbCrImage(ImageClient* aCompositable); protected: ~SharedPlanarYCbCrImage(); diff --git a/gfx/layers/ipc/SharedRGBImage.h b/gfx/layers/ipc/SharedRGBImage.h index 69a919389220..e9aee420d375 100644 --- a/gfx/layers/ipc/SharedRGBImage.h +++ b/gfx/layers/ipc/SharedRGBImage.h @@ -40,7 +40,7 @@ class SharedRGBImage : public Image , public ISharedImage { public: - SharedRGBImage(ImageClient* aCompositable); + explicit SharedRGBImage(ImageClient* aCompositable); protected: ~SharedRGBImage(); diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index 4e959c06fa67..d858fa004533 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -85,7 +85,7 @@ public: class PerUnitTexturePoolOGL : public CompositorTexturePoolOGL { public: - PerUnitTexturePoolOGL(gl::GLContext* aGL) + explicit PerUnitTexturePoolOGL(gl::GLContext* aGL) : mTextureTarget(0) // zero is never a valid texture target , mGL(aGL) {} @@ -124,7 +124,7 @@ protected: class PerFrameTexturePoolOGL : public CompositorTexturePoolOGL { public: - PerFrameTexturePoolOGL(gl::GLContext* aGL) + explicit PerFrameTexturePoolOGL(gl::GLContext* aGL) : mTextureTarget(0) // zero is never a valid texture target , mGL(aGL) {} @@ -162,8 +162,8 @@ class CompositorOGL MOZ_FINAL : public Compositor std::map mPrograms; public: - CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1, - bool aUseExternalSurfaceSize = false); + explicit CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1, + bool aUseExternalSurfaceSize = false); protected: virtual ~CompositorOGL(); diff --git a/gfx/layers/opengl/GLManager.cpp b/gfx/layers/opengl/GLManager.cpp index 803aa4f18f5b..a1bd66af69b6 100644 --- a/gfx/layers/opengl/GLManager.cpp +++ b/gfx/layers/opengl/GLManager.cpp @@ -23,7 +23,7 @@ namespace layers { class GLManagerCompositor : public GLManager { public: - GLManagerCompositor(CompositorOGL* aCompositor) + explicit GLManagerCompositor(CompositorOGL* aCompositor) : mImpl(aCompositor) {} diff --git a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h index db838bd491c4..b7353464337a 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h +++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h @@ -16,7 +16,7 @@ namespace layers { class MacIOSurfaceTextureClientOGL : public TextureClient { public: - MacIOSurfaceTextureClientOGL(TextureFlags aFlags); + explicit MacIOSurfaceTextureClientOGL(TextureFlags aFlags); virtual ~MacIOSurfaceTextureClientOGL(); diff --git a/gfx/layers/opengl/TextureClientOGL.h b/gfx/layers/opengl/TextureClientOGL.h index f506854fea2c..97436ef52745 100644 --- a/gfx/layers/opengl/TextureClientOGL.h +++ b/gfx/layers/opengl/TextureClientOGL.h @@ -32,7 +32,7 @@ class CompositableForwarder; class SharedTextureClientOGL : public TextureClient { public: - SharedTextureClientOGL(TextureFlags aFlags); + explicit SharedTextureClientOGL(TextureFlags aFlags); ~SharedTextureClientOGL(); diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index b9398ee77727..afaaab398454 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -212,8 +212,8 @@ class TextureImageTextureSourceOGL : public DataTextureSource , public BigImageIterator { public: - TextureImageTextureSourceOGL(gl::GLContext* aGL, - TextureFlags aFlags = TextureFlags::DEFAULT) + explicit TextureImageTextureSourceOGL(gl::GLContext* aGL, + TextureFlags aFlags = TextureFlags::DEFAULT) : mGL(aGL) , mFlags(aFlags) , mIterating(false)