Bug 1603409 - add missing operator= definitions for gfx/2d classes; r=botond

These definitions are implicitly created now, but trunk clang considers
implicit creation to be a bug when you have explicitly declared copy
constructors.

Differential Revision: https://phabricator.services.mozilla.com/D56970

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-12-13 17:58:55 +00:00
parent 199786a364
commit 364d8de43e
3 changed files with 9 additions and 0 deletions

View File

@ -1196,6 +1196,11 @@ class Matrix4x4Typed {
bool operator!=(const Matrix4x4Typed& o) const { return !((*this) == o); }
Matrix4x4Typed& operator=(const Matrix4x4Typed& aOther) {
memcpy(components, aOther.components, sizeof(components));
return *this;
}
template <typename NewTargetUnits>
Matrix4x4Typed<SourceUnits, NewTargetUnits, T> operator*(
const Matrix4x4Typed<TargetUnits, NewTargetUnits, T>& aMatrix) const {

View File

@ -36,6 +36,8 @@ struct ScaleFactor {
ScaleFactor<dst, src> Inverse() { return ScaleFactor<dst, src>(1 / scale); }
ScaleFactor<src, dst>& operator=(const ScaleFactor<src, dst>&) = default;
bool operator==(const ScaleFactor<src, dst>& aOther) const {
return scale == aOther.scale;
}

View File

@ -53,6 +53,8 @@ struct ScaleFactors2D {
return ScaleFactor<src, dst>(xScale);
}
ScaleFactors2D<src, dst>& operator=(const ScaleFactors2D<src, dst>&) = default;
bool operator==(const ScaleFactors2D<src, dst>& aOther) const {
return xScale == aOther.xScale && yScale == aOther.yScale;
}