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

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: Let CC clients generate their own ElementIds locally. 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 m_contentLayer->layer()->setElementId(nextCompositorElementId());
94 m_compositorPlayer->attachElement(m_contentLayer->layer()->elementId());
93 95
94 m_contentLayer->layer()->setDrawsContent(true); 96 m_contentLayer->layer()->setDrawsContent(true);
95 m_contentLayer->layer()->setOpacity(1); 97 m_contentLayer->layer()->setOpacity(1);
96 m_geometryNeedsUpdate = true; 98 m_geometryNeedsUpdate = true;
97 } 99 }
98 100
99 LinkHighlightImpl::~LinkHighlightImpl() 101 LinkHighlightImpl::~LinkHighlightImpl()
100 { 102 {
101 if (m_compositorPlayer->isLayerAttached()) 103 if (m_compositorPlayer->isElementAttached())
102 m_compositorPlayer->detachLayer(); 104 m_compositorPlayer->detachElement();
103 if (m_owningWebViewImpl->linkHighlightsTimeline()) 105 if (m_owningWebViewImpl->linkHighlightsTimeline())
104 m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this); 106 m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this);
105 m_compositorPlayer->setAnimationDelegate(nullptr); 107 m_compositorPlayer->setAnimationDelegate(nullptr);
106 m_compositorPlayer.clear(); 108 m_compositorPlayer.clear();
107 109
108 clearGraphicsLayerLinkHighlightPointer(); 110 clearGraphicsLayerLinkHighlightPointer();
109 releaseResources(); 111 releaseResources();
110 } 112 }
111 113
112 WebContentLayer* LinkHighlightImpl::contentLayer() 114 WebContentLayer* LinkHighlightImpl::contentLayer()
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 { 380 {
379 return clipLayer(); 381 return clipLayer();
380 } 382 }
381 383
382 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const 384 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const
383 { 385 {
384 return m_compositorPlayer.get(); 386 return m_compositorPlayer.get();
385 } 387 }
386 388
387 } // namespace blink 389 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698