void LayerTreeHostQt::performScheduledLayerFlush() { #if USE(TILED_BACKING_STORE) if (m_isSuspended || m_waitingForUIProcess) return; #endif m_webPage->layoutIfNeeded(); if (!m_isValid) return; m_shouldSyncFrame = false; flushPendingLayerChanges(); if (!m_shouldSyncFrame) return; if (m_shouldSyncRootLayer) { m_webPage->send(Messages::LayerTreeHostProxy::SetRootCompositingLayer(toWebGraphicsLayer(m_rootLayer.get())->id())); m_shouldSyncRootLayer = false; } m_webPage->send(Messages::LayerTreeHostProxy::DidRenderFrame()); m_waitingForUIProcess = true; if (!m_notifyAfterScheduledLayerFlush) return; // Let the drawing area know that we've done a flush of the layer changes. static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); m_notifyAfterScheduledLayerFlush = false; }
void LayerTreeHostGtk::flushAndRenderLayers() { { RefPtr<LayerTreeHostGtk> protect(this); m_webPage->layoutIfNeeded(); if (!m_isValid) return; } GLContext* context = glContext(); if (!context || !context->makeContextCurrent()) return; m_lastFlushTime = currentTime(); if (!flushPendingLayerChanges()) return; // Our model is very simple. We always composite and render the tree immediately after updating it. compositeLayersToContext(); if (m_notifyAfterScheduledLayerFlush) { // Let the drawing area know that we've done a flush of the layer changes. static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); m_notifyAfterScheduledLayerFlush = false; } }
void LayerTreeCoordinator::forceRepaint() { // This is necessary for running layout tests. Since in this case we are not waiting for a UIProcess to reply nicely. // Instead we are just triggering forceRepaint. But we still want to have the scripted animation callbacks being executed. syncDisplayState(); // We need to schedule another flush, otherwise the forced paint might cancel a later expected flush. // This is aligned with LayerTreeHostCA. scheduleLayerFlush(); flushPendingLayerChanges(); }
void LayerTreeHostCA::sizeDidChange(const IntSize& newSize) { m_rootLayer->setSize(newSize); m_nonCompositedContentLayer->setSize(newSize); if (m_pageOverlayLayer) m_pageOverlayLayer->setSize(newSize); scheduleLayerFlush(); flushPendingLayerChanges(); }
void LayerTreeCoordinator::performScheduledLayerFlush() { if (m_isSuspended || m_waitingForUIProcess) return; syncDisplayState(); if (!m_isValid) return; if (flushPendingLayerChanges()) didPerformScheduledLayerFlush(); }
void AcceleratedCompositingContext::flushAndRenderLayers() { m_layerFlushTimerCallbackId = 0; if (!enabled()) return; Frame* frame = core(m_webView)->mainFrame(); if (!frame || !frame->contentRenderer() || !frame->view()) return; if (!flushPendingLayerChanges()) return; }
void LayerTreeHostCA::performScheduledLayerFlush() { { RefPtr<LayerTreeHostCA> protect(this); m_webPage->layoutIfNeeded(); if (!m_isValid) return; } if (!flushPendingLayerChanges()) return; didPerformScheduledLayerFlush(); }
void LayerTreeHostQt::performScheduledLayerFlush() { m_webPage->layoutIfNeeded(); if (!m_isValid) return; if (flushPendingLayerChanges()) { if (m_notifyAfterScheduledLayerFlush) { // Let the drawing area know that we've done a flush of the layer changes. static_cast<DrawingAreaImpl*>(m_webPage->drawingArea())->layerHostDidFlushLayers(); m_notifyAfterScheduledLayerFlush = false; } WebGraphicsLayer::sendLayersToUIProcess(m_rootLayer.get(), m_webPage); } }
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(); }
void LayerTreeHostCA::sizeDidChange(const IntSize& newSize) { m_rootLayer->setSize(newSize); // If the newSize exposes new areas of the non-composited content a setNeedsDisplay is needed // for those newly exposed areas. FloatSize oldSize = m_nonCompositedContentLayer->size(); m_nonCompositedContentLayer->setSize(newSize); if (newSize.width() > oldSize.width()) { float height = std::min(static_cast<float>(newSize.height()), oldSize.height()); m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(oldSize.width(), 0, newSize.width() - oldSize.width(), height)); } if (newSize.height() > oldSize.height()) m_nonCompositedContentLayer->setNeedsDisplayInRect(FloatRect(0, oldSize.height(), newSize.width(), newSize.height() - oldSize.height())); if (m_pageOverlayLayer) m_pageOverlayLayer->setSize(newSize); scheduleLayerFlush(); flushPendingLayerChanges(); }
void LayerTreeHostCA::forceRepaint() { scheduleLayerFlush(); flushPendingLayerChanges(); }