Add MOZ_DBG support for RawServoAnimationValue (or AnimationValue)
Categories
(Core :: DOM: Animation, enhancement, P5)
Tracking
()
People
(Reporter: boris, Assigned: boris)
References
Details
Attachments
(1 file, 1 obsolete file)
In C++, it's pretty hard to dump the servo animation value for now. We may use cbindgen to generate RawServoAnimationValue
in the future, but it's still worth to add an operator<<
for AnimationValue, so it'd be easier to dump the animation value on the gecko side.
Comment 1•6 years ago
|
||
If we do that, we could probably drop DumpAnimationProperties
too (which I made some tweaks to here: https://github.com/birtles/gecko-dev/commit/c8d47602c819bb1512ddeb6d8cd515258ae93095)
At some point I also found myself wanting to dump the specified versions too like we get in Keyframe
/PropertyValuePair
objects: https://github.com/birtles/gecko-dev/commit/6a061e690b4539cf6a8c35199fb12e0b00a33828
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
I would like to debug animations for OMTA, so maybe it's time to implement this.
Comment 3•6 years ago
|
||
I also recall wanting this recently and at that point I thought it would more convenient if we added support for RawServoAnimationValue
rather than requiring the AnimationValue
wrapper. (And I think somewhere I commented about a possible place to add support for RawServoAnimationValue
but I don't recall where that was.)
Assignee | ||
Comment 4•6 years ago
•
|
||
(In reply to Brian Birtles (:birtles) from comment #3)
I also recall wanting this recently and at that point I thought it would more convenient if we added support for
RawServoAnimationValue
rather than requiring theAnimationValue
wrapper. (And I think somewhere I commented about a possible place to add support forRawServoAnimationValue
but I don't recall where that was.)
I'd like to add two inline overloading functions in StyleAnimationValue.h:
inline std::ostream& operator<<(std::ostream& aOut, const AnimationValue& aValue); // This calls FFI to get the content of RawServoAnimationValue
inline std::ostream& operator<<(std::ostream& aOut, const RefPtr<RawServoAnimationValue>& aValue); // This calls FFI, too.
The first overloading function, for AnimationValue, works as I expected.
However, got a problem for the 2nd function. We have a function template for RefPtr<T> in RefPtr.h already [1]:
template <class T>
std::ostream& operator<<(std::ostream& aOut, const RefPtr<T>& aObj) {
return mozilla::DebugValue(aOut, aObj.get());
}
It seems if I call
RefPtr<RawServoAnimationValue> value; // set from FFI.
MOZ_DBG(value);
This always outputs something like this: [MozDbg] ... value = 0x7f90cc70a188
. Obviously, it uses the default behavior for non-derefed pointer. Ok, so I am struggling against this issue, and no idea how to make the non-template overloading operator work (in a different header file). Cameron, do you have any, hmm, possible way to overload the default behavior? I am a template idiot, so have no idea right now.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 6•6 years ago
|
||
Still don't know why I cannot overloading the operator<<(..., const RefPtr<StyleAnimationValue>& ...)
in StyleAnimationValue.h
, so I only support MOZ_DBG
for AnimationValue
for now.
Assignee | ||
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•