Bug 1378044 - Switch the SVGImageContext::Hash() hashing code to use PLDHashNumber; r=dholbert
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 04 Jul 2017 00:54:15 -0400
changeset 367311 3e2c76807c4c645e16c56830216cbfa341448c9c
parent 367310 222b586254d3552bed0d296c7d80e7a01777e9df
child 367312 333938441c34584ed1610e909604c93453f6ba4d
push id32130
push usercbook@mozilla.com
push dateWed, 05 Jul 2017 11:01:49 +0000
treeherdermozilla-central@211d4dd61025 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1378044
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1378044 - Switch the SVGImageContext::Hash() hashing code to use PLDHashNumber; r=dholbert
dom/svg/SVGPreserveAspectRatio.h
image/SurfaceCache.h
layout/svg/SVGImageContext.h
--- a/dom/svg/SVGPreserveAspectRatio.h
+++ b/dom/svg/SVGPreserveAspectRatio.h
@@ -87,17 +87,17 @@ public:
     mMeetOrSlice = static_cast<uint8_t>(aMeetOrSlice);
     return NS_OK;
   }
 
   SVGMeetOrSlice GetMeetOrSlice() const {
     return static_cast<SVGMeetOrSlice>(mMeetOrSlice);
   }
 
-  uint32_t Hash() const {
+  PLDHashNumber Hash() const {
     return HashGeneric(mAlign, mMeetOrSlice);
   }
 
 private:
   // We can't use enum types here because some compilers fail to pack them.
   uint8_t mAlign;
   uint8_t mMeetOrSlice;
 };
--- a/image/SurfaceCache.h
+++ b/image/SurfaceCache.h
@@ -55,19 +55,19 @@ public:
   bool operator==(const SurfaceKey& aOther) const
   {
     return aOther.mSize == mSize &&
            aOther.mSVGContext == mSVGContext &&
            aOther.mPlayback == mPlayback &&
            aOther.mFlags == mFlags;
   }
 
-  uint32_t Hash() const
+  PLDHashNumber Hash() const
   {
-    uint32_t hash = HashGeneric(mSize.width, mSize.height);
+    PLDHashNumber hash = HashGeneric(mSize.width, mSize.height);
     hash = AddToHash(hash, mSVGContext.map(HashSIC).valueOr(0));
     hash = AddToHash(hash, uint8_t(mPlayback), uint32_t(mFlags));
     return hash;
   }
 
   const IntSize& Size() const { return mSize; }
   Maybe<SVGImageContext> SVGContext() const { return mSVGContext; }
   PlaybackType Playback() const { return mPlayback; }
@@ -79,17 +79,17 @@ private:
              PlaybackType aPlayback,
              SurfaceFlags aFlags)
     : mSize(aSize)
     , mSVGContext(aSVGContext)
     , mPlayback(aPlayback)
     , mFlags(aFlags)
   { }
 
-  static uint32_t HashSIC(const SVGImageContext& aSIC) {
+  static PLDHashNumber HashSIC(const SVGImageContext& aSIC) {
     return aSIC.Hash();
   }
 
   friend SurfaceKey RasterSurfaceKey(const IntSize&, SurfaceFlags, PlaybackType);
   friend SurfaceKey VectorSurfaceKey(const IntSize&,
                                      const Maybe<SVGImageContext>&);
 
   IntSize                mSize;
--- a/layout/svg/SVGImageContext.h
+++ b/layout/svg/SVGImageContext.h
@@ -92,31 +92,31 @@ public:
            mViewportSize == aOther.mViewportSize &&
            mPreserveAspectRatio == aOther.mPreserveAspectRatio;
   }
 
   bool operator!=(const SVGImageContext& aOther) const {
     return !(*this == aOther);
   }
 
-  uint32_t Hash() const {
-    uint32_t hash = 0;
+  PLDHashNumber Hash() const {
+    PLDHashNumber hash = 0;
     if (mContextPaint) {
       hash = HashGeneric(hash, mContextPaint->Hash());
     }
     return HashGeneric(hash,
                        mViewportSize.map(HashSize).valueOr(0),
                        mPreserveAspectRatio.map(HashPAR).valueOr(0));
   }
 
 private:
-  static uint32_t HashSize(const CSSIntSize& aSize) {
+  static PLDHashNumber HashSize(const CSSIntSize& aSize) {
     return HashGeneric(aSize.width, aSize.height);
   }
-  static uint32_t HashPAR(const SVGPreserveAspectRatio& aPAR) {
+  static PLDHashNumber HashPAR(const SVGPreserveAspectRatio& aPAR) {
     return aPAR.Hash();
   }
 
   // NOTE: When adding new member-vars, remember to update Hash() & operator==.
   RefPtr<SVGEmbeddingContextPaint> mContextPaint;
   Maybe<CSSIntSize>             mViewportSize;
   Maybe<SVGPreserveAspectRatio> mPreserveAspectRatio;
 };