void LayerAndroid::addDirtyArea() { if (m_drawTransform.hasPerspective()) { state()->doFrameworkFullInval(); return; } // TODO: rewrite this to handle partial invalidate, and to handle base // layer's large clip correctly IntSize layerSize(getSize().width(), getSize().height()); FloatRect area = TilesManager::instance()->shader()->rectInViewCoord(m_drawTransform, layerSize); FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(m_clippingRect); FloatRect clip = TilesManager::instance()->shader()->convertInvViewCoordToViewCoord(clippingRect); area.intersect(clip); IntRect dirtyArea(area.x(), area.y(), area.width(), area.height()); state()->addDirtyArea(dirtyArea); for (int i = 0; i < countChildren(); i++) getChild(i)->addDirtyArea(); }
void GraphicsLayerChromium::updateLayerSize() { IntSize layerSize(m_size.width(), m_size.height()); if (m_transformLayer) { m_transformLayer->setBounds(layerSize); m_layer->layer()->setPosition(FloatPoint()); } m_layer->layer()->setBounds(layerSize); // Note that we don't resize m_contentsLayer-> It's up the caller to do that. }
void LayerPool::addLayer(const RefPtr<PlatformCALayer>& layer) { IntSize layerSize(expandedIntSize(layer->bounds().size())); if (!canReuseLayerWithSize(layerSize)) return; listOfLayersWithSize(layerSize).prepend(layer); m_totalBytes += backingStoreBytesForSize(layerSize); m_lastAddTime = monotonicallyIncreasingTime(); schedulePrune(); }
void GraphicsLayerChromium::updateLayerSize() { IntSize layerSize(m_size.width(), m_size.height()); if (m_transformLayer) { m_transformLayer->setBounds(layerSize); // The anchor of the contents layer is always at 0.5, 0.5, so the position is center-relative. FloatPoint centerPoint(m_size.width() / 2, m_size.height() / 2); m_layer->setPosition(centerPoint); } m_layer->setBounds(layerSize); // Note that we don't resize m_contentsLayer. It's up the caller to do that. // If we've changed the bounds, we need to recalculate the position // of the layer, taking anchor point into account. updateLayerPosition(); }