| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 std::unique_ptr<CompositorFloatAnimationCurve> curve = | 307 std::unique_ptr<CompositorFloatAnimationCurve> curve = |
| 308 CompositorFloatAnimationCurve::create(); | 308 CompositorFloatAnimationCurve::create(); |
| 309 | 309 |
| 310 const auto& timingFunction = *CubicBezierTimingFunction::preset( | 310 const auto& timingFunction = *CubicBezierTimingFunction::preset( |
| 311 CubicBezierTimingFunction::EaseType::EASE); | 311 CubicBezierTimingFunction::EaseType::EASE); |
| 312 | 312 |
| 313 curve->addKeyframe(CompositorFloatKeyframe(0, startOpacity, timingFunction)); | 313 curve->addKeyframe(CompositorFloatKeyframe(0, startOpacity, timingFunction)); |
| 314 // Make sure we have displayed for at least minPreFadeDuration before starting | 314 // Make sure we have displayed for at least minPreFadeDuration before starting |
| 315 // to fade out. | 315 // to fade out. |
| 316 float extraDurationRequired = std::max( | 316 float extraDurationRequired = std::max( |
| 317 0.f, minPreFadeDuration - | 317 0.f, |
| 318 static_cast<float>(monotonicallyIncreasingTime() - m_startTime)); | 318 minPreFadeDuration - |
| 319 static_cast<float>(monotonicallyIncreasingTime() - m_startTime)); |
| 319 if (extraDurationRequired) | 320 if (extraDurationRequired) |
| 320 curve->addKeyframe(CompositorFloatKeyframe(extraDurationRequired, | 321 curve->addKeyframe(CompositorFloatKeyframe(extraDurationRequired, |
| 321 startOpacity, timingFunction)); | 322 startOpacity, timingFunction)); |
| 322 // For layout tests we don't fade out. | 323 // For layout tests we don't fade out. |
| 323 curve->addKeyframe(CompositorFloatKeyframe( | 324 curve->addKeyframe(CompositorFloatKeyframe( |
| 324 fadeDuration + extraDurationRequired, layoutTestMode() ? startOpacity : 0, | 325 fadeDuration + extraDurationRequired, layoutTestMode() ? startOpacity : 0, |
| 325 timingFunction)); | 326 timingFunction)); |
| 326 | 327 |
| 327 std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create( | 328 std::unique_ptr<CompositorAnimation> animation = CompositorAnimation::create( |
| 328 *curve, CompositorTargetProperty::OPACITY, 0, 0); | 329 *curve, CompositorTargetProperty::OPACITY, 0, 0); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 402 |
| 402 WebLayer* LinkHighlightImpl::layer() { | 403 WebLayer* LinkHighlightImpl::layer() { |
| 403 return clipLayer(); | 404 return clipLayer(); |
| 404 } | 405 } |
| 405 | 406 |
| 406 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { | 407 CompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const { |
| 407 return m_compositorPlayer.get(); | 408 return m_compositorPlayer.get(); |
| 408 } | 409 } |
| 409 | 410 |
| 410 } // namespace blink | 411 } // namespace blink |
| OLD | NEW |