Changeset 229317 in webkit
- Timestamp:
- Mar 6, 2018 3:51:53 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229316 r229317 1 2018-03-06 Zan Dobersek <zdobersek@igalia.com> 2 3 [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value 4 https://bugs.webkit.org/show_bug.cgi?id=183360 5 6 Reviewed by Sergio Villar Senin. 7 8 When animations are being applied on the TextureMapperLayer tree, the 9 monotonic time value is retrieved repeatedly in TextureMapperAnimation 10 class. Instead of spawning repeated syscalls that are required to obtain 11 the time value, TextureMapperLayer::applyAnimationsRecursively() now 12 accepts a MonotonicTime value that should be used for all animation 13 updates. 14 15 No new tests -- no change in behavior. 16 17 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 18 (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): 19 * platform/graphics/texmap/TextureMapperAnimation.cpp: 20 (WebCore::TextureMapperAnimation::apply): 21 (WebCore::TextureMapperAnimation::computeTotalRunningTime): 22 (WebCore::TextureMapperAnimations::apply): 23 * platform/graphics/texmap/TextureMapperAnimation.h: 24 (WebCore::TextureMapperAnimation::keyframes const): 25 (WebCore::TextureMapperAnimation::animation const): 26 (WebCore::TextureMapperAnimation::boxSize const): Deleted. 27 (WebCore::TextureMapperAnimation::listsMatch const): Deleted. 28 (WebCore::TextureMapperAnimation::startTime const): Deleted. 29 (WebCore::TextureMapperAnimation::pauseTime const): Deleted. 30 * platform/graphics/texmap/TextureMapperLayer.cpp: 31 (WebCore::TextureMapperLayer::applyAnimationsRecursively): 32 (WebCore::TextureMapperLayer::syncAnimations): 33 * platform/graphics/texmap/TextureMapperLayer.h: 34 1 35 2018-03-06 Zan Dobersek <zdobersek@igalia.com> 2 36 -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r229313 r229317 367 367 prepareBackingStoreIfNeeded(); 368 368 commitLayerChanges(); 369 m_layer.syncAnimations( );369 m_layer.syncAnimations(MonotonicTime::now()); 370 370 } 371 371 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp
r229209 r229317 193 193 } 194 194 195 void TextureMapperAnimation::apply(Client& client )195 void TextureMapperAnimation::apply(Client& client, MonotonicTime time) 196 196 { 197 197 if (!isActive()) 198 198 return; 199 199 200 Seconds totalRunningTime = computeTotalRunningTime( );200 Seconds totalRunningTime = computeTotalRunningTime(time); 201 201 double normalizedValue = normalizedAnimationValue(totalRunningTime.seconds(), m_animation->duration(), m_animation->direction(), m_animation->iterationCount()); 202 202 … … 254 254 } 255 255 256 Seconds TextureMapperAnimation::computeTotalRunningTime( )256 Seconds TextureMapperAnimation::computeTotalRunningTime(MonotonicTime time) 257 257 { 258 258 if (m_state == AnimationState::Paused) … … 260 260 261 261 MonotonicTime oldLastRefreshedTime = m_lastRefreshedTime; 262 m_lastRefreshedTime = MonotonicTime::now();262 m_lastRefreshedTime = time; 263 263 m_totalRunningTime += m_lastRefreshedTime - oldLastRefreshedTime; 264 264 return m_totalRunningTime; … … 331 331 } 332 332 333 void TextureMapperAnimations::apply(TextureMapperAnimation::Client& client )333 void TextureMapperAnimations::apply(TextureMapperAnimation::Client& client, MonotonicTime time) 334 334 { 335 335 for (auto& animation : m_animations) 336 animation.apply(client );336 animation.apply(client, time); 337 337 } 338 338 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h
r229174 r229317 44 44 WEBCORE_EXPORT TextureMapperAnimation(const TextureMapperAnimation&); 45 45 46 void apply(Client& );46 void apply(Client&, MonotonicTime); 47 47 void pause(Seconds); 48 48 void resume(); … … 51 51 const String& name() const { return m_name; } 52 52 const KeyframeValueList& keyframes() const { return m_keyframes; } 53 const FloatSize& boxSize() const { return m_boxSize; }54 53 const RefPtr<Animation> animation() const { return m_animation; } 55 bool listsMatch() const { return m_listsMatch; }56 MonotonicTime startTime() const { return m_startTime; }57 Seconds pauseTime() const { return m_pauseTime; }58 54 AnimationState state() const { return m_state; } 59 55 60 56 private: 61 57 void applyInternal(Client&, const AnimationValue& from, const AnimationValue& to, float progress); 62 Seconds computeTotalRunningTime( );58 Seconds computeTotalRunningTime(MonotonicTime); 63 59 64 60 String m_name; … … 85 81 void resume(); 86 82 87 void apply(TextureMapperAnimation::Client& );83 void apply(TextureMapperAnimation::Client&, MonotonicTime); 88 84 89 85 bool isEmpty() const { return m_animations.isEmpty(); } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r227729 r229317 662 662 } 663 663 664 void TextureMapperLayer::applyAnimationsRecursively( )665 { 666 syncAnimations( );664 void TextureMapperLayer::applyAnimationsRecursively(MonotonicTime time) 665 { 666 syncAnimations(time); 667 667 for (auto* child : m_children) 668 child->applyAnimationsRecursively( );669 } 670 671 void TextureMapperLayer::syncAnimations( )672 { 673 m_animations.apply(*this );668 child->applyAnimationsRecursively(time); 669 } 670 671 void TextureMapperLayer::syncAnimations(MonotonicTime time) 672 { 673 m_animations.apply(*this, time); 674 674 if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyTransform)) 675 675 m_currentTransform.setLocalTransform(m_state.transform); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r226657 r229317 120 120 void setBackingStore(RefPtr<TextureMapperBackingStore>&&); 121 121 122 void syncAnimations( );122 void syncAnimations(MonotonicTime); 123 123 bool descendantsOrSelfHaveRunningAnimations() const; 124 124 … … 127 127 void setScrollPositionDeltaIfNeeded(const FloatSize&); 128 128 129 void applyAnimationsRecursively( );129 void applyAnimationsRecursively(MonotonicTime); 130 130 void addChild(TextureMapperLayer*); 131 131 -
trunk/Source/WebKit/ChangeLog
r229316 r229317 1 2018-03-06 Zan Dobersek <zdobersek@igalia.com> 2 3 [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value 4 https://bugs.webkit.org/show_bug.cgi?id=183360 5 6 Reviewed by Sergio Villar Senin. 7 8 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: 9 (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): 10 Pass the monotic time value, as returned by MonotonicTime::now(), to the 11 TextureMapperLayer::applyAnimationsRecursively() call. 12 1 13 2018-03-06 Zan Dobersek <zdobersek@igalia.com> 2 14 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
r229315 r229317 104 104 105 105 currentRootLayer->setTextureMapper(m_textureMapper.get()); 106 currentRootLayer->applyAnimationsRecursively( );106 currentRootLayer->applyAnimationsRecursively(MonotonicTime::now()); 107 107 m_textureMapper->beginPainting(PaintFlags); 108 108 m_textureMapper->beginClip(TransformationMatrix(), clipRect);
Note: See TracChangeset
for help on using the changeset viewer.