| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |