void LinkHighlight::updateGeometry() { // To avoid unnecessary updates (e.g. other entities have requested animations from our WebViewImpl), // only proceed if we actually requested an update. if (!m_geometryNeedsUpdate) return; m_geometryNeedsUpdate = false; bool hasRenderer = m_node && m_node->layoutObject(); const LayoutBoxModelObject* paintInvalidationContainer = hasRenderer ? m_node->layoutObject()->containerForPaintInvalidation() : 0; if (paintInvalidationContainer) attachLinkHighlightToCompositingLayer(paintInvalidationContainer); if (paintInvalidationContainer && computeHighlightLayerPathAndPosition(paintInvalidationContainer)) { // We only need to invalidate the layer if the highlight size has changed, otherwise // we can just re-position the layer without needing to repaint. m_contentLayer->layer()->invalidate(); if (m_currentGraphicsLayer && m_currentGraphicsLayer->isTrackingPaintInvalidations()) m_currentGraphicsLayer->trackPaintInvalidationRect(FloatRect(layer()->position().x, layer()->position().y, layer()->bounds().width, layer()->bounds().height)); } else if (!hasRenderer) { clearGraphicsLayerLinkHighlightPointer(); releaseResources(); } }
void LinkHighlight::updateGeometry() { // To avoid unnecessary updates (e.g. other entities have requested animations from our WebViewImpl), // only proceed if we actually requested an update. if (!m_geometryNeedsUpdate) return; m_geometryNeedsUpdate = false; RenderLayer* compositingLayer = computeEnclosingCompositingLayer(); if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLayer)) { // We only need to invalidate the layer if the highlight size has changed, otherwise // we can just re-position the layer without needing to repaint. m_contentLayer->layer()->invalidate(); } }
void LinkHighlight::updateGeometry() { // To avoid unnecessary updates (e.g. other entities have requested animations from our WebViewImpl), // only proceed if we actually requested an update. if (!m_geometryNeedsUpdate) return; m_geometryNeedsUpdate = false; RenderLayer* compositingLayer = computeEnclosingCompositingLayer(); if (compositingLayer && computeHighlightLayerPathAndPosition(compositingLayer)) { // We only need to invalidate the layer if the highlight size has changed, otherwise // we can just re-position the layer without needing to repaint. m_contentLayer->layer()->invalidate(); if (m_currentGraphicsLayer) m_currentGraphicsLayer->addRepaintRect(FloatRect(layer()->position().x, layer()->position().y, layer()->bounds().width, layer()->bounds().height)); } else if (!m_node || !m_node->renderer()) { clearGraphicsLayerLinkHighlightPointer(); releaseResources(); } }