Title: [229794] trunk/Source
- Revision
- 229794
- Author
- [email protected]
- Date
- 2018-03-21 00:16:07 -0700 (Wed, 21 Mar 2018)
Log Message
[TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
https://bugs.webkit.org/show_bug.cgi?id=183771
Reviewed by Carlos Garcia Campos.
Source/WebCore:
TextureMapperLayer::applyAnimationsRecursively() should return true when
the TextureMapperLayer tree has currently-running animations that
require continuous scene update.
TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
member that's set to true if any of the applied animations are still in
playing state. That information is then returned in syncAnimations(),
and the result is accumulated in the top applyAnimationsRecursively()
call and returned there to the caller.
No new tests -- no change in behavior.
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::applyAnimationsRecursively):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/TextureMapperLayer.h:
Source/WebKit:
In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
information about any running animation in the scene via the
TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
value at the end up the method, instead of again traversing the
TextureMapperLayer tree to determine whether any running animations are
present.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (229793 => 229794)
--- trunk/Source/WebCore/ChangeLog 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebCore/ChangeLog 2018-03-21 07:16:07 UTC (rev 229794)
@@ -1,5 +1,32 @@
2018-03-21 Zan Dobersek <[email protected]>
+ [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
+ https://bugs.webkit.org/show_bug.cgi?id=183771
+
+ Reviewed by Carlos Garcia Campos.
+
+ TextureMapperLayer::applyAnimationsRecursively() should return true when
+ the TextureMapperLayer tree has currently-running animations that
+ require continuous scene update.
+
+ TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
+ member that's set to true if any of the applied animations are still in
+ playing state. That information is then returned in syncAnimations(),
+ and the result is accumulated in the top applyAnimationsRecursively()
+ call and returned there to the caller.
+
+ No new tests -- no change in behavior.
+
+ * platform/graphics/texmap/TextureMapperAnimation.cpp:
+ (WebCore::TextureMapperAnimation::apply):
+ * platform/graphics/texmap/TextureMapperAnimation.h:
+ * platform/graphics/texmap/TextureMapperLayer.cpp:
+ (WebCore::TextureMapperLayer::applyAnimationsRecursively):
+ (WebCore::TextureMapperLayer::syncAnimations):
+ * platform/graphics/texmap/TextureMapperLayer.h:
+
+2018-03-21 Zan Dobersek <[email protected]>
+
Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
https://bugs.webkit.org/show_bug.cgi?id=183783
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp (229793 => 229794)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp 2018-03-21 07:16:07 UTC (rev 229794)
@@ -207,6 +207,8 @@
normalizedValue = normalizedAnimationValueForFillsForwards(m_animation->iterationCount(), m_animation->direction());
}
+ applicationResults.hasRunningAnimations |= (m_state == AnimationState::Playing);
+
if (!normalizedValue) {
applyInternal(applicationResults, m_keyframes.at(0), m_keyframes.at(1), 0);
return;
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h (229793 => 229794)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h 2018-03-21 07:16:07 UTC (rev 229794)
@@ -34,6 +34,7 @@
std::optional<TransformationMatrix> transform;
std::optional<double> opacity;
std::optional<FilterOperations> filters;
+ bool hasRunningAnimations { false };
};
TextureMapperAnimation()
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (229793 => 229794)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2018-03-21 07:16:07 UTC (rev 229794)
@@ -630,14 +630,15 @@
});
}
-void TextureMapperLayer::applyAnimationsRecursively(MonotonicTime time)
+bool TextureMapperLayer::applyAnimationsRecursively(MonotonicTime time)
{
- syncAnimations(time);
+ bool hasRunningAnimations = syncAnimations(time);
for (auto* child : m_children)
- child->applyAnimationsRecursively(time);
+ hasRunningAnimations |= child->applyAnimationsRecursively(time);
+ return hasRunningAnimations;
}
-void TextureMapperLayer::syncAnimations(MonotonicTime time)
+bool TextureMapperLayer::syncAnimations(MonotonicTime time)
{
TextureMapperAnimation::ApplicationResult applicationResults;
m_animations.apply(applicationResults, time);
@@ -645,6 +646,8 @@
m_currentTransform.setLocalTransform(applicationResults.transform.value_or(m_state.transform));
m_currentOpacity = applicationResults.opacity.value_or(m_state.opacity);
m_currentFilters = applicationResults.filters.value_or(m_state.filters);
+
+ return applicationResults.hasRunningAnimations;
}
bool TextureMapperLayer::isAncestorFixedToViewport() const
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h (229793 => 229794)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h 2018-03-21 07:16:07 UTC (rev 229794)
@@ -92,7 +92,8 @@
bool fixedToViewport() const { return m_fixedToViewport; }
void setBackingStore(RefPtr<TextureMapperBackingStore>&&);
- void syncAnimations(MonotonicTime);
+ bool applyAnimationsRecursively(MonotonicTime);
+ bool syncAnimations(MonotonicTime);
bool descendantsOrSelfHaveRunningAnimations() const;
void paint();
@@ -99,7 +100,6 @@
void setScrollPositionDeltaIfNeeded(const FloatSize&);
- void applyAnimationsRecursively(MonotonicTime);
void addChild(TextureMapperLayer*);
private:
Modified: trunk/Source/WebKit/ChangeLog (229793 => 229794)
--- trunk/Source/WebKit/ChangeLog 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebKit/ChangeLog 2018-03-21 07:16:07 UTC (rev 229794)
@@ -1,3 +1,20 @@
+2018-03-21 Zan Dobersek <[email protected]>
+
+ [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
+ https://bugs.webkit.org/show_bug.cgi?id=183771
+
+ Reviewed by Carlos Garcia Campos.
+
+ In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
+ information about any running animation in the scene via the
+ TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
+ value at the end up the method, instead of again traversing the
+ TextureMapperLayer tree to determine whether any running animations are
+ present.
+
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+ (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
+
2018-03-20 Tim Horton <[email protected]>
Enable the minimal simulator feature flag when appropriate
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (229793 => 229794)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-03-21 07:15:23 UTC (rev 229793)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-03-21 07:16:07 UTC (rev 229794)
@@ -103,7 +103,7 @@
#endif
currentRootLayer->setTextureMapper(m_textureMapper.get());
- currentRootLayer->applyAnimationsRecursively(MonotonicTime::now());
+ bool sceneHasRunningAnimations = currentRootLayer->applyAnimationsRecursively(MonotonicTime::now());
m_textureMapper->beginPainting(PaintFlags);
m_textureMapper->beginClip(TransformationMatrix(), clipRect);
@@ -125,7 +125,7 @@
m_textureMapper->endClip();
m_textureMapper->endPainting();
- if (currentRootLayer->descendantsOrSelfHaveRunningAnimations())
+ if (sceneHasRunningAnimations)
updateViewport();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes