mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 06:38:36 +00:00
Bug 1060802 - Fix some more bad implicit constructors in gfx; r=roc
This commit is contained in:
parent
14ca0ef931
commit
3cc9664125
@ -103,7 +103,7 @@ struct IntCoordTyped :
|
||||
typedef BaseCoord< int32_t, IntCoordTyped<units> > Super;
|
||||
|
||||
MOZ_CONSTEXPR IntCoordTyped() : Super() {}
|
||||
MOZ_CONSTEXPR IntCoordTyped(int32_t aValue) : Super(aValue) {}
|
||||
MOZ_CONSTEXPR MOZ_IMPLICIT IntCoordTyped(int32_t aValue) : Super(aValue) {}
|
||||
};
|
||||
|
||||
template<class units>
|
||||
@ -118,7 +118,7 @@ struct CoordTyped :
|
||||
typedef BaseCoord< Float, CoordTyped<units> > Super;
|
||||
|
||||
MOZ_CONSTEXPR CoordTyped() : Super() {}
|
||||
MOZ_CONSTEXPR CoordTyped(Float aValue) : Super(aValue) {}
|
||||
MOZ_CONSTEXPR MOZ_IMPLICIT CoordTyped(Float aValue) : Super(aValue) {}
|
||||
explicit MOZ_CONSTEXPR CoordTyped(const IntCoordTyped<units>& aCoord) : Super(float(aCoord.value)) {}
|
||||
|
||||
void Round() {
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
virtual void ExecuteOnDT(DrawTarget* aDT, const Matrix& aTransform) = 0;
|
||||
|
||||
protected:
|
||||
DrawingCommand(CommandType aType)
|
||||
explicit DrawingCommand(CommandType aType)
|
||||
: mType(aType)
|
||||
{
|
||||
}
|
||||
@ -56,7 +56,7 @@ private:
|
||||
class StoredPattern
|
||||
{
|
||||
public:
|
||||
StoredPattern(const Pattern& aPattern)
|
||||
explicit StoredPattern(const Pattern& aPattern)
|
||||
{
|
||||
Assign(aPattern);
|
||||
}
|
||||
@ -169,7 +169,7 @@ private:
|
||||
class ClearRectCommand : public DrawingCommand
|
||||
{
|
||||
public:
|
||||
ClearRectCommand(const Rect& aRect)
|
||||
explicit ClearRectCommand(const Rect& aRect)
|
||||
: DrawingCommand(CommandType::CLEARRECT)
|
||||
, mRect(aRect)
|
||||
{
|
||||
@ -431,7 +431,7 @@ private:
|
||||
class PushClipCommand : public DrawingCommand
|
||||
{
|
||||
public:
|
||||
PushClipCommand(const Path* aPath)
|
||||
explicit PushClipCommand(const Path* aPath)
|
||||
: DrawingCommand(CommandType::PUSHCLIP)
|
||||
, mPath(const_cast<Path*>(aPath))
|
||||
{
|
||||
@ -449,7 +449,7 @@ private:
|
||||
class PushClipRectCommand : public DrawingCommand
|
||||
{
|
||||
public:
|
||||
PushClipRectCommand(const Rect& aRect)
|
||||
explicit PushClipRectCommand(const Rect& aRect)
|
||||
: DrawingCommand(CommandType::PUSHCLIPRECT)
|
||||
, mRect(aRect)
|
||||
{
|
||||
@ -481,7 +481,7 @@ public:
|
||||
class SetTransformCommand : public DrawingCommand
|
||||
{
|
||||
public:
|
||||
SetTransformCommand(const Matrix& aTransform)
|
||||
explicit SetTransformCommand(const Matrix& aTransform)
|
||||
: DrawingCommand(CommandType::SETTRANSFORM)
|
||||
, mTransform(aTransform)
|
||||
{
|
||||
|
@ -251,13 +251,13 @@ GetCairoSurfaceForSourceSurface(SourceSurface *aSurface, bool aExistingOnly = fa
|
||||
class AutoClearDeviceOffset
|
||||
{
|
||||
public:
|
||||
AutoClearDeviceOffset(SourceSurface* aSurface)
|
||||
explicit AutoClearDeviceOffset(SourceSurface* aSurface)
|
||||
: mSurface(nullptr)
|
||||
{
|
||||
Init(aSurface);
|
||||
}
|
||||
|
||||
AutoClearDeviceOffset(const Pattern& aPattern)
|
||||
explicit AutoClearDeviceOffset(const Pattern& aPattern)
|
||||
: mSurface(nullptr)
|
||||
{
|
||||
if (aPattern.GetType() == PatternType::SURFACE) {
|
||||
|
@ -12,7 +12,7 @@ namespace gfx {
|
||||
class DualSurface
|
||||
{
|
||||
public:
|
||||
inline DualSurface(SourceSurface *aSurface)
|
||||
inline explicit DualSurface(SourceSurface *aSurface)
|
||||
{
|
||||
if (aSurface->GetType() != SurfaceType::DUAL_DT) {
|
||||
mA = mB = aSurface;
|
||||
@ -36,7 +36,7 @@ public:
|
||||
class DualPattern
|
||||
{
|
||||
public:
|
||||
inline DualPattern(const Pattern &aPattern)
|
||||
inline explicit DualPattern(const Pattern &aPattern)
|
||||
: mPatternsInitialized(false)
|
||||
{
|
||||
if (aPattern.GetType() != PatternType::SURFACE) {
|
||||
|
@ -157,7 +157,7 @@ GetFilterNode(FilterNode* aNode)
|
||||
|
||||
struct AdjustedPattern
|
||||
{
|
||||
AdjustedPattern(const Pattern &aPattern)
|
||||
explicit AdjustedPattern(const Pattern &aPattern)
|
||||
: mPattern(nullptr)
|
||||
{
|
||||
mOrigPattern = const_cast<Pattern*>(&aPattern);
|
||||
|
@ -2164,7 +2164,7 @@ static uint8_t* sColorSamplingAccessControlEnd = nullptr;
|
||||
|
||||
struct DebugOnlyAutoColorSamplingAccessControl
|
||||
{
|
||||
DebugOnlyAutoColorSamplingAccessControl(DataSourceSurface* aSurface)
|
||||
explicit DebugOnlyAutoColorSamplingAccessControl(DataSourceSurface* aSurface)
|
||||
{
|
||||
sColorSamplingAccessControlStart = aSurface->GetData();
|
||||
sColorSamplingAccessControlEnd = sColorSamplingAccessControlStart +
|
||||
|
@ -321,7 +321,7 @@ ExtendModeToTileMode(ExtendMode aMode)
|
||||
template <typename T> class RefPtrSkia {
|
||||
public:
|
||||
RefPtrSkia() : fObj(NULL) {}
|
||||
RefPtrSkia(T* obj) : fObj(obj) { SkSafeRef(fObj); }
|
||||
explicit RefPtrSkia(T* obj) : fObj(obj) { SkSafeRef(fObj); }
|
||||
RefPtrSkia(const RefPtrSkia& o) : fObj(o.fObj) { SkSafeRef(fObj); }
|
||||
~RefPtrSkia() { SkSafeUnref(fObj); }
|
||||
|
||||
|
@ -19,7 +19,7 @@ class PathBuilderSkia : public PathBuilder
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderSkia)
|
||||
PathBuilderSkia(const Matrix& aTransform, const SkPath& aPath, FillRule aFillRule);
|
||||
PathBuilderSkia(FillRule aFillRule);
|
||||
explicit PathBuilderSkia(FillRule aFillRule);
|
||||
|
||||
virtual void MoveTo(const Point &aPoint);
|
||||
virtual void LineTo(const Point &aPoint);
|
||||
|
@ -30,7 +30,7 @@ class ScaledFontBase : public ScaledFont
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontBase)
|
||||
ScaledFontBase(Float aSize);
|
||||
explicit ScaledFontBase(Float aSize);
|
||||
virtual ~ScaledFontBase();
|
||||
|
||||
virtual TemporaryRef<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
|
||||
|
@ -161,7 +161,7 @@ int maxPow2LessThan(int a)
|
||||
|
||||
struct writeBuf
|
||||
{
|
||||
writeBuf(int size)
|
||||
explicit writeBuf(int size)
|
||||
{
|
||||
this->data = new unsigned char [size];
|
||||
this->offset = 0;
|
||||
|
@ -49,7 +49,7 @@ class DataSourceSurfaceCairo : public DataSourceSurface
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceCairo)
|
||||
DataSourceSurfaceCairo(cairo_surface_t* imageSurf);
|
||||
explicit DataSourceSurfaceCairo(cairo_surface_t* imageSurf);
|
||||
virtual ~DataSourceSurfaceCairo();
|
||||
virtual unsigned char *GetData();
|
||||
virtual int32_t Stride();
|
||||
|
@ -624,7 +624,7 @@ public:
|
||||
bool mHasBeenChecked;
|
||||
|
||||
public:
|
||||
ScopedLocalErrorCheck(GLContext* gl)
|
||||
explicit ScopedLocalErrorCheck(GLContext* gl)
|
||||
: mGL(gl)
|
||||
, mHasBeenChecked(false)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ class SkiaGLGlue : public GenericAtomicRefCounted
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SkiaGLGlue)
|
||||
SkiaGLGlue(GLContext* context);
|
||||
explicit SkiaGLGlue(GLContext* context);
|
||||
GLContext* GetGLContext() const { return mGLContext.get(); }
|
||||
GrContext* GetGrContext() const { return mGrContext.get(); }
|
||||
|
||||
@ -63,4 +63,4 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -133,7 +133,7 @@ protected:
|
||||
// Render to a render target rather than the screen.
|
||||
struct EffectColorMatrix : public Effect
|
||||
{
|
||||
EffectColorMatrix(gfx::Matrix5x4 aMatrix)
|
||||
explicit EffectColorMatrix(gfx::Matrix5x4 aMatrix)
|
||||
: Effect(EffectTypes::COLOR_MATRIX)
|
||||
, mColorMatrix(aMatrix)
|
||||
{}
|
||||
|
@ -23,7 +23,7 @@ class OverscrollHandoffChain;
|
||||
class InputBlockState
|
||||
{
|
||||
public:
|
||||
InputBlockState(const nsRefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain);
|
||||
explicit InputBlockState(const nsRefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain);
|
||||
|
||||
const nsRefPtr<const OverscrollHandoffChain>& GetOverscrollHandoffChain() const;
|
||||
private:
|
||||
@ -66,7 +66,7 @@ class TouchBlockState : public InputBlockState
|
||||
public:
|
||||
typedef uint32_t TouchBehaviorFlags;
|
||||
|
||||
TouchBlockState(const nsRefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain);
|
||||
explicit TouchBlockState(const nsRefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain);
|
||||
|
||||
/**
|
||||
* Record whether or not content cancelled this block of events.
|
||||
|
@ -187,7 +187,7 @@ TestFrameMetrics()
|
||||
|
||||
class APZCBasicTester : public ::testing::Test {
|
||||
public:
|
||||
APZCBasicTester(AsyncPanZoomController::GestureBehavior aGestureBehavior = AsyncPanZoomController::DEFAULT_GESTURES)
|
||||
explicit APZCBasicTester(AsyncPanZoomController::GestureBehavior aGestureBehavior = AsyncPanZoomController::DEFAULT_GESTURES)
|
||||
: mGestureBehavior(aGestureBehavior)
|
||||
{
|
||||
}
|
||||
@ -489,7 +489,7 @@ ApzcPinchWithTouchInputAndCheckStatus(AsyncPanZoomController* aApzc,
|
||||
|
||||
class APZCPinchTester : public APZCBasicTester {
|
||||
public:
|
||||
APZCPinchTester(AsyncPanZoomController::GestureBehavior aGestureBehavior = AsyncPanZoomController::DEFAULT_GESTURES)
|
||||
explicit APZCPinchTester(AsyncPanZoomController::GestureBehavior aGestureBehavior = AsyncPanZoomController::DEFAULT_GESTURES)
|
||||
: APZCBasicTester(aGestureBehavior)
|
||||
{
|
||||
}
|
||||
@ -1979,7 +1979,7 @@ private:
|
||||
|
||||
class MockTask : public CancelableTask {
|
||||
public:
|
||||
MockTask(TaskRunMetrics& aMetrics)
|
||||
explicit MockTask(TaskRunMetrics& aMetrics)
|
||||
: mMetrics(aMetrics)
|
||||
{}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
|
||||
class TestContainerLayer: public ContainerLayer {
|
||||
public:
|
||||
TestContainerLayer(LayerManager* aManager)
|
||||
explicit TestContainerLayer(LayerManager* aManager)
|
||||
: ContainerLayer(aManager, nullptr)
|
||||
{}
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
|
||||
class TestThebesLayer: public ThebesLayer {
|
||||
public:
|
||||
TestThebesLayer(LayerManager* aManager)
|
||||
explicit TestThebesLayer(LayerManager* aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
{}
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace layers {
|
||||
|
||||
struct TestTiledLayerTile {
|
||||
int value;
|
||||
TestTiledLayerTile(int v = 0) {
|
||||
explicit TestTiledLayerTile(int v = 0) {
|
||||
value = v;
|
||||
}
|
||||
bool operator== (const TestTiledLayerTile& o) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user