//___________________________________________________________________ void LabelData::timerEvent( QTimerEvent* event ) { if ( event->timerId() == timer_.timerId() ) { timer_.stop(); // check transition and widget validity if ( !( enabled() && target_ && transition() ) ) return; // assign end pixmap transition().data()->setEndPixmap( transition().data()->grab( target_.data() ) ); // start animation animate(); } else if ( event->timerId() == animationLockTimer_.timerId() ) { unlockAnimations(); // check transition and widget validity if ( !( enabled() && target_ && transition() ) ) return; // reassign end pixmap for the next transition to be properly initialized transition().data()->setEndPixmap( transition().data()->grab( target_.data() ) ); } else return TransitionData::timerEvent( event ); }
bool CoordinatedLayerTreeHost::flushPendingLayerChanges() { if (m_waitingForUIProcess) return false; TemporaryChange<bool> protector(m_isFlushingLayerChanges, true); createCompositingLayers(); initializeRootCompositingLayerIfNeeded(); m_rootLayer->flushCompositingStateForThisLayerOnly(); m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly(); if (m_pageOverlayLayer) m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes(); flushPendingImageBackingChanges(); deleteCompositingLayers(); if (m_shouldSyncFrame) { didSync = true; m_state.contentsSize = roundedIntSize(m_nonCompositedContentLayer->size()); m_state.coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect(); m_state.scrollPosition = m_visibleContentsRect.location(); m_webPage->send(Messages::CoordinatedLayerTreeHostProxy::CommitCoordinatedGraphicsState(m_state)); m_state.layersToUpdate.clear(); m_state.imagesToUpdate.clear(); m_waitingForUIProcess = true; m_shouldSyncFrame = false; } else unlockAnimations(); if (m_forceRepaintAsyncCallbackID) { m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); m_forceRepaintAsyncCallbackID = 0; } return didSync; }
bool LayerTreeCoordinator::flushPendingLayerChanges() { if (m_waitingForUIProcess) return false; for (size_t i = 0; i < m_detachedLayers.size(); ++i) m_webPage->send(Messages::LayerTreeCoordinatorProxy::DeleteCompositingLayer(m_detachedLayers[i])); m_detachedLayers.clear(); bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes(); m_nonCompositedContentLayer->flushCompositingStateForThisLayerOnly(); if (m_pageOverlayLayer) m_pageOverlayLayer->flushCompositingStateForThisLayerOnly(); m_rootLayer->flushCompositingStateForThisLayerOnly(); purgeReleasedImages(); if (m_shouldSyncRootLayer) { m_webPage->send(Messages::LayerTreeCoordinatorProxy::SetRootCompositingLayer(toCoordinatedGraphicsLayer(m_rootLayer.get())->id())); m_shouldSyncRootLayer = false; } if (m_shouldSyncFrame) { didSync = true; IntSize contentsSize = roundedIntSize(m_nonCompositedContentLayer->size()); IntRect coveredRect = toCoordinatedGraphicsLayer(m_nonCompositedContentLayer.get())->coverRect(); m_webPage->send(Messages::LayerTreeCoordinatorProxy::DidRenderFrame(contentsSize, coveredRect)); m_waitingForUIProcess = true; m_shouldSyncFrame = false; } else unlockAnimations(); if (m_forceRepaintAsyncCallbackID) { m_webPage->send(Messages::WebPageProxy::VoidCallback(m_forceRepaintAsyncCallbackID)); m_forceRepaintAsyncCallbackID = 0; } return didSync; }
void LayerTreeCoordinator::performScheduledLayerFlush() { if (m_isSuspended || m_waitingForUIProcess) return; // We lock the animations while performing layout, to avoid flickers caused by animations continuing in the UI process while // the web process layout wants to cancel them. lockAnimations(); syncDisplayState(); // We can unlock the animations before flushing if there are no visible changes, for example if there are content updates // in a layer with opacity 0. bool canUnlockBeforeFlush = !m_isValid || !toCoordinatedGraphicsLayer(m_rootLayer.get())->hasPendingVisibleChanges(); if (canUnlockBeforeFlush) unlockAnimations(); if (!m_isValid) return; if (flushPendingLayerChanges()) didPerformScheduledLayerFlush(); }