void GraphicsLayerChromium::clearBackgroundColor() { GraphicsLayer::clearBackgroundColor(); if (WebLayer* contentsLayer = contentsLayerIfRegistered()) contentsLayer->setBackgroundColor(static_cast<RGBA32>(0)); }
void GraphicsLayer::setContentsNeedsDisplay() { if (WebLayer* contentsLayer = contentsLayerIfRegistered()) { contentsLayer->invalidate(); addRepaintRect(m_contentsRect); } }
void GraphicsLayerChromium::updateContentsRect() { WebLayer* contentsLayer = contentsLayerIfRegistered(); if (!contentsLayer) return; contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y())); contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height())); }
void GraphicsLayerChromium::updateLayerBackgroundColor() { WebLayer* contentsLayer = contentsLayerIfRegistered(); if (!contentsLayer) return; // We never create the contents layer just for background color yet. if (m_backgroundColorSet) contentsLayer->setBackgroundColor(m_backgroundColor.rgb()); else contentsLayer->setBackgroundColor(static_cast<RGBA32>(0)); }
void GraphicsLayer::setContentsClippingMaskLayer(GraphicsLayer* contentsClippingMaskLayer) { if (contentsClippingMaskLayer == m_contentsClippingMaskLayer) return; m_contentsClippingMaskLayer = contentsClippingMaskLayer; WebLayer* contentsLayer = contentsLayerIfRegistered(); if (!contentsLayer) return; WebLayer* contentsClippingMaskWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0; contentsLayer->setMaskLayer(contentsClippingMaskWebLayer); updateContentsRect(); }
void GraphicsLayer::updateLayerIsDrawable() { // For the rest of the accelerated compositor code, there is no reason to make a // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag // so it is only given contentsVisible. m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); if (WebLayer* contentsLayer = contentsLayerIfRegistered()) contentsLayer->setDrawsContent(m_contentsVisible); if (m_drawsContent) { m_layer->layer()->invalidate(); for (size_t i = 0; i < m_linkHighlights.size(); ++i) m_linkHighlights[i]->invalidate(); } }
void GraphicsLayer::updateContentsRect() { WebLayer* contentsLayer = contentsLayerIfRegistered(); if (!contentsLayer) return; contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y())); contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height())); if (m_contentsClippingMaskLayer) { if (m_contentsClippingMaskLayer->size() != m_contentsRect.size()) { m_contentsClippingMaskLayer->setSize(m_contentsRect.size()); m_contentsClippingMaskLayer->setNeedsDisplay(); } m_contentsClippingMaskLayer->setPosition(FloatPoint()); m_contentsClippingMaskLayer->setOffsetFromRenderer(offsetFromRenderer() + IntSize(m_contentsRect.location().x(), m_contentsRect.location().y())); } }
void GraphicsLayerChromium::updateNames() { String debugName = "Layer for " + m_nameBase; m_layer->layer()->setDebugName(debugName); if (m_transformLayer) { String debugName = "TransformLayer for " + m_nameBase; m_transformLayer->setDebugName(debugName); } if (WebLayer* contentsLayer = contentsLayerIfRegistered()) { String debugName = "ContentsLayer for " + m_nameBase; contentsLayer->setDebugName(debugName); } if (m_linkHighlight) { String debugName = "LinkHighlight for " + m_nameBase; m_linkHighlight->layer()->setDebugName(debugName); } }
void GraphicsLayerChromium::setContentsNeedsDisplay() { if (WebLayer* contentsLayer = contentsLayerIfRegistered()) contentsLayer->invalidate(); }