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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.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) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 m_compositorAnimationGroupId = 0; 309 m_compositorAnimationGroupId = 0;
310 310
311 m_animationCurve->updateTarget(m_timeFunction() - m_startTime, 311 m_animationCurve->updateTarget(m_timeFunction() - m_startTime,
312 compositorOffsetFromBlinkOffset(m_targetOffset)); 312 compositorOffsetFromBlinkOffset(m_targetOffset));
313 if (m_runState == RunState::WaitingToCancelOnCompositorButNewScroll) 313 if (m_runState == RunState::WaitingToCancelOnCompositorButNewScroll)
314 m_animationCurve->setInitialValue(compositorOffsetFromBlinkOffset(cu rrentPosition())); 314 m_animationCurve->setInitialValue(compositorOffsetFromBlinkOffset(cu rrentPosition()));
315 m_runState = RunState::WaitingToSendToCompositor; 315 m_runState = RunState::WaitingToSendToCompositor;
316 } 316 }
317 317
318 if (m_runState == RunState::WaitingToSendToCompositor) { 318 if (m_runState == RunState::WaitingToSendToCompositor) {
319 if (!m_compositorAnimationAttachedToLayerId) 319 if (!m_compositorAnimationAttachedToElementId)
320 reattachCompositorPlayerIfNeeded(getScrollableArea()->compositorAnim ationTimeline()); 320 reattachCompositorPlayerIfNeeded(getScrollableArea()->compositorAnim ationTimeline());
321 321
322 if (!m_animationCurve) { 322 if (!m_animationCurve) {
323 m_animationCurve = adoptPtr(CompositorFactory::current().createScrol lOffsetAnimationCurve( 323 m_animationCurve = adoptPtr(CompositorFactory::current().createScrol lOffsetAnimationCurve(
324 compositorOffsetFromBlinkOffset(m_targetOffset), 324 compositorOffsetFromBlinkOffset(m_targetOffset),
325 CompositorAnimationCurve::TimingFunctionTypeEaseInOut, 325 CompositorAnimationCurve::TimingFunctionTypeEaseInOut,
326 m_lastGranularity == ScrollByPixel ? 326 m_lastGranularity == ScrollByPixel ?
327 CompositorScrollOffsetAnimationCurve::ScrollDurationInverseD elta : 327 CompositorScrollOffsetAnimationCurve::ScrollDurationInverseD elta :
328 CompositorScrollOffsetAnimationCurve::ScrollDurationConstant )); 328 CompositorScrollOffsetAnimationCurve::ScrollDurationConstant ));
329 m_animationCurve->setInitialValue(compositorOffsetFromBlinkOffset(cu rrentPosition())); 329 m_animationCurve->setInitialValue(compositorOffsetFromBlinkOffset(cu rrentPosition()));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 426 }
427 return true; 427 return true;
428 } 428 }
429 429
430 DEFINE_TRACE(ScrollAnimator) 430 DEFINE_TRACE(ScrollAnimator)
431 { 431 {
432 ScrollAnimatorBase::trace(visitor); 432 ScrollAnimatorBase::trace(visitor);
433 } 433 }
434 434
435 } // namespace blink 435 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698