Title: [254177] trunk/Source
Revision
254177
Author
simon.fra...@apple.com
Date
2020-01-07 16:54:30 -0800 (Tue, 07 Jan 2020)

Log Message

Add some more Animations logging
https://bugs.webkit.org/show_bug.cgi?id=205890

Reviewed by Dean Jackson.

Source/WebCore:

Add Animations logging to various WebAnimations entry points.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getAnimatedStyle):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::reverse):
(WebCore::WebAnimation::runPendingPauseTask):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::seekAnimation):

Source/WTF:

Make Seconds TextStream-loggable, and make Markable<> loggable.

* wtf/Seconds.cpp:
(WTF::operator<<):
* wtf/Seconds.h:
* wtf/text/TextStream.h:
(WTF::operator<<):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (254176 => 254177)


--- trunk/Source/WTF/ChangeLog	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WTF/ChangeLog	2020-01-08 00:54:30 UTC (rev 254177)
@@ -1,3 +1,18 @@
+2020-01-07  Simon Fraser  <simon.fra...@apple.com>
+
+        Add some more Animations logging
+        https://bugs.webkit.org/show_bug.cgi?id=205890
+
+        Reviewed by Dean Jackson.
+
+        Make Seconds TextStream-loggable, and make Markable<> loggable.
+
+        * wtf/Seconds.cpp:
+        (WTF::operator<<):
+        * wtf/Seconds.h:
+        * wtf/text/TextStream.h:
+        (WTF::operator<<):
+
 2020-01-07  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK][WPE] Add API to set purpose and hints of active editable element to input methods

Modified: trunk/Source/WTF/wtf/Seconds.cpp (254176 => 254177)


--- trunk/Source/WTF/wtf/Seconds.cpp	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WTF/wtf/Seconds.cpp	2020-01-08 00:54:30 UTC (rev 254177)
@@ -32,6 +32,7 @@
 #include <wtf/PrintStream.h>
 #include <wtf/TimeWithDynamicClockType.h>
 #include <wtf/WallTime.h>
+#include <wtf/text/TextStream.h>
 
 namespace WTF {
 
@@ -70,6 +71,12 @@
     out.print(m_value, " sec");
 }
 
+TextStream& operator<<(TextStream& ts, Seconds seconds)
+{
+    ts << seconds.value() << "s";
+    return ts;
+}
+
 void sleep(Seconds value)
 {
     // It's very challenging to find portable ways of sleeping for less than a second. On UNIX, you want to

Modified: trunk/Source/WTF/wtf/Seconds.h (254176 => 254177)


--- trunk/Source/WTF/wtf/Seconds.h	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WTF/wtf/Seconds.h	2020-01-08 00:54:30 UTC (rev 254177)
@@ -32,6 +32,7 @@
 
 class MonotonicTime;
 class PrintStream;
+class TextStream;
 class TimeWithDynamicClockType;
 class WallTime;
 
@@ -331,6 +332,8 @@
 
 } // inline seconds_literals
 
+WTF_EXPORT_PRIVATE TextStream& operator<<(TextStream&, Seconds);
+
 } // namespace WTF
 
 using WTF::sleep;

Modified: trunk/Source/WTF/wtf/text/TextStream.h (254176 => 254177)


--- trunk/Source/WTF/wtf/text/TextStream.h	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WTF/wtf/text/TextStream.h	2020-01-08 00:54:30 UTC (rev 254177)
@@ -26,6 +26,8 @@
 #pragma once
 
 #include <wtf/Forward.h>
+#include <wtf/Markable.h>
+#include <wtf/Optional.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace WTF {
@@ -183,6 +185,15 @@
     return ts << "nullopt";
 }
 
+template<typename T, typename Traits>
+TextStream& operator<<(TextStream& ts, const Markable<T, Traits>& item)
+{
+    if (item)
+        return ts << item.value();
+    
+    return ts << "unset";
+}
+
 template<typename Item>
 TextStream& operator<<(TextStream& ts, const Vector<Item>& vector)
 {

Modified: trunk/Source/WebCore/ChangeLog (254176 => 254177)


--- trunk/Source/WebCore/ChangeLog	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WebCore/ChangeLog	2020-01-08 00:54:30 UTC (rev 254177)
@@ -1,3 +1,27 @@
+2020-01-07  Simon Fraser  <simon.fra...@apple.com>
+
+        Add some more Animations logging
+        https://bugs.webkit.org/show_bug.cgi?id=205890
+
+        Reviewed by Dean Jackson.
+
+        Add Animations logging to various WebAnimations entry points.
+
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::getAnimatedStyle):
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::silentlySetCurrentTime):
+        (WebCore::WebAnimation::setCurrentTime):
+        (WebCore::WebAnimation::cancel):
+        (WebCore::WebAnimation::finish):
+        (WebCore::WebAnimation::play):
+        (WebCore::WebAnimation::runPendingPlayTask):
+        (WebCore::WebAnimation::pause):
+        (WebCore::WebAnimation::reverse):
+        (WebCore::WebAnimation::runPendingPauseTask):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::seekAnimation):
+
 2020-01-07  Ross Kirsling  <ross.kirsl...@sony.com>
 
         Unreviewed restabilization of non-unified build.

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (254176 => 254177)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2020-01-08 00:54:30 UTC (rev 254177)
@@ -45,6 +45,7 @@
 #include "JSDOMConvert.h"
 #include "JSKeyframeEffect.h"
 #include "KeyframeEffectStack.h"
