Bug 1109699 - Fix more bad implicit constructors in gfx and image; r=jrmuizel
--- a/gfx/2d/DrawTargetCG.h
+++ b/gfx/2d/DrawTargetCG.h
@@ -91,17 +91,17 @@ SetStrokeOptions(CGContextRef cg, const
}
}
class GlyphRenderingOptionsCG : public GlyphRenderingOptions
{
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GlyphRenderingOptionsCG)
- GlyphRenderingOptionsCG(const Color &aFontSmoothingBackgroundColor)
+ explicit GlyphRenderingOptionsCG(const Color &aFontSmoothingBackgroundColor)
: mFontSmoothingBackgroundColor(aFontSmoothingBackgroundColor)
{}
const Color &FontSmoothingBackgroundColor() const { return mFontSmoothingBackgroundColor; }
virtual FontType GetType() const MOZ_OVERRIDE { return FontType::MAC; }
private:
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -454,17 +454,17 @@ ScopedReadbackFB::~ScopedReadbackFB()
////////////////////////////////////////////////////////////////////////////////
class AutoLockBits
{
gfx::DrawTarget* mDT;
uint8_t* mLockedBits;
public:
- AutoLockBits(gfx::DrawTarget* dt)
+ explicit AutoLockBits(gfx::DrawTarget* dt)
: mDT(dt)
, mLockedBits(nullptr)
{
MOZ_ASSERT(mDT);
}
bool Lock(uint8_t** data, gfx::IntSize* size, int32_t* stride,
gfx::SurfaceFormat* format)
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -279,17 +279,17 @@ class ScopedReadbackFB
GLContext* const mGL;
ScopedBindFramebuffer mAutoFB;
GLuint mTempFB;
GLuint mTempTex;
SharedSurface* mSurfToUnlock;
SharedSurface* mSurfToLock;
public:
- ScopedReadbackFB(SharedSurface* src);
+ explicit ScopedReadbackFB(SharedSurface* src);
~ScopedReadbackFB();
};
bool ReadbackSharedSurface(SharedSurface* src, gfx::DrawTarget* dst);
} // namespace gl
} // namespace mozilla
--- a/gfx/layers/GLImages.h
+++ b/gfx/layers/GLImages.h
@@ -15,17 +15,17 @@
namespace mozilla {
namespace gl {
class AndroidSurfaceTexture;
}
namespace layers {
class GLImage : public Image {
public:
- GLImage(ImageFormat aFormat) : Image(nullptr, aFormat){}
+ explicit GLImage(ImageFormat aFormat) : Image(nullptr, aFormat){}
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
};
class EGLImageImage : public GLImage {
public:
struct Data {
EGLImage mImage;
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -95,17 +95,17 @@ private:
* Turns vsync notifications into scheduled composites.
**/
class CompositorVsyncObserver MOZ_FINAL : public VsyncObserver
{
friend class CompositorParent;
public:
- CompositorVsyncObserver(CompositorParent* aCompositorParent);
+ explicit CompositorVsyncObserver(CompositorParent* aCompositorParent);
virtual bool NotifyVsync(TimeStamp aVsyncTimestamp) MOZ_OVERRIDE;
void SetNeedsComposite(bool aSchedule);
bool NeedsComposite();
void CancelCurrentCompositeTask();
private:
virtual ~CompositorVsyncObserver();
--- a/gfx/src/nsRenderingContext.h
+++ b/gfx/src/nsRenderingContext.h
@@ -19,25 +19,25 @@ class DrawTarget;
class MOZ_STACK_CLASS nsRenderingContext MOZ_FINAL
{
typedef mozilla::gfx::DrawTarget DrawTarget;
public:
nsRenderingContext() {}
- nsRenderingContext(gfxContext* aThebesContext)
+ explicit nsRenderingContext(gfxContext* aThebesContext)
: mThebes(aThebesContext)
{}
- nsRenderingContext(already_AddRefed<gfxContext>&& aThebesContext)
+ explicit nsRenderingContext(already_AddRefed<gfxContext>&& aThebesContext)
: mThebes(aThebesContext)
{}
- nsRenderingContext(DrawTarget* aDrawTarget) {
+ explicit nsRenderingContext(DrawTarget* aDrawTarget) {
Init(aDrawTarget);
}
void Init(gfxContext* aThebesContext);
void Init(DrawTarget* aDrawTarget);
// These accessors will never return null.
gfxContext *ThebesContext() { return mThebes; }
--- a/gfx/thebes/ContextStateTracker.h
+++ b/gfx/thebes/ContextStateTracker.h
@@ -29,17 +29,17 @@ private:
bool IsProfiling() { return true; }
protected:
typedef GLuint TimerQueryHandle;
class ContextState {
public:
- ContextState(const char* aSectionName)
+ explicit ContextState(const char* aSectionName)
: mSectionName(aSectionName)
{}
const char* mSectionName;
mozilla::TimeStamp mCpuTimeStart;
mozilla::TimeStamp mCpuTimeEnd;
TimerQueryHandle mStartQueryHandle;
};
--- a/gfx/thebes/gfxFontEntry.h
+++ b/gfx/thebes/gfxFontEntry.h
@@ -58,17 +58,17 @@ public:
}
return mRefCnt;
}
gfxCharacterMap() :
mHash(0), mBuildOnTheFly(false), mShared(false)
{ }
- gfxCharacterMap(const gfxSparseBitSet& aOther) :
+ explicit gfxCharacterMap(const gfxSparseBitSet& aOther) :
gfxSparseBitSet(aOther),
mHash(0), mBuildOnTheFly(false), mShared(false)
{ }
void CalcHash() { mHash = GetChecksum(); }
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
return gfxSparseBitSet::SizeOfExcludingThis(aMallocSizeOf);
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -159,17 +159,17 @@ public:
/// if the capacity set with the method below is >= 2. We always retain the
/// very first critical message, and the latest capacity-1 messages are
/// rotated through. Note that we don't expect the total number of times
/// this gets called to be large - it is meant for critical errors only.
class CrashStatsLogForwarder: public mozilla::gfx::LogForwarder
{
public:
- CrashStatsLogForwarder(const char* aKey);
+ explicit CrashStatsLogForwarder(const char* aKey);
virtual void Log(const std::string& aString) MOZ_OVERRIDE;
void SetCircularBufferSize(uint32_t aCapacity);
private:
// Helpers for the Log()
bool UpdateStringsVector(const std::string& aString);
void UpdateCrashReport();
--- a/gfx/thebes/gfxVR.cpp
+++ b/gfx/thebes/gfxVR.cpp
@@ -175,17 +175,17 @@ static bool InitializeOculusCAPI()
} // anonymous namespace
using namespace mozilla::gfx;
// Dummy nsIScreen implementation, for when we just need to specify a size
class FakeScreen : public nsIScreen
{
public:
- FakeScreen(const IntRect& aScreenRect)
+ explicit FakeScreen(const IntRect& aScreenRect)
: mScreenRect(aScreenRect)
{ }
NS_DECL_ISUPPORTS
NS_IMETHOD GetRect(int32_t *l, int32_t *t, int32_t *w, int32_t *h) {
*l = mScreenRect.x;
*t = mScreenRect.y;
@@ -225,17 +225,17 @@ protected:
IntRect mScreenRect;
};
NS_IMPL_ISUPPORTS(FakeScreen, nsIScreen)
class HMDInfoOculus : public VRHMDInfo {
friend class VRHMDManagerOculusImpl;
public:
- HMDInfoOculus(ovrHmd aHMD);
+ explicit HMDInfoOculus(ovrHmd aHMD);
bool SetFOV(const VRFieldOfView& aFOVLeft, const VRFieldOfView& aFOVRight,
double zNear, double zFar) MOZ_OVERRIDE;
bool StartSensorTracking() MOZ_OVERRIDE;
VRHMDSensorState GetSensorState(double timeOffset) MOZ_OVERRIDE;
void StopSensorTracking() MOZ_OVERRIDE;
void ZeroSensor() MOZ_OVERRIDE;
--- a/gfx/thebes/gfxVR.h
+++ b/gfx/thebes/gfxVR.h
@@ -177,17 +177,17 @@ public:
VRDistortionConstants& values) = 0;
virtual const VRDistortionMesh& GetDistortionMesh(uint32_t whichEye) const { return mDistortionMesh[whichEye]; }
// The nsIScreen that represents this device
virtual nsIScreen* GetScreen() { return mScreen; }
protected:
- VRHMDInfo(VRHMDType aType) : mType(aType) { MOZ_COUNT_CTOR(VRHMDInfo); }
+ explicit VRHMDInfo(VRHMDType aType) : mType(aType) { MOZ_COUNT_CTOR(VRHMDInfo); }
virtual ~VRHMDInfo() { MOZ_COUNT_DTOR(VRHMDInfo); }
VRHMDType mType;
VRHMDConfiguration mConfiguration;
VRFieldOfView mEyeFOV[NumEyes];
IntSize mEyeResolution;
Point3D mEyeTranslation[NumEyes];
--- a/image/src/DecodePool.cpp
+++ b/image/src/DecodePool.cpp
@@ -106,17 +106,17 @@ private:
{ }
nsRefPtr<RasterImage> mImage;
};
class DecodeWorker : public nsRunnable
{
public:
- DecodeWorker(RasterImage* aImage)
+ explicit DecodeWorker(RasterImage* aImage)
: mImage(aImage)
{ }
NS_IMETHOD Run() MOZ_OVERRIDE
{
ReentrantMonitorAutoEnter lock(mImage->mDecodingMonitor);
// If we were interrupted, we shouldn't do any work.