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

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

Issue 2338803003: Blink Compositor Animation: CompositorPlayer::addAnimation to use unique_ptr. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // Make sure we have displayed for at least minPreFadeDuration before starti ng to fade out. 317 // Make sure we have displayed for at least minPreFadeDuration before starti ng to fade out.
318 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast <float>(monotonicallyIncreasingTime() - m_startTime)); 318 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast <float>(monotonicallyIncreasingTime() - m_startTime));
319 if (extraDurationRequired) 319 if (extraDurationRequired)
320 curve->addKeyframe(CompositorFloatKeyframe(extraDurationRequired, startO pacity, timingFunction)); 320 curve->addKeyframe(CompositorFloatKeyframe(extraDurationRequired, startO pacity, timingFunction));
321 // For layout tests we don't fade out. 321 // For layout tests we don't fade out.
322 curve->addKeyframe(CompositorFloatKeyframe(fadeDuration + extraDurationRequi red, layoutTestMode() ? startOpacity : 0, timingFunction)); 322 curve->addKeyframe(CompositorFloatKeyframe(fadeDuration + extraDurationRequi red, layoutTestMode() ? startOpacity : 0, timingFunction));
323 323
324 std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create (*curve, CompositorTargetProperty::OPACITY, 0, 0); 324 std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create (*curve, CompositorTargetProperty::OPACITY, 0, 0);
325 325
326 m_contentLayer->layer()->setDrawsContent(true); 326 m_contentLayer->layer()->setDrawsContent(true);
327 m_compositorPlayer->addAnimation(animation.release()); 327 m_compositorPlayer->addAnimation(std::move(animation));
328 328
329 invalidate(); 329 invalidate();
330 m_owningWebViewImpl->mainFrameImpl()->frameWidget()->scheduleAnimation(); 330 m_owningWebViewImpl->mainFrameImpl()->frameWidget()->scheduleAnimation();
331 } 331 }
332 332
333 void LinkHighlightImpl::clearGraphicsLayerLinkHighlightPointer() 333 void LinkHighlightImpl::clearGraphicsLayerLinkHighlightPointer()
334 { 334 {
335 if (m_currentGraphicsLayer) { 335 if (m_currentGraphicsLayer) {
336 m_currentGraphicsLayer->removeLinkHighlight(this); 336 m_currentGraphicsLayer->removeLinkHighlight(this);
337 m_currentGraphicsLayer = 0; 337 m_currentGraphicsLayer = 0;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 { 398 {
399 return clipLayer(); 399 return clipLayer();
400 } 400 }
401 401
402 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const 402 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const
403 { 403 {
404 return m_compositorPlayer.get(); 404 return m_compositorPlayer.get();
405 } 405 }
406 406
407 } // namespace blink 407 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698