+#include "Logging.h"
 #include "RenderBox.h"
 #include "RenderBoxModelObject.h"
 #include "RenderElement.h"
@@ -58,6 +59,7 @@
 #include "WillChangeData.h"
 #include <_javascript_Core/Exception.h>
 #include <wtf/UUID.h>
+#include <wtf/text/TextStream.h>
 
 namespace WebCore {
 using namespace JSC;
@@ -1115,6 +1117,7 @@
         return;
 
     auto progress = getComputedTiming().progress;
+    LOG_WITH_STREAM(Animations, stream << "KeyframeEffect " << this << " getAnimatedStyle - progress " << progress);
     if (!progress)
         return;
 

Modified: trunk/Source/WebCore/animation/WebAnimation.cpp (254176 => 254177)


--- trunk/Source/WebCore/animation/WebAnimation.cpp	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WebCore/animation/WebAnimation.cpp	2020-01-08 00:54:30 UTC (rev 254177)
@@ -40,11 +40,13 @@
 #include "JSWebAnimation.h"
 #include "KeyframeEffect.h"
 #include "KeyframeEffectStack.h"
+#include "Logging.h"
 #include "RenderElement.h"
 #include "StyledElement.h"
 #include "WebAnimationUtilities.h"
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/Optional.h>
+#include <wtf/text/TextStream.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -363,6 +365,8 @@
 
 ExceptionOr<void> WebAnimation::silentlySetCurrentTime(Optional<Seconds> seekTime)
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " silentlySetCurrentTime " << seekTime);
+
     // 3.4.5. Setting the current time of an animation
     // https://drafts.csswg.org/web-animations-1/#setting-the-current-time-of-an-animation
 
@@ -401,6 +405,8 @@
 
 ExceptionOr<void> WebAnimation::setCurrentTime(Optional<Seconds> seekTime)
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " setCurrentTime " << seekTime);
+
     // 3.4.5. Setting the current time of an animation
     // https://drafts.csswg.org/web-animations-1/#setting-the-current-time-of-an-animation
 
@@ -574,6 +580,8 @@
 
 void WebAnimation::cancel(Silently silently)
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " cancel(silently " << (silently == Silently::Yes) << ") (current time is " << currentTime() << ")");
+
     // 3.4.16. Canceling an animation
     // https://drafts.csswg.org/web-animations-1/#canceling-an-animation-section
     //
@@ -670,6 +678,8 @@
 
 ExceptionOr<void> WebAnimation::finish()
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " finish (current time is " << currentTime() << ")");
+
     // 3.4.15. Finishing an animation
     // https://drafts.csswg.org/web-animations-1/#finishing-an-animation-section
 
@@ -855,6 +865,8 @@
 
 ExceptionOr<void> WebAnimation::play(AutoRewind autoRewind)
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " play(autoRewind " << (autoRewind == AutoRewind::Yes) << ") (current time is " << currentTime() << ")");
+
     // 3.4.10. Playing an animation
     // https://drafts.csswg.org/web-animations-1/#play-an-animation
 
@@ -928,6 +940,8 @@
 
 void WebAnimation::runPendingPlayTask()
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " runPendingPlayTask (current time is " << currentTime() << ")");
+
     // 3.4.10. Playing an animation, step 8.
     // https://drafts.csswg.org/web-animations-1/#play-an-animation
 
@@ -988,6 +1002,8 @@
 
 ExceptionOr<void> WebAnimation::pause()
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " pause (current time is " << currentTime() << ")");
+
     // 3.4.11. Pausing an animation
     // https://drafts.csswg.org/web-animations-1/#pause-an-animation
 
@@ -1042,6 +1058,8 @@
 
 ExceptionOr<void> WebAnimation::reverse()
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " reverse (current time is " << currentTime() << ")");
+
     // 3.4.18. Reversing an animation
     // https://drafts.csswg.org/web-animations-1/#reverse-an-animation
 
@@ -1073,6 +1091,8 @@
 
 void WebAnimation::runPendingPauseTask()
 {
+    LOG_WITH_STREAM(Animations, stream << "WebAnimation " << this << " runPendingPauseTask (current time is " << currentTime() << ")");
+
     // 3.4.11. Pausing an animation, step 7.
     // https://drafts.csswg.org/web-animations-1/#pause-an-animation
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (254176 => 254177)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-01-08 00:41:35 UTC (rev 254176)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-01-08 00:54:30 UTC (rev 254177)
@@ -1075,7 +1075,7 @@
 
 void GraphicsLayerCA::seekAnimation(const String& animationName, double timeOffset)
 {
-    LOG_WITH_STREAM(Animations, stream << "GraphicsLayerCA " << this << " id " << primaryLayerID() << " seekAnimation " << animationName << " (is running " << animationIsRunning(animationName) << ")");
+    LOG_WITH_STREAM(Animations, stream << "GraphicsLayerCA " << this << " id " << primaryLayerID() << " seekAnimation " << animationName << " to " << timeOffset << " (is running " << animationIsRunning(animationName) << ")");
 
     // Call add since if there is already a Remove in there, we don't want to overwrite it with a Pause.
     addProcessingActionForAnimation(animationName, AnimationProcessingAction { Seek, Seconds { timeOffset } });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to