WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::handleGestureFling(const WebGestureEvent& gestureEvent) { WebInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(WebPoint(gestureEvent.x, gestureEvent.y), WebInputHandlerClient::ScrollInputTypeGesture); switch (scrollStatus) { case WebInputHandlerClient::ScrollStatusStarted: { if (gestureEvent.data.flingStart.sourceDevice == WebGestureEvent::Touchpad) m_inputHandlerClient->scrollEnd(); m_flingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(gestureEvent.data.flingStart.sourceDevice, WebFloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY), WebSize())); TRACE_EVENT_ASYNC_BEGIN0("webkit", "WebCompositorInputHandlerImpl::handleGestureFling::started", this); m_flingParameters.delta = WebFloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY); m_flingParameters.point = WebPoint(gestureEvent.x, gestureEvent.y); m_flingParameters.globalPoint = WebPoint(gestureEvent.globalX, gestureEvent.globalY); m_flingParameters.modifiers = gestureEvent.modifiers; m_flingParameters.sourceDevice = gestureEvent.data.flingStart.sourceDevice; m_inputHandlerClient->scheduleAnimation(); return DidHandle; } case WebInputHandlerClient::ScrollStatusOnMainThread: { TRACE_EVENT_INSTANT0("webkit", "WebCompositorInputHandlerImpl::handleGestureFling::scrollOnMainThread"); m_flingActiveOnMainThread = true; return DidNotHandle; } case WebInputHandlerClient::ScrollStatusIgnored: { TRACE_EVENT_INSTANT0("webkit", "WebCompositorInputHandlerImpl::handleGestureFling::ignored"); if (gestureEvent.data.flingStart.sourceDevice == WebGestureEvent::Touchpad) { // We still pass the curve to the main thread if there's nothing scrollable, in case something // registers a handler before the curve is over. return DidNotHandle; } return DropEvent; } } return DidNotHandle; }
AnimationPlayer::PlayStateUpdateScope::~PlayStateUpdateScope() { AnimationPlayState oldPlayState = m_initial; AnimationPlayState newPlayState = m_player->calculatePlayState(); if (oldPlayState != newPlayState) { bool wasActive = oldPlayState == Pending || oldPlayState == Running; bool isActive = newPlayState == Pending || newPlayState == Running; if (!wasActive && isActive) { if (m_player->m_content) { TRACE_EVENT_ASYNC_BEGIN1("blink", "Animation", &m_player, "Name", TRACE_STR_COPY(m_player->m_content->name().utf8().data())); } else { TRACE_EVENT_ASYNC_BEGIN0("blink", "Animation", &m_player); } } else if (wasActive && !isActive) { if (oldPlayState != Idle && oldPlayState != Finished) { TRACE_EVENT_ASYNC_END0("blink", "Animation", &m_player); } } if (isActive) { TRACE_EVENT_ASYNC_STEP_INTO0("blink", "Animation", &m_player, playStateString(newPlayState)); } } if (oldPlayState != newPlayState && (oldPlayState == Idle || newPlayState == Idle)) { m_player->setOutdated(); } m_player->m_playState = newPlayState; #if ENABLE(ASSERT) // Verify that current time is up to date. m_player->currentTimeInternal(); #endif switch (m_compositorPendingChange) { case SetCompositorPending: m_player->setCompositorPending(); break; case SetCompositorPendingWithSourceChanged: m_player->setCompositorPending(true); break; case DoNotSetCompositorPending: break; default: ASSERT_NOT_REACHED(); break; } m_player->endUpdatingState(); }