diff --git a/gfx/src/FilterSupport.cpp b/gfx/src/FilterSupport.cpp index c06a4b1ec0e..2fc3943c8ff 100644 --- a/gfx/src/FilterSupport.cpp +++ b/gfx/src/FilterSupport.cpp @@ -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 diff --git a/gfx/src/FilterSupport.h b/gfx/src/FilterSupport.h index 0c3a4d2129e..f080c7d72e0 100644 --- a/gfx/src/FilterSupport.h +++ b/gfx/src/FilterSupport.h @@ -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 mPrimitives; IntRect mFilterSpaceBounds; };