void CoordinatedGraphicsLayer::updateContentBuffers() { if (!shouldHaveBackingStore()) { m_mainBackingStore = nullptr; m_previousBackingStore = nullptr; return; } if (m_pendingContentsScaleAdjustment) { adjustContentsScale(); m_pendingContentsScaleAdjustment = false; } // This is the only place we (re)create the main tiled backing store, once we // have a remote client and we are ready to send our data to the UI process. if (!m_mainBackingStore) createBackingStore(); if (m_pendingVisibleRectAdjustment) { m_pendingVisibleRectAdjustment = false; m_mainBackingStore->coverWithTilesIfNeeded(); } m_mainBackingStore->updateTileBuffers(); // The previous backing store is kept around to avoid flickering between // removing the existing tiles and painting the new ones. The first time // the visibleRect is full painted we remove the previous backing store. if (m_mainBackingStore->visibleAreaIsCovered()) m_previousBackingStore = nullptr; }
void WebGraphicsLayer::computeTransformedVisibleRect() { if (!m_shouldUpdateVisibleRect) return; m_shouldUpdateVisibleRect = false; m_layerTransform.setLocalTransform(transform()); m_layerTransform.setPosition(position()); m_layerTransform.setAnchorPoint(anchorPoint()); m_layerTransform.setSize(size()); m_layerTransform.setFlattening(!preserves3D()); m_layerTransform.setChildrenTransform(childrenTransform()); m_layerTransform.combineTransforms(parent() ? toWebGraphicsLayer(parent())->m_layerTransform.combinedForChildren() : TransformationMatrix()); // The combined transform will be used in tiledBackingStoreVisibleRect. adjustVisibleRect(); adjustContentsScale(); }
void WebGraphicsLayer::setContentsScale(float scale) { m_contentsScale = scale; adjustContentsScale(); }