Loading gfx/2d/RecordedEventImpl.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RecordedDrawTargetCreation BackendType mBackendType; IntRect mRect; SurfaceFormat mFormat; bool mHasExistingData; bool mHasExistingData = false; RefPtr<SourceSurface> mExistingData; private: Loading gfx/2d/RecordingTypes.h +22 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,28 @@ struct ElementStreamFormat { aStream.read(reinterpret_cast<char*>(&aElement), sizeof(T)); } }; template <class S> struct ElementStreamFormat<S, bool> { static void Write(S& aStream, const bool& aElement) { char boolChar = aElement ? '\x01' : '\x00'; aStream.write(&boolChar, sizeof(boolChar)); } static void Read(S& aStream, bool& aElement) { char boolChar; aStream.read(&boolChar, sizeof(boolChar)); switch (boolChar) { case '\x00': aElement = false; break; case '\x01': aElement = true; break; default: aStream.SetIsBad(); break; } } }; template <class S, class T> void WriteElement(S& aStream, const T& aElement) { Loading Loading
gfx/2d/RecordedEventImpl.h +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RecordedDrawTargetCreation BackendType mBackendType; IntRect mRect; SurfaceFormat mFormat; bool mHasExistingData; bool mHasExistingData = false; RefPtr<SourceSurface> mExistingData; private: Loading
gfx/2d/RecordingTypes.h +22 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,28 @@ struct ElementStreamFormat { aStream.read(reinterpret_cast<char*>(&aElement), sizeof(T)); } }; template <class S> struct ElementStreamFormat<S, bool> { static void Write(S& aStream, const bool& aElement) { char boolChar = aElement ? '\x01' : '\x00'; aStream.write(&boolChar, sizeof(boolChar)); } static void Read(S& aStream, bool& aElement) { char boolChar; aStream.read(&boolChar, sizeof(boolChar)); switch (boolChar) { case '\x00': aElement = false; break; case '\x01': aElement = true; break; default: aStream.SetIsBad(); break; } } }; template <class S, class T> void WriteElement(S& aStream, const T& aElement) { Loading