Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1043)

Unified Diff: Source/web/LinkHighlight.cpp

Issue 1131833002: [Sketch] Animations: Torpedo the old intrusive animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@scroll
Patch Set: Delete more. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/GraphicsLayerFactoryChromium.cpp ('k') | Source/web/WebRuntimeFeatures.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/LinkHighlight.cpp
diff --git a/Source/web/LinkHighlight.cpp b/Source/web/LinkHighlight.cpp
index 983e1f2d933e4aafdaee4ff914c4842baa42a914..52766ff368d0c6dd0d53794805a9774a610a7fcf 100644
--- a/Source/web/LinkHighlight.cpp
+++ b/Source/web/LinkHighlight.cpp
@@ -81,16 +81,13 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
m_clipLayer = adoptPtr(compositorSupport->createLayer());
m_clipLayer->setTransformOrigin(WebFloatPoint3D());
m_clipLayer->addChild(m_contentLayer->layer());
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platform::current()->compositorSupport()) {
- m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->createAnimationPlayer());
- ASSERT(m_compositorPlayer);
- m_compositorPlayer->setAnimationDelegate(this);
- m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
- m_compositorPlayer->attachLayer(m_contentLayer->layer());
- } else {
- owningWebViewImpl->registerForAnimations(m_contentLayer->layer());
- m_contentLayer->layer()->setAnimationDelegate(this);
- }
+
+ m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->createAnimationPlayer());
+ ASSERT(m_compositorPlayer);
+ m_compositorPlayer->setAnimationDelegate(this);
+ m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
+ m_compositorPlayer->attachLayer(m_contentLayer->layer());
+
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->setOpacity(1);
m_geometryNeedsUpdate = true;
@@ -99,12 +96,9 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
LinkHighlight::~LinkHighlight()
{
- if (m_compositorPlayer) {
- m_compositorPlayer->detachLayer();
- m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
- m_compositorPlayer->setAnimationDelegate(nullptr);
- }
- m_compositorPlayer.clear();
+ m_compositorPlayer->detachLayer();
+ m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
+ m_compositorPlayer->setAnimationDelegate(nullptr);
clearGraphicsLayerLinkHighlightPointer();
releaseResources();
@@ -314,10 +308,8 @@ void LinkHighlight::startHighlightAnimationIfNeeded()
OwnPtr<WebCompositorAnimation> animation = adoptPtr(compositorSupport->createAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity));
m_contentLayer->layer()->setDrawsContent(true);
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled())
- m_compositorPlayer->addAnimation(animation.leakPtr());
- else
- m_contentLayer->layer()->addAnimation(animation.leakPtr());
+
+ m_compositorPlayer->addAnimation(animation.leakPtr());
invalidate();
m_owningWebViewImpl->scheduleAnimation();
« no previous file with comments | « Source/web/GraphicsLayerFactoryChromium.cpp ('k') | Source/web/WebRuntimeFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698