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

Unified Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 1739743003: Blink Compositor Animation: Erase old animation system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude histograms.xml Created 4 years, 10 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
Index: third_party/WebKit/Source/web/LinkHighlightImpl.cpp
diff --git a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
index 4b4d726c7401d48dafa52032b7d0c1be35f50525..39da22bb47af01b8d382cb6a77a8eaa73a78c066 100644
--- a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
+++ b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
@@ -83,17 +83,14 @@ LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl)
m_clipLayer = adoptPtr(compositorSupport->createLayer());
m_clipLayer->setTransformOrigin(WebFloatPoint3D());
m_clipLayer->addChild(m_contentLayer->layer());
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
- m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer());
- ASSERT(m_compositorPlayer);
- m_compositorPlayer->setAnimationDelegate(this);
- if (m_owningWebViewImpl->linkHighlightsTimeline())
- 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(CompositorFactory::current().createAnimationPlayer());
+ ASSERT(m_compositorPlayer);
+ m_compositorPlayer->setAnimationDelegate(this);
+ if (m_owningWebViewImpl->linkHighlightsTimeline())
+ m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
+ m_compositorPlayer->attachLayer(m_contentLayer->layer());
+
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->setOpacity(1);
m_geometryNeedsUpdate = true;
@@ -101,13 +98,11 @@ LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl)
LinkHighlightImpl::~LinkHighlightImpl()
{
- if (m_compositorPlayer) {
- if (m_compositorPlayer->isLayerAttached())
- m_compositorPlayer->detachLayer();
- if (m_owningWebViewImpl->linkHighlightsTimeline())
- m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
- m_compositorPlayer->setAnimationDelegate(nullptr);
- }
+ if (m_compositorPlayer->isLayerAttached())
+ m_compositorPlayer->detachLayer();
+ if (m_owningWebViewImpl->linkHighlightsTimeline())
+ m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
+ m_compositorPlayer->setAnimationDelegate(nullptr);
m_compositorPlayer.clear();
clearGraphicsLayerLinkHighlightPointer();
@@ -308,10 +303,7 @@ void LinkHighlightImpl::startHighlightAnimationIfNeeded()
OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY));
m_contentLayer->layer()->setDrawsContent(true);
- if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled())
- m_compositorPlayer->addAnimation(animation.leakPtr());
- else
- m_contentLayer->layer()->addAnimation(animation->releaseCCAnimation());
+ m_compositorPlayer->addAnimation(animation.leakPtr());
invalidate();
m_owningWebViewImpl->scheduleAnimation();
« no previous file with comments | « third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.cpp ('k') | third_party/WebKit/Source/web/WebRuntimeFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698