void ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea(ScrollableArea* scrollableArea) { CoordinatedGraphicsLayer* layer = toCoordinatedGraphicsLayer(scrollLayerForScrollableArea(scrollableArea)); if (!layer) return; layer->setScrollableArea(0); }
std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayerClient* client) { CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client); layer->setCoordinator(this); m_registeredLayers.add(layer->id(), layer); m_state.layersToCreate.append(layer->id()); layer->setNeedsVisibleRectAdjustment(); notifyFlushRequired(layer); return std::unique_ptr<GraphicsLayer>(layer); }
PassOwnPtr<GraphicsLayer> CoordinatedLayerTreeHost::createGraphicsLayer(GraphicsLayerClient* client) { CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client); layer->setCoordinator(this); m_registeredLayers.add(layer->id(), layer); m_layersToCreate.append(layer->id()); layer->setNeedsVisibleRectAdjustment(); scheduleLayerFlush(); return adoptPtr(layer); }
CoordinatedLayerTreeHost::CoordinatedLayerTreeHost(WebPage* webPage) : LayerTreeHost(webPage) , m_notifyAfterScheduledLayerFlush(false) , m_isValid(true) , m_isPurging(false) , m_isFlushingLayerChanges(false) , m_waitingForUIProcess(true) , m_isSuspended(false) , m_contentsScale(1) , m_shouldSendScrollPositionUpdate(true) , m_shouldSyncFrame(false) , m_didInitializeRootCompositingLayer(false) , m_layerFlushTimer(this, &CoordinatedLayerTreeHost::layerFlushTimerFired) , m_releaseInactiveAtlasesTimer(this, &CoordinatedLayerTreeHost::releaseInactiveAtlasesTimerFired) , m_layerFlushSchedulingEnabled(true) , m_forceRepaintAsyncCallbackID(0) , m_animationsLocked(false) { // Create a root layer. m_rootLayer = GraphicsLayer::create(this, this); CoordinatedGraphicsLayer* coordinatedRootLayer = toCoordinatedGraphicsLayer(m_rootLayer.get()); coordinatedRootLayer->setRootLayer(true); #ifndef NDEBUG m_rootLayer->setName("CoordinatedLayerTreeHost root layer"); #endif m_rootLayer->setDrawsContent(false); m_rootLayer->setSize(m_webPage->size()); m_layerTreeContext.coordinatedLayerID = toCoordinatedGraphicsLayer(coordinatedRootLayer)->id(); m_nonCompositedContentLayer = GraphicsLayer::create(this, this); #ifndef NDEBUG m_nonCompositedContentLayer->setName("CoordinatedLayerTreeHost non-composited content"); #endif m_nonCompositedContentLayer->setDrawsContent(true); m_nonCompositedContentLayer->setSize(m_webPage->size()); m_rootLayer->addChild(m_nonCompositedContentLayer.get()); if (m_webPage->hasPageOverlay()) createPageOverlayLayer(); scheduleLayerFlush(); }
void CoordinatedGraphicsLayer::setMaskLayer(GraphicsLayer* layer) { if (layer == maskLayer()) return; GraphicsLayer::setMaskLayer(layer); if (!layer) return; layer->setSize(size()); layer->setContentsVisible(contentsAreVisible()); CoordinatedGraphicsLayer* coordinatedLayer = toCoordinatedGraphicsLayer(layer); coordinatedLayer->didChangeLayerState(); m_layerState.mask = coordinatedLayer->id(); m_layerState.maskChanged = true; didChangeLayerState(); }
LayerTreeCoordinator::LayerTreeCoordinator(WebPage* webPage) : LayerTreeHost(webPage) , m_notifyAfterScheduledLayerFlush(false) , m_isValid(true) , m_waitingForUIProcess(true) , m_isSuspended(false) , m_contentsScale(1) , m_shouldSendScrollPositionUpdate(true) , m_shouldSyncFrame(false) , m_shouldSyncRootLayer(true) , m_layerFlushTimer(this, &LayerTreeCoordinator::layerFlushTimerFired) , m_layerFlushSchedulingEnabled(true) , m_forceRepaintAsyncCallbackID(0) { // Create a root layer. m_rootLayer = GraphicsLayer::create(this); CoordinatedGraphicsLayer* webRootLayer = toCoordinatedGraphicsLayer(m_rootLayer.get()); webRootLayer->setRootLayer(true); #ifndef NDEBUG m_rootLayer->setName("LayerTreeCoordinator root layer"); #endif m_rootLayer->setDrawsContent(false); m_rootLayer->setSize(m_webPage->size()); m_layerTreeContext.webLayerID = toCoordinatedGraphicsLayer(webRootLayer)->id(); m_nonCompositedContentLayer = GraphicsLayer::create(this); toCoordinatedGraphicsLayer(m_rootLayer.get())->setCoordinatedGraphicsLayerClient(this); #ifndef NDEBUG m_nonCompositedContentLayer->setName("LayerTreeCoordinator non-composited content"); #endif m_nonCompositedContentLayer->setDrawsContent(true); m_nonCompositedContentLayer->setSize(m_webPage->size()); m_rootLayer->addChild(m_nonCompositedContentLayer.get()); if (m_webPage->hasPageOverlay()) createPageOverlayLayer(); scheduleLayerFlush(); }
static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer) { // These conditions must match the conditions in RenderLayerCompositor::requiresCompositingForPosition. RenderLayerBacking* backing = renderLayer->backing(); if (!backing) return; RenderStyle* style = renderLayer->renderer()->style(); if (!style) return; if (!renderLayer->renderer()->isOutOfFlowPositioned() || renderLayer->renderer()->style()->position() != FixedPosition) return; if (!renderLayer->renderer()->container()->isRenderView()) return; if (!renderLayer->isStackingContext()) return; CoordinatedGraphicsLayer* graphicsLayer = toCoordinatedGraphicsLayer(backing->graphicsLayer()); graphicsLayer->setFixedToViewport(true); }