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

Side by Side Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 m_contentLayer = adoptPtr(compositorSupport->createContentLayer(this)); 82 m_contentLayer = adoptPtr(compositorSupport->createContentLayer(this));
83 m_clipLayer = adoptPtr(compositorSupport->createLayer()); 83 m_clipLayer = adoptPtr(compositorSupport->createLayer());
84 m_clipLayer->setTransformOrigin(WebFloatPoint3D()); 84 m_clipLayer->setTransformOrigin(WebFloatPoint3D());
85 m_clipLayer->addChild(m_contentLayer->layer()); 85 m_clipLayer->addChild(m_contentLayer->layer());
86 86
87 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPl ayer()); 87 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPl ayer());
88 DCHECK(m_compositorPlayer); 88 DCHECK(m_compositorPlayer);
89 m_compositorPlayer->setAnimationDelegate(this); 89 m_compositorPlayer->setAnimationDelegate(this);
90 if (m_owningWebViewImpl->linkHighlightsTimeline()) 90 if (m_owningWebViewImpl->linkHighlightsTimeline())
91 m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this); 91 m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this);
92 m_compositorPlayer->attachLayer(m_contentLayer->layer()); 92
93 DCHECK(node->isElementNode());
94 m_contentLayer->layer()->setElementId(toElement(node)->compositorElementId() );
95 m_compositorPlayer->attachElement(m_contentLayer->layer()->elementId());
93 96
94 m_contentLayer->layer()->setDrawsContent(true); 97 m_contentLayer->layer()->setDrawsContent(true);
95 m_contentLayer->layer()->setOpacity(1); 98 m_contentLayer->layer()->setOpacity(1);
96 m_geometryNeedsUpdate = true; 99 m_geometryNeedsUpdate = true;
97 } 100 }
98 101
99 LinkHighlightImpl::~LinkHighlightImpl() 102 LinkHighlightImpl::~LinkHighlightImpl()
100 { 103 {
101 if (m_compositorPlayer->isLayerAttached()) 104 if (m_compositorPlayer->isElementAttached())
102 m_compositorPlayer->detachLayer(); 105 m_compositorPlayer->detachElement();
103 if (m_owningWebViewImpl->linkHighlightsTimeline()) 106 if (m_owningWebViewImpl->linkHighlightsTimeline())
104 m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this); 107 m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
105 m_compositorPlayer->setAnimationDelegate(nullptr); 108 m_compositorPlayer->setAnimationDelegate(nullptr);
106 m_compositorPlayer.clear(); 109 m_compositorPlayer.clear();
107 110
108 clearGraphicsLayerLinkHighlightPointer(); 111 clearGraphicsLayerLinkHighlightPointer();
109 releaseResources(); 112 releaseResources();
110 } 113 }
111 114
112 WebContentLayer* LinkHighlightImpl::contentLayer() 115 WebContentLayer* LinkHighlightImpl::contentLayer()
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 { 381 {
379 return clipLayer(); 382 return clipLayer();
380 } 383 }
381 384
382 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const 385 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const
383 { 386 {
384 return m_compositorPlayer.get(); 387 return m_compositorPlayer.get();
385 } 388 }
386 389
387 } // namespace blink 390 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698