Bug 984761 - Add FilterPrimitiveDescription::operator==. r=roc

This commit is contained in:
Markus Stange 2014-03-20 10:12:44 +08:00
parent 46966112cf
commit 12b3f841f0
2 changed files with 33 additions and 0 deletions

View File

@ -1568,6 +1568,27 @@ FilterPrimitiveDescription::operator=(const FilterPrimitiveDescription& aOther)
return *this;
}
bool
FilterPrimitiveDescription::operator==(const FilterPrimitiveDescription& aOther) const
{
return mType == aOther.mType &&
mFilterPrimitiveSubregion.IsEqualInterior(aOther.mFilterPrimitiveSubregion) &&
mOutputColorSpace == aOther.mOutputColorSpace &&
mIsTainted == aOther.mIsTainted &&
mInputPrimitives == aOther.mInputPrimitives &&
mInputColorSpaces == aOther.mInputColorSpaces &&
mAttributes == aOther.mAttributes;
}
// FilterDescription
bool
FilterDescription::operator==(const FilterDescription& aOther) const
{
return mFilterSpaceBounds.IsEqualInterior(aOther.mFilterSpaceBounds) &&
mPrimitives == aOther.mPrimitives;
}
// AttributeMap
// A class that wraps different types for easy storage in a hashtable. Only

View File

@ -337,6 +337,12 @@ public:
mOutputColorSpace = aColorSpace;
}
bool operator==(const FilterPrimitiveDescription& aOther) const;
bool operator!=(const FilterPrimitiveDescription& aOther) const
{
return !(*this == aOther);
}
private:
PrimitiveType mType;
AttributeMap mAttributes;
@ -360,6 +366,12 @@ struct FilterDescription MOZ_FINAL {
, mFilterSpaceBounds(aFilterSpaceBounds)
{}
bool operator==(const FilterDescription& aOther) const;
bool operator!=(const FilterDescription& aOther) const
{
return !(*this == aOther);
}
nsTArray<FilterPrimitiveDescription> mPrimitives;
IntRect mFilterSpaceBounds;
};