commit da87d9d332051ebd8fcb702be7e6d1c5fa0b7d89
parent 89c0ffec7c0aabd832b2f925bdd75850ef53646b
Author: Narcis Beleuzu <nbeleuzu@mozilla.com>
Date: Fri, 17 Oct 2025 00:23:22 +0300
Revert "Bug 1994806 - Better RecordedFilterNodeSetAttribute bool serialization. r=aosmond" for causing bustages on RecordedEventImpl.h
This reverts commit fcd48a7b01e85ecdd92ec70de434aa63852d891f.
Diffstat:
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/gfx/2d/RecordedEventImpl.h b/gfx/2d/RecordedEventImpl.h
@@ -1743,24 +1743,13 @@ class RecordedFilterNodeSetAttribute
};
template <typename T>
- void WritePayload(const T& aValue) {
- mPayload.Assign(reinterpret_cast<const uint8_t*>(&aValue), sizeof(T));
- }
-
- template <>
- void WritePayload(const bool& aValue) {
- uint8_t data = aValue ? 1 : 0;
- mPayload.Assign(&data, 1);
- }
-
- template <typename T>
RecordedFilterNodeSetAttribute(FilterNode* aNode, uint32_t aIndex,
T aArgument, ArgType aArgType)
: RecordedEventDerived(FILTERNODESETATTRIBUTE),
mNode(aNode),
mIndex(aIndex),
mArgType(aArgType) {
- WritePayload(aArgument);
+ mPayload.Assign(reinterpret_cast<const uint8_t*>(&aArgument), sizeof(T));
}
RecordedFilterNodeSetAttribute(FilterNode* aNode, uint32_t aIndex,
@@ -4451,6 +4440,11 @@ inline void RecordedMaskSurface::OutputSimpleEventInfo(
OutputSimplePatternInfo(mPattern, aStringStream);
}
+template <typename T>
+void ReplaySetAttribute(FilterNode* aNode, uint32_t aIndex, T aValue) {
+ aNode->SetAttribute(aIndex, aValue);
+}
+
inline bool RecordedFilterNodeSetAttribute::PlayEvent(
Translator* aTranslator) const {
FilterNode* node = aTranslator->LookupFilterNode(mNode);
@@ -4458,18 +4452,16 @@ inline bool RecordedFilterNodeSetAttribute::PlayEvent(
return false;
}
-#define REPLAY_SET_ATTRIBUTE_CAST(type, cast, argtype) \
+#define REPLAY_SET_ATTRIBUTE(type, argtype) \
case ARGTYPE_##argtype: \
if (mPayload.size() < sizeof(type)) { \
return false; \
} \
- node->SetAttribute(mIndex, cast(*(type*)mPayload.data())); \
+ ReplaySetAttribute(node, mIndex, *(type*)mPayload.data()); \
break
-#define REPLAY_SET_ATTRIBUTE(type, argtype) \
- REPLAY_SET_ATTRIBUTE_CAST(type, , argtype)
switch (mArgType) {
- REPLAY_SET_ATTRIBUTE_CAST(uint8_t, bool, BOOL);
+ REPLAY_SET_ATTRIBUTE(bool, BOOL);
REPLAY_SET_ATTRIBUTE(uint32_t, UINT32);
REPLAY_SET_ATTRIBUTE(Float, FLOAT);
REPLAY_SET_ATTRIBUTE(Size, SIZE);