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