| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::cu
rrent().createFloatAnimationCurve()); | 298 OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::cu
rrent().createFloatAnimationCurve()); |
| 299 | 299 |
| 300 curve->add(CompositorFloatKeyframe(0, startOpacity)); | 300 curve->add(CompositorFloatKeyframe(0, startOpacity)); |
| 301 // Make sure we have displayed for at least minPreFadeDuration before starti
ng to fade out. | 301 // Make sure we have displayed for at least minPreFadeDuration before starti
ng to fade out. |
| 302 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast
<float>(monotonicallyIncreasingTime() - m_startTime)); | 302 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast
<float>(monotonicallyIncreasingTime() - m_startTime)); |
| 303 if (extraDurationRequired) | 303 if (extraDurationRequired) |
| 304 curve->add(CompositorFloatKeyframe(extraDurationRequired, startOpacity))
; | 304 curve->add(CompositorFloatKeyframe(extraDurationRequired, startOpacity))
; |
| 305 // For layout tests we don't fade out. | 305 // For layout tests we don't fade out. |
| 306 curve->add(CompositorFloatKeyframe(fadeDuration + extraDurationRequired, lay
outTestMode() ? startOpacity : 0)); | 306 curve->add(CompositorFloatKeyframe(fadeDuration + extraDurationRequired, lay
outTestMode() ? startOpacity : 0)); |
| 307 | 307 |
| 308 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::current(
).createAnimation(*curve, CompositorAnimation::TargetPropertyOpacity)); | 308 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::current(
).createAnimation(*curve, CompositorTargetProperty::OPACITY)); |
| 309 | 309 |
| 310 m_contentLayer->layer()->setDrawsContent(true); | 310 m_contentLayer->layer()->setDrawsContent(true); |
| 311 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) | 311 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) |
| 312 m_compositorPlayer->addAnimation(animation.leakPtr()); | 312 m_compositorPlayer->addAnimation(animation.leakPtr()); |
| 313 else | 313 else |
| 314 m_contentLayer->layer()->addAnimation(animation->releaseCCAnimation()); | 314 m_contentLayer->layer()->addAnimation(animation->releaseCCAnimation()); |
| 315 | 315 |
| 316 invalidate(); | 316 invalidate(); |
| 317 m_owningWebViewImpl->scheduleAnimation(); | 317 m_owningWebViewImpl->scheduleAnimation(); |
| 318 } | 318 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 { | 380 { |
| 381 return clipLayer(); | 381 return clipLayer(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const | 384 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const |
| 385 { | 385 { |
| 386 return m_compositorPlayer.get(); | 386 return m_compositorPlayer.get(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace blink | 389 } // namespace blink |
| OLD | NEW